You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/games-engines/stratagus/files/stratagus-2.2.6-build.patch

76 lines
2.5 KiB

From: Julian Ospald <hasufell@gentoo.org>
Date: Sun May 20 17:02:54 UTC 2012
Subject: build-system
respect system LDFLAGS
make install paths modifiable
included upstream: https://bazaar.launchpad.net/~stratagus/stratagus/trunk/revision/8279
also merged: https://bazaar.launchpad.net/~stratagus/stratagus/trunk/revision/8061
--- stratagus_2.2.6.orig/CMakeLists.txt
+++ stratagus_2.2.6.orig/CMakeLists.txt
@@ -587,6 +587,12 @@
set(ENABLE_TOUCHSCREEN ON)
endif()
+# Stratagus needs to have char by default signed
+# No idea how to tell this to other compilers
+if(CMAKE_COMPILER_IS_GNUCXX)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char")
+endif()
+
check_function_exists("strcasestr" HAVE_STRCASESTR)
check_function_exists("strnlen" HAVE_STRNLEN)
@@ -602,9 +608,7 @@
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
if(ENABLE_STRIP)
- set(CMAKE_EXE_LINKER_FLAGS "-s")
-else()
- set(CMAKE_EXE_LINKER_FLAGS "")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s")
endif()
# Print compile info
@@ -836,15 +840,22 @@
########### install files ###############
-install(TARGETS stratagus DESTINATION games)
-install(TARGETS png2stratagus DESTINATION bin)
+# install paths
+set(BINDIR "bin" CACHE PATH "Where to install binaries")
+set(SBINDIR "sbin" CACHE PATH "Where to install metaserver binary")
+set(DOCDIR "share/doc/stratagus" CACHE STRING "Sets the doc directory to a non-default location.")
+set(MANDIR "share/man/man6" CACHE STRING "Sets the man directory to a non-default location.")
+set(STRATAGUS_HEADERS "include" CACHE STRING "Where to install stratagus headers.")
+
+install(TARGETS stratagus DESTINATION ${BINDIR})
+install(TARGETS png2stratagus DESTINATION ${BINDIR})
if(SQLITE_FOUND)
- install(TARGETS metaserver DESTINATION sbin)
+ install(TARGETS metaserver DESTINATION ${SBINDIR})
endif()
if(ENABLE_DOC AND DOXYGEN_FOUND)
- install(FILES doc/stratagus.6 DESTINATION share/man/man6)
+ install(FILES doc/stratagus.6 DESTINATION ${MANDIR})
install(FILES
doc/development.html
doc/faq.html
@@ -858,9 +869,9 @@
doc/README-SDL.txt
DESTINATION share/doc/stratagus
)
- install(DIRECTORY doc/graphics doc/scripts ${CMAKE_CURRENT_BINARY_DIR}/doxygen DESTINATION share/doc/stratagus)
+ install(DIRECTORY doc/graphics doc/scripts ${CMAKE_CURRENT_BINARY_DIR}/doxygen DESTINATION ${DOCDIR})
endif(ENABLE_DOC AND DOXYGEN_FOUND)
if(ENABLE_DEV)
- install(FILES ${gameheaders_HDRS} DESTINATION include)
+ install(FILES ${gameheaders_HDRS} DESTINATION ${STRATAGUS_HEADERS})
endif()