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-strategy/wargus/files/wargus-2.2.6-build.patch

78 lines
3.0 KiB

From: Julian Ospald <hasufell@gentoo.org>
Date: Sun May 27 18:28:48 UTC 2012
Subject: build system
make paths modifiable
respect LDFLAGs
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -30,6 +30,13 @@
cmake_minimum_required(VERSION 2.6)
set(WARGUS_VERSION 2.2.6)
+########### PATH OPTIONS ###############
+set(BINDIR "bin" CACHE PATH "Where to install binaries")
+set(SHAREDIR "share/games/stratagus/wargus" CACHE PATH "Where to install data files")
+set(DATAROOTDIR "${CMAKE_INSTALL_PREFIX}/share" CACHE PATH "Sets the root of data directories to a non-default location")
+set(ICONDIR "${DATAROOTDIR}/pixmaps" CACHE PATH "Sets the icon directory for desktop entry to a non-default location.")
+set(DESKTOPDIR "${DATAROOTDIR}/applications" CACHE PATH "Sets the desktop file directory for desktop entry to a non-default location.")
+
# Wargus sources
set(pudconvert_SRCS
@@ -154,8 +161,13 @@
endif()
if (NOT WIN32 AND NOT MAEMO)
- add_definitions(-DDATA_PATH="${CMAKE_INSTALL_PREFIX}/share/games/stratagus/wargus")
- add_definitions(-DSCRIPTS_PATH="${CMAKE_INSTALL_PREFIX}/share/games/stratagus/wargus")
+ if(NOT IS_ABSOLUTE "${SHAREDIR}")
+ set(var "${CMAKE_INSTALL_PREFIX}/${SHAREDIR}")
+ else()
+ set(var "${SHAREDIR}")
+ endif()
+ add_definitions(-DDATA_PATH="${var}")
+ add_definitions(-DSCRIPTS_PATH="${var}")
add_definitions(-DSTRATAGUS_BIN="${STRATAGUS}")
endif()
@@ -169,9 +181,7 @@
endif()
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()
# Compile Wargus
@@ -232,16 +242,16 @@
########### install files ###############
-install(TARGETS wargus DESTINATION games)
-install(TARGETS pudconvert wartool DESTINATION bin)
-install(FILES wargus.png DESTINATION share/pixmaps)
-install(FILES wargus.desktop DESTINATION share/applications)
-
-install(DIRECTORY campaigns maps scripts DESTINATION share/games/stratagus/wargus)
-install(FILES contrib/red_cross.png DESTINATION share/games/stratagus/wargus/graphics/missiles)
-install(FILES contrib/cross.png DESTINATION share/games/stratagus/wargus/graphics/ui/cursors)
-install(FILES contrib/food.png contrib/health.png contrib/health2.png contrib/mana.png contrib/mana2.png contrib/ore,stone,coal.png contrib/score.png DESTINATION share/games/stratagus/wargus/graphics/ui)
+install(TARGETS wargus DESTINATION ${BINDIR})
+install(TARGETS pudconvert wartool DESTINATION ${BINDIR})
+install(FILES wargus.png DESTINATION ${ICONDIR})
+install(FILES wargus.desktop DESTINATION ${DESKTOPDIR})
+
+install(DIRECTORY campaigns maps scripts DESTINATION ${SHAREDIR})
+install(FILES contrib/red_cross.png DESTINATION ${SHAREDIR}/graphics/missiles)
+install(FILES contrib/cross.png DESTINATION ${SHAREDIR}/graphics/ui/cursors)
+install(FILES contrib/food.png contrib/health.png contrib/health2.png contrib/mana.png contrib/mana2.png contrib/ore,stone,coal.png contrib/score.png DESTINATION ${SHAREDIR}/graphics/ui)
if(MAEMO)
- install(TARGETS warextract DESTINATION bin)
+ install(TARGETS warextract DESTINATION ${BINDIR})
endif()