games-strategy/freeorion: initial import
Change-Id: Ic50ae0f57dfadcb306eec0753d47a6e7ced0fe63 Reviewed-on: https://galileo.mailstation.de/gerrit/7065 Reviewed-by: Jenkins <wk@mailstation.de> Reviewed-by: Julian Ospald <hasufell@posteo.de>
This commit is contained in:
parent
4b9e79a99d
commit
3b09863a55
@ -0,0 +1,376 @@
|
|||||||
|
From 2325d4899015776745dff355999c99b384488e13 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Julian Ospald <hasufell@posteo.de>
|
||||||
|
Date: Fri, 9 Sep 2016 14:28:54 +0200
|
||||||
|
Subject: [PATCH] Backport of d87fd278225fb35836471eb0425b6675530d22d9 to 0.4.5
|
||||||
|
|
||||||
|
---
|
||||||
|
CMakeLists.txt | 43 +++++++++++++++++++++++++++----------------
|
||||||
|
GG/CMakeLists.txt | 7 +++----
|
||||||
|
GG/cmake/GiGi.pc.in | 4 ++--
|
||||||
|
GG/cmake/GiGiSDL.pc.in | 4 ++--
|
||||||
|
GG/src/CMakeLists.txt | 9 +++++----
|
||||||
|
GG/src/SDL/CMakeLists.txt | 9 +++++----
|
||||||
|
client/AI/CMakeLists.txt | 2 +-
|
||||||
|
client/human/CMakeLists.txt | 8 +-------
|
||||||
|
parse/CMakeLists.txt | 4 ++--
|
||||||
|
parse/test/CMakeLists.txt | 12 ------------
|
||||||
|
server/CMakeLists.txt | 2 +-
|
||||||
|
11 files changed, 49 insertions(+), 55 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index decefe2..44779f9 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -1,6 +1,8 @@
|
||||||
|
cmake_minimum_required(VERSION 2.6)
|
||||||
|
cmake_policy(VERSION 2.6.4)
|
||||||
|
|
||||||
|
+include(GNUInstallDirs)
|
||||||
|
+
|
||||||
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_HOME_DIRECTORY}/cmake ${CMAKE_HOME_DIRECTORY}/GG/cmake)
|
||||||
|
set(CMAKE_CONFIGURATION_TYPES Debug Release)
|
||||||
|
IF(NOT CMAKE_BUILD_TYPE)
|
||||||
|
@@ -33,9 +35,18 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
|
||||||
|
+if(WIN32)
|
||||||
|
+ set(CMAKE_INSTALL_BINDIR "")
|
||||||
|
+ set(FreeOrion_INSTALL_LIBDIR "")
|
||||||
|
+ set(FreeOrion_INSTALL_FULL_LIBDIR "")
|
||||||
|
+else()
|
||||||
|
+ set(FreeOrion_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}/freeorion")
|
||||||
|
+ set(FreeOrion_INSTALL_FULL_LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}/freeorion")
|
||||||
|
+endif()
|
||||||
|
+
|
||||||
|
set(CMAKE_SKIP_BUILD_RPATH FALSE)
|
||||||
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||||
|
-set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/freeorion")
|
||||||
|
+set(CMAKE_INSTALL_RPATH "${FreeOrion_INSTALL_FULL_LIBDIR}")
|
||||||
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
|
|
||||||
|
if (WIN32)
|
||||||
|
@@ -104,10 +115,11 @@ endif ()
|
||||||
|
# Build common code library #
|
||||||
|
########################################
|
||||||
|
set(BUILD_DEVEL_PACKAGE OFF CACHE INTERNAL "Disables installation of GiGi development files." FORCE)
|
||||||
|
-set(OLD_LIB_SUFFIX ${LIB_SUFFIX})
|
||||||
|
-set(LIB_SUFFIX "${LIB_SUFFIX}/freeorion")
|
||||||
|
+set(_ORIG_CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
+set(CMAKE_INSTALL_LIBDIR "${FreeOrion_INSTALL_LIBDIR}")
|
||||||
|
add_subdirectory(GG)
|
||||||
|
-set(LIB_SUFFIX ${OLD_LIB_SUFFIX})
|
||||||
|
+set(CMAKE_INSTALL_LIBDIR ${_ORIG_CMAKE_INSTALL_LIBDIR})
|
||||||
|
+unset(_ORIG_CMAKE_INSTALL_LIBDIR)
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# Dependencies #
|
||||||
|
@@ -377,31 +389,30 @@ if (BUILD_SDK)
|
||||||
|
else ()
|
||||||
|
install(
|
||||||
|
DIRECTORY default/
|
||||||
|
- DESTINATION share/freeorion/default
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_DATADIR}/freeorion/default
|
||||||
|
COMPONENT COMPONENT_FREEORION_DATA
|
||||||
|
- PATTERN ".svn" EXCLUDE
|
||||||
|
PATTERN "*~" EXCLUDE
|
||||||
|
PATTERN "*.pyc" EXCLUDE
|
||||||
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
TARGETS freeorioncommon
|
||||||
|
- LIBRARY DESTINATION lib${LIB_SUFFIX}/freeorion
|
||||||
|
- RUNTIME DESTINATION .
|
||||||
|
+ LIBRARY DESTINATION ${FreeOrion_INSTALL_LIBDIR}
|
||||||
|
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
COMPONENT COMPONENT_FREEORION
|
||||||
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
${CMAKE_SOURCE_DIR}/freeorion.desktop
|
||||||
|
- DESTINATION share/applications
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications
|
||||||
|
COMPONENT COMPONENT_FREEORION
|
||||||
|
)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
${CMAKE_SOURCE_DIR}/default/data/art/icons/FO_Icon_16x16.png
|
||||||
|
- DESTINATION share/icons/hicolor/16x16/apps/
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps/
|
||||||
|
RENAME freeorion.png
|
||||||
|
COMPONENT COMPONENT_FREEORION
|
||||||
|
)
|
||||||
|
@@ -409,7 +420,7 @@ else ()
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
${CMAKE_SOURCE_DIR}/default/data/art/icons/FO_Icon_24x24.png
|
||||||
|
- DESTINATION share/icons/hicolor/24x24/apps/
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/24x24/apps/
|
||||||
|
RENAME freeorion.png
|
||||||
|
COMPONENT COMPONENT_FREEORION
|
||||||
|
)
|
||||||
|
@@ -417,7 +428,7 @@ else ()
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
${CMAKE_SOURCE_DIR}/default/data/art/icons/FO_Icon_32x32.png
|
||||||
|
- DESTINATION share/icons/hicolor/32x32/apps/
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps/
|
||||||
|
RENAME freeorion.png
|
||||||
|
COMPONENT COMPONENT_FREEORION
|
||||||
|
)
|
||||||
|
@@ -425,7 +436,7 @@ else ()
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
${CMAKE_SOURCE_DIR}/default/data/art/icons/FO_Icon_64x64.png
|
||||||
|
- DESTINATION share/icons/hicolor/64x64/apps/
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps/
|
||||||
|
RENAME freeorion.png
|
||||||
|
COMPONENT COMPONENT_FREEORION
|
||||||
|
)
|
||||||
|
@@ -433,7 +444,7 @@ else ()
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
${CMAKE_SOURCE_DIR}/default/data/art/icons/FO_Icon_128x128.png
|
||||||
|
- DESTINATION share/icons/hicolor/128x128/apps/
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps/
|
||||||
|
RENAME freeorion.png
|
||||||
|
COMPONENT COMPONENT_FREEORION
|
||||||
|
)
|
||||||
|
@@ -441,7 +452,7 @@ else ()
|
||||||
|
install(
|
||||||
|
FILES
|
||||||
|
${CMAKE_SOURCE_DIR}/default/data/art/icons/FO_Icon_256x256.png
|
||||||
|
- DESTINATION share/icons/hicolor/256x256/apps/
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps/
|
||||||
|
RENAME freeorion.png
|
||||||
|
COMPONENT COMPONENT_FREEORION
|
||||||
|
)
|
||||||
|
@@ -470,7 +481,7 @@ else ()
|
||||||
|
wrap_oal.dll
|
||||||
|
z.dll
|
||||||
|
zlib1.dll
|
||||||
|
- DESTINATION bin
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
COMPONENT COMPONENT_FREEORION_WIN32_RUNTIME_DEPS
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
diff --git a/GG/CMakeLists.txt b/GG/CMakeLists.txt
|
||||||
|
index 1078ec3..882116d 100644
|
||||||
|
--- a/GG/CMakeLists.txt
|
||||||
|
+++ b/GG/CMakeLists.txt
|
||||||
|
@@ -3,6 +3,7 @@ cmake_policy(VERSION 2.6.4)
|
||||||
|
|
||||||
|
enable_testing()
|
||||||
|
include(CMakeDependentOption)
|
||||||
|
+include(GNUInstallDirs)
|
||||||
|
|
||||||
|
project(GiGi)
|
||||||
|
|
||||||
|
@@ -131,10 +132,8 @@ configure_file(
|
||||||
|
if (BUILD_DEVEL_PACKAGE)
|
||||||
|
install(
|
||||||
|
DIRECTORY GG
|
||||||
|
- DESTINATION include
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
|
COMPONENT COMPONENT_GIGI_DEVEL
|
||||||
|
- PATTERN ".svn" EXCLUDE
|
||||||
|
- PATTERN "*~" EXCLUDE
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
@@ -172,7 +171,7 @@ if (DOXYGEN_FOUND)
|
||||||
|
if (BUILD_DEVEL_PACKAGE)
|
||||||
|
install(
|
||||||
|
DIRECTORY ${GG_DOC_STAMP_DIR}
|
||||||
|
- DESTINATION doc
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_DOCDIR}
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
diff --git a/GG/cmake/GiGi.pc.in b/GG/cmake/GiGi.pc.in
|
||||||
|
index 3c0a874..ba7cbe6 100644
|
||||||
|
--- a/GG/cmake/GiGi.pc.in
|
||||||
|
+++ b/GG/cmake/GiGi.pc.in
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
prefix=@CMAKE_INSTALL_PREFIX@
|
||||||
|
-libdir=${prefix}/lib@LIB_SUFFIX@
|
||||||
|
-includedir=${prefix}/include
|
||||||
|
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
||||||
|
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
||||||
|
version=@GIGI_VERSION@
|
||||||
|
|
||||||
|
Name: GiGi
|
||||||
|
diff --git a/GG/cmake/GiGiSDL.pc.in b/GG/cmake/GiGiSDL.pc.in
|
||||||
|
index 933c5af..ed2c4e1 100644
|
||||||
|
--- a/GG/cmake/GiGiSDL.pc.in
|
||||||
|
+++ b/GG/cmake/GiGiSDL.pc.in
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
prefix=@CMAKE_INSTALL_PREFIX@
|
||||||
|
-libdir=${prefix}/lib@LIB_SUFFIX@
|
||||||
|
-includedir=${prefix}/include
|
||||||
|
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
||||||
|
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
||||||
|
version=@GIGI_VERSION@
|
||||||
|
|
||||||
|
Name: GiGiSDL
|
||||||
|
diff --git a/GG/src/CMakeLists.txt b/GG/src/CMakeLists.txt
|
||||||
|
index 1ef20d0..d9e90ed 100644
|
||||||
|
--- a/GG/src/CMakeLists.txt
|
||||||
|
+++ b/GG/src/CMakeLists.txt
|
||||||
|
@@ -75,15 +75,16 @@ target_link_libraries(GiGi ${GiGi_LINK_LIBS})
|
||||||
|
|
||||||
|
install(
|
||||||
|
TARGETS GiGi
|
||||||
|
- LIBRARY DESTINATION lib${LIB_SUFFIX}
|
||||||
|
- RUNTIME DESTINATION .
|
||||||
|
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
COMPONENT COMPONENT_GIGI
|
||||||
|
)
|
||||||
|
|
||||||
|
if (BUILD_DEVEL_PACKAGE)
|
||||||
|
install(
|
||||||
|
TARGETS GiGi
|
||||||
|
- ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT COMPONENT_GIGI_DEVEL
|
||||||
|
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
+ COMPONENT COMPONENT_GIGI_DEVEL
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
@@ -98,7 +99,7 @@ if (UNIX AND BUILD_DEVEL_PACKAGE)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES ${CMAKE_BINARY_DIR}/GiGi.pc
|
||||||
|
- DESTINATION lib${LIB_SUFFIX}/pkgconfig
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
||||||
|
COMPONENT COMPONENT_GIGI_DEVEL
|
||||||
|
OPTIONAL
|
||||||
|
)
|
||||||
|
diff --git a/GG/src/SDL/CMakeLists.txt b/GG/src/SDL/CMakeLists.txt
|
||||||
|
index 868778d..3003034 100644
|
||||||
|
--- a/GG/src/SDL/CMakeLists.txt
|
||||||
|
+++ b/GG/src/SDL/CMakeLists.txt
|
||||||
|
@@ -24,15 +24,16 @@ target_link_libraries(GiGiSDL ${GiGiSDL_LINK_LIBS})
|
||||||
|
|
||||||
|
install(
|
||||||
|
TARGETS GiGiSDL
|
||||||
|
- LIBRARY DESTINATION lib${LIB_SUFFIX}
|
||||||
|
- RUNTIME DESTINATION .
|
||||||
|
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
COMPONENT COMPONENT_GIGISDL
|
||||||
|
)
|
||||||
|
|
||||||
|
if (BUILD_DEVEL_PACKAGE)
|
||||||
|
install(
|
||||||
|
TARGETS GiGiSDL
|
||||||
|
- ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT COMPONENT_GIGISDL_DEVEL
|
||||||
|
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
+ COMPONENT COMPONENT_GIGISDL_DEVEL
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
@@ -47,7 +48,7 @@ if (UNIX AND BUILD_DEVEL_PACKAGE)
|
||||||
|
|
||||||
|
install(
|
||||||
|
FILES ${CMAKE_BINARY_DIR}/GiGiSDL.pc
|
||||||
|
- DESTINATION lib${LIB_SUFFIX}/pkgconfig
|
||||||
|
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
|
||||||
|
COMPONENT COMPONENT_GIGI_DEVEL
|
||||||
|
OPTIONAL
|
||||||
|
)
|
||||||
|
diff --git a/client/AI/CMakeLists.txt b/client/AI/CMakeLists.txt
|
||||||
|
index fc559ed..082a9ab 100644
|
||||||
|
--- a/client/AI/CMakeLists.txt
|
||||||
|
+++ b/client/AI/CMakeLists.txt
|
||||||
|
@@ -63,7 +63,7 @@ target_link_libraries(freeorionca
|
||||||
|
|
||||||
|
install(
|
||||||
|
TARGETS freeorionca
|
||||||
|
- RUNTIME DESTINATION bin
|
||||||
|
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
COMPONENT COMPONENT_FREEORION
|
||||||
|
)
|
||||||
|
|
||||||
|
diff --git a/client/human/CMakeLists.txt b/client/human/CMakeLists.txt
|
||||||
|
index afd6294..4c1d308 100644
|
||||||
|
--- a/client/human/CMakeLists.txt
|
||||||
|
+++ b/client/human/CMakeLists.txt
|
||||||
|
@@ -212,13 +212,7 @@ target_link_libraries(freeorion
|
||||||
|
|
||||||
|
install(
|
||||||
|
TARGETS freeorion
|
||||||
|
- RUNTIME DESTINATION bin
|
||||||
|
- COMPONENT COMPONENT_FREEORION
|
||||||
|
-)
|
||||||
|
-
|
||||||
|
-install(
|
||||||
|
- FILES
|
||||||
|
- DESTINATION share/freeorion
|
||||||
|
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
COMPONENT COMPONENT_FREEORION
|
||||||
|
)
|
||||||
|
|
||||||
|
diff --git a/parse/CMakeLists.txt b/parse/CMakeLists.txt
|
||||||
|
index 3b1987e..ebf8632 100644
|
||||||
|
--- a/parse/CMakeLists.txt
|
||||||
|
+++ b/parse/CMakeLists.txt
|
||||||
|
@@ -95,8 +95,8 @@ endif ()
|
||||||
|
|
||||||
|
install(
|
||||||
|
TARGETS freeorionparse
|
||||||
|
- LIBRARY DESTINATION lib${LIB_SUFFIX}/freeorion
|
||||||
|
- RUNTIME DESTINATION .
|
||||||
|
+ LIBRARY DESTINATION ${FreeOrion_INSTALL_LIBDIR}
|
||||||
|
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
COMPONENT COMPONENT_FREEORION
|
||||||
|
)
|
||||||
|
|
||||||
|
diff --git a/parse/test/CMakeLists.txt b/parse/test/CMakeLists.txt
|
||||||
|
index 6929827..be207b4 100644
|
||||||
|
--- a/parse/test/CMakeLists.txt
|
||||||
|
+++ b/parse/test/CMakeLists.txt
|
||||||
|
@@ -26,12 +26,6 @@ target_link_libraries(test_parsers
|
||||||
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
|
)
|
||||||
|
|
||||||
|
-install(
|
||||||
|
- TARGETS test_parsers
|
||||||
|
- RUNTIME DESTINATION .
|
||||||
|
- COMPONENT COMPONENT_FREEORION
|
||||||
|
-)
|
||||||
|
-
|
||||||
|
find_package (Boost REQUIRED COMPONENTS unit_test_framework)
|
||||||
|
|
||||||
|
include_directories (
|
||||||
|
@@ -55,12 +49,6 @@ target_link_libraries(test_parsers_boost
|
||||||
|
${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES}
|
||||||
|
)
|
||||||
|
|
||||||
|
-install(
|
||||||
|
- TARGETS test_parsers_boost
|
||||||
|
- RUNTIME DESTINATION .
|
||||||
|
- COMPONENT COMPONENT_FREEORION
|
||||||
|
-)
|
||||||
|
-
|
||||||
|
add_test(enum_parser ${CMAKE_BINARY_DIR}/test_parsers_boost --run_test EnumParser)
|
||||||
|
add_test(value_ref_double_parser ${CMAKE_BINARY_DIR}/test_parsers_boost --run_test ValueRefDoubleParser)
|
||||||
|
add_test(value_ref_int_parser ${CMAKE_BINARY_DIR}/test_parsers_boost --run_test ValueRefIntParser)
|
||||||
|
diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt
|
||||||
|
index 9a8d7a5..9ead9d0 100644
|
||||||
|
--- a/server/CMakeLists.txt
|
||||||
|
+++ b/server/CMakeLists.txt
|
||||||
|
@@ -65,7 +65,7 @@ target_link_libraries(freeoriond
|
||||||
|
|
||||||
|
install(
|
||||||
|
TARGETS freeoriond
|
||||||
|
- RUNTIME DESTINATION bin
|
||||||
|
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
|
COMPONENT COMPONENT_FREEORION
|
||||||
|
)
|
||||||
|
|
||||||
|
--
|
||||||
|
2.10.0
|
||||||
|
|
@ -0,0 +1,139 @@
|
|||||||
|
From 5a3c309cd4025f207e3a77fe57021934e80de703 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Marcel Metz <mmetz@adrian-broher.net>
|
||||||
|
Date: Mon, 22 Aug 2016 13:14:31 +0200
|
||||||
|
Subject: [PATCH] Make universe object destructors public for boost version
|
||||||
|
1.61
|
||||||
|
|
||||||
|
Fixes #887
|
||||||
|
|
||||||
|
The boost::serialization library changed the way objects are delete when
|
||||||
|
deserializing referenced objects [boost::serialization 69ecae6] which
|
||||||
|
was leading to a compile error. To work around this for the FreeOrion
|
||||||
|
release 0.4.6 we decided to make the UniverseObject derived class
|
||||||
|
destructors public.
|
||||||
|
|
||||||
|
[boost::serialization]:
|
||||||
|
https://github.com/boostorg/serialization/commit/69ecae6919b417be2b2558aefffea97fbe50d4a8
|
||||||
|
---
|
||||||
|
universe/Building.h | 7 +++++++
|
||||||
|
universe/Field.h | 7 +++++++
|
||||||
|
universe/Fleet.h | 7 +++++++
|
||||||
|
universe/Planet.h | 7 +++++++
|
||||||
|
universe/Ship.h | 7 +++++++
|
||||||
|
universe/System.h | 7 +++++++
|
||||||
|
6 files changed, 42 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/universe/Building.h b/universe/Building.h
|
||||||
|
index 5d21130..18d4810 100644
|
||||||
|
--- a/universe/Building.h
|
||||||
|
+++ b/universe/Building.h
|
||||||
|
@@ -68,7 +68,14 @@ class FO_COMMON_API Building : public UniverseObject {
|
||||||
|
|
||||||
|
template <class T> friend void boost::python::detail::value_destroyer<false>::execute(T const volatile* p);
|
||||||
|
template <class T> friend void boost::checked_delete(T* x);
|
||||||
|
+
|
||||||
|
+#if BOOST_VERSION == 106100
|
||||||
|
+public:
|
||||||
|
+#endif
|
||||||
|
~Building() {}
|
||||||
|
+#if BOOST_VERSION == 106100
|
||||||
|
+protected:
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
virtual Building* Clone(int empire_id = ALL_EMPIRES) const; ///< returns new copy of this Building
|
||||||
|
//@}
|
||||||
|
diff --git a/universe/Field.h b/universe/Field.h
|
||||||
|
index 8cb5b9a..f1d454e 100644
|
||||||
|
--- a/universe/Field.h
|
||||||
|
+++ b/universe/Field.h
|
||||||
|
@@ -47,7 +47,14 @@ class FO_COMMON_API Field : public UniverseObject {
|
||||||
|
|
||||||
|
template <class T> friend void boost::python::detail::value_destroyer<false>::execute(T const volatile* p);
|
||||||
|
template <class T> friend void boost::checked_delete(T* x);
|
||||||
|
+
|
||||||
|
+#if BOOST_VERSION == 106100
|
||||||
|
+public:
|
||||||
|
+#endif
|
||||||
|
~Field() {}
|
||||||
|
+#if BOOST_VERSION == 106100
|
||||||
|
+protected:
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
virtual Field* Clone(int empire_id = ALL_EMPIRES) const; ///< returns new copy of this Field
|
||||||
|
//@}
|
||||||
|
diff --git a/universe/Fleet.h b/universe/Fleet.h
|
||||||
|
index 923c2c7..a6a1fe0 100644
|
||||||
|
--- a/universe/Fleet.h
|
||||||
|
+++ b/universe/Fleet.h
|
||||||
|
@@ -149,7 +149,14 @@ class FO_COMMON_API Fleet : public UniverseObject {
|
||||||
|
|
||||||
|
template <class T> friend void boost::python::detail::value_destroyer<false>::execute(T const volatile* p);
|
||||||
|
template <class T> friend void boost::checked_delete(T* x);
|
||||||
|
+
|
||||||
|
+#if BOOST_VERSION == 106100
|
||||||
|
+public:
|
||||||
|
+#endif
|
||||||
|
~Fleet() {}
|
||||||
|
+#if BOOST_VERSION == 106100
|
||||||
|
+protected:
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
virtual Fleet* Clone(int empire_id = ALL_EMPIRES) const; ///< returns new copy of this Fleet
|
||||||
|
//@}
|
||||||
|
diff --git a/universe/Planet.h b/universe/Planet.h
|
||||||
|
index ec4a6c3..44289ef 100644
|
||||||
|
--- a/universe/Planet.h
|
||||||
|
+++ b/universe/Planet.h
|
||||||
|
@@ -183,7 +183,14 @@ class FO_COMMON_API Planet :
|
||||||
|
|
||||||
|
template <class T> friend void boost::python::detail::value_destroyer<false>::execute(T const volatile* p);
|
||||||
|
template <class T> friend void boost::checked_delete(T* x);
|
||||||
|
+
|
||||||
|
+#if BOOST_VERSION == 106100
|
||||||
|
+public:
|
||||||
|
+#endif
|
||||||
|
~Planet() {}
|
||||||
|
+#if BOOST_VERSION == 106100
|
||||||
|
+protected:
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
virtual Planet* Clone(int empire_id = ALL_EMPIRES) const; ///< returns new copy of this Planet
|
||||||
|
//@}
|
||||||
|
diff --git a/universe/Ship.h b/universe/Ship.h
|
||||||
|
index aa71038..4881086 100644
|
||||||
|
--- a/universe/Ship.h
|
||||||
|
+++ b/universe/Ship.h
|
||||||
|
@@ -103,7 +103,14 @@ class FO_COMMON_API Ship : public UniverseObject {
|
||||||
|
|
||||||
|
template <class T> friend void boost::python::detail::value_destroyer<false>::execute(T const volatile* p);
|
||||||
|
template <class T> friend void boost::checked_delete(T* x);
|
||||||
|
+
|
||||||
|
+#if BOOST_VERSION == 106100
|
||||||
|
+public:
|
||||||
|
+#endif
|
||||||
|
~Ship() {}
|
||||||
|
+#if BOOST_VERSION == 106100
|
||||||
|
+protected:
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
virtual Ship* Clone(int empire_id = ALL_EMPIRES) const; ///< returns new copy of this Ship
|
||||||
|
//@}
|
||||||
|
diff --git a/universe/System.h b/universe/System.h
|
||||||
|
index 0740720..5ecb684 100644
|
||||||
|
--- a/universe/System.h
|
||||||
|
+++ b/universe/System.h
|
||||||
|
@@ -132,7 +132,14 @@ class FO_COMMON_API System : public UniverseObject {
|
||||||
|
|
||||||
|
template <class T> friend void boost::python::detail::value_destroyer<false>::execute(T const volatile* p);
|
||||||
|
template <class T> friend void boost::checked_delete(T* x);
|
||||||
|
+
|
||||||
|
+#if BOOST_VERSION == 106100
|
||||||
|
+public:
|
||||||
|
+#endif
|
||||||
|
~System() {}
|
||||||
|
+#if BOOST_VERSION == 106100
|
||||||
|
+protected:
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
virtual System* Clone(int empire_id = ALL_EMPIRES) const; ///< returns new copy of this System
|
||||||
|
//@}
|
@ -0,0 +1,49 @@
|
|||||||
|
From 70c19e312ae86919bd77b39d45fa35dc4b66d458 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Marcel Metz <mmetz@adrian-broher.net>
|
||||||
|
Date: Sun, 21 Aug 2016 20:23:48 +0200
|
||||||
|
Subject: [PATCH] Use old boost::optional implementation for boost 1.61
|
||||||
|
|
||||||
|
Fixes #777
|
||||||
|
|
||||||
|
- boost::spirit v 1.61 relies on the fact that the `Variant` template
|
||||||
|
type of `boost::spirit::qi::detail::find_substitute` typedefs a
|
||||||
|
`types` subtype.
|
||||||
|
- For the failing instantiation of `find_substition` a
|
||||||
|
`boost::optional` is used as `Variant` template type.
|
||||||
|
- `boost::optional` removed its `types` subtype implementation with
|
||||||
|
commit [boost::optional b5b8414c0], which means that this type is
|
||||||
|
missing on every boost version 1.61 and onwards (until fixed of course).
|
||||||
|
- Using the BOOST_OPTIONAL_CONFIG_USE_OLD_IMPLEMENTATION_OF_OPTIONAL
|
||||||
|
reenables the old implementation of boost::optional, which provides a
|
||||||
|
`types` subtype.
|
||||||
|
|
||||||
|
This commits enables said define for boost 1.61 only, because I consider
|
||||||
|
this an upstream bug. The upstream bug is tracked as [boost #12349].
|
||||||
|
|
||||||
|
[boost::optional b5b8414c0]: https://github.com/boostorg/optional/commit/b5b8414c069a2c5f16cc1f9813d069c8b36e2c35
|
||||||
|
[boost #12349]: https://svn.boost.org/trac/boost/ticket/12349
|
||||||
|
---
|
||||||
|
CMakeLists.txt | 10 ++++++++++
|
||||||
|
1 file changed, 10 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||||
|
index 3e70e72..65f1537 100644
|
||||||
|
--- a/CMakeLists.txt
|
||||||
|
+++ b/CMakeLists.txt
|
||||||
|
@@ -143,6 +143,16 @@ find_package(Boost ${MINIMUM_BOOST_VERSION} COMPONENTS chrono date_time filesyst
|
||||||
|
find_package(ZLIB REQUIRED)
|
||||||
|
find_package(Freetype REQUIRED)
|
||||||
|
|
||||||
|
+if(${Boost_VERSION} EQUAL "106100")
|
||||||
|
+ # with boost 1.61 some boost::optional internals were changed. However
|
||||||
|
+ # boost::spirit relies on some API the old implementation provided. This
|
||||||
|
+ # define enables the usage of the old boost::optional implementation.
|
||||||
|
+ # boost upstream tracks this bug as #12349
|
||||||
|
+ add_definitions(
|
||||||
|
+ -DBOOST_OPTIONAL_CONFIG_USE_OLD_IMPLEMENTATION_OF_OPTIONAL
|
||||||
|
+ )
|
||||||
|
+endif()
|
||||||
|
+
|
||||||
|
include_directories(
|
||||||
|
${Boost_INCLUDE_DIRS}
|
||||||
|
${ZLIB_INCLUDE_DIR}
|
87
packages/games-strategy/freeorion/freeorion-0.4.5.exheres-0
Normal file
87
packages/games-strategy/freeorion/freeorion-0.4.5.exheres-0
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
# Copyright 2016 Julian Ospald <hasufell@posteo.de>
|
||||||
|
# Distributed under the terms of the GNU General Public License v2
|
||||||
|
|
||||||
|
CMAKE_SOURCE=${WORKBASE}/src-tarball
|
||||||
|
|
||||||
|
require github [ user=${PN} release=v${PV} pnv=FreeOrion_v${PV}_2015-09-01.f203162_Source suffix=tar.gz ]
|
||||||
|
require cmake [ api=2 ]
|
||||||
|
require gtk-icon-cache
|
||||||
|
|
||||||
|
SUMMARY="A free turn-based space empire and galactic conquest game"
|
||||||
|
DESCRIPTION="
|
||||||
|
FreeOrion is a free, open source, turn-based space empire and galactic conquest
|
||||||
|
(4X) computer game being designed and built by the FreeOrion project. FreeOrion
|
||||||
|
is inspired by the tradition of the Master of Orion games, but is not a clone or
|
||||||
|
remake of that series or any other game.
|
||||||
|
"
|
||||||
|
HOMEPAGE+=" http://www.freeorion.org"
|
||||||
|
|
||||||
|
LICENCES="GPL-2 LGPL-2.1 CCPL-Attribution-ShareAlike-3.0"
|
||||||
|
SLOT="0"
|
||||||
|
PLATFORMS="~amd64"
|
||||||
|
MYOPTIONS="
|
||||||
|
( providers: ijg-jpeg jpeg-turbo ) [[ number-selected = exactly-one ]]
|
||||||
|
"
|
||||||
|
|
||||||
|
DEPENDENCIES="
|
||||||
|
build:
|
||||||
|
virtual/pkg-config
|
||||||
|
build+run:
|
||||||
|
dev-lang/python:2.7
|
||||||
|
dev-libs/boost
|
||||||
|
media-libs/SDL:2[X]
|
||||||
|
media-libs/freetype:2
|
||||||
|
media-libs/glew
|
||||||
|
media-libs/libogg
|
||||||
|
media-libs/libpng:=
|
||||||
|
media-libs/libvorbis
|
||||||
|
media-libs/openal
|
||||||
|
media-libs/tiff
|
||||||
|
sci-physics/bullet
|
||||||
|
sys-libs/zlib
|
||||||
|
x11-dri/glu
|
||||||
|
x11-dri/mesa
|
||||||
|
providers:ijg-jpeg? ( media-libs/jpeg:= )
|
||||||
|
providers:jpeg-turbo? ( media-libs/libjpeg-turbo )
|
||||||
|
"
|
||||||
|
|
||||||
|
BUGS_TO="hasufell@posteo.de"
|
||||||
|
|
||||||
|
DEFAULT_SRC_PREPARE_PATCHES=(
|
||||||
|
"${FILES}"/70c19e312ae86919bd77b39d45fa35dc4b66d458.patch
|
||||||
|
"${FILES}"/5a3c309cd4025f207e3a77fe57021934e80de703.patch
|
||||||
|
"${FILES}"/0001-Backport-of-d87fd278225fb35836471eb0425b6675530d22d9.patch
|
||||||
|
)
|
||||||
|
|
||||||
|
CMAKE_SRC_CONFIGURE_PARAMS=(
|
||||||
|
-DRELEASE_COMPILE_FLAGS=""
|
||||||
|
-DCMAKE_SKIP_RPATH=ON
|
||||||
|
)
|
||||||
|
|
||||||
|
src_prepare() {
|
||||||
|
cmake_src_prepare
|
||||||
|
|
||||||
|
# parse subdir sets -O3
|
||||||
|
edo sed -e "s:-O3::" -i "${CMAKE_SOURCE}"/parse/CMakeLists.txt
|
||||||
|
}
|
||||||
|
|
||||||
|
src_install() {
|
||||||
|
cmake_src_install
|
||||||
|
|
||||||
|
# we need a wrapper
|
||||||
|
edo mv "${IMAGE}"/usr/$(exhost --target)/bin/${PN} \
|
||||||
|
"${IMAGE}"/usr/$(exhost --target)/bin/${PN}.bin
|
||||||
|
|
||||||
|
herebin "${PN}" <<EOF
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "\${LD_LIBRARY_PATH+set}" = "set" ] ; then
|
||||||
|
export LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:/usr/$(exhost --target)/lib/freeorion"
|
||||||
|
else
|
||||||
|
export LD_LIBRARY_PATH="/usr/$(exhost --target)/lib/freeorion"
|
||||||
|
fi
|
||||||
|
exec /usr/$(exhost --target)/bin/${PN}.bin --resource-dir /usr/share/freeorion/default "\$@"
|
||||||
|
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user