forked from hasufell/hasufell-repository
games-strategy/ja2-stracciatella: bump to 0.16.1
This commit is contained in:
parent
12408b7e1b
commit
6fb6b0ba5b
@ -0,0 +1,78 @@
|
||||
From f418b9530c9a1d3723d599147d6e12c630cebb51 Mon Sep 17 00:00:00 2001
|
||||
From: Julian Ospald <hasufell@posteo.de>
|
||||
Date: Fri, 2 Feb 2018 14:13:24 +0100
|
||||
Upstream: submitted, https://github.com/ja2-stracciatella/ja2-stracciatella/pull/703
|
||||
Subject: [PATCH] BUILD: fix install paths by utilizing GNUInstallDirs
|
||||
|
||||
---
|
||||
CMakeLists.txt | 35 ++++++++++++++++++++++-------------
|
||||
1 file changed, 22 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index f354370..9ad99f7 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -19,6 +19,11 @@ set(JA2_BINARY "ja2")
|
||||
set(LAUNCHER_BINARY "ja2-launcher")
|
||||
set(CMAKE_CXX_STANDARD 98)
|
||||
|
||||
+## includes
|
||||
+if (UNIX AND NOT MINGW AND NOT APPLE)
|
||||
+ include(GNUInstallDirs)
|
||||
+endif()
|
||||
+
|
||||
## Versioning
|
||||
|
||||
set(ja2-stracciatella_VERSION_MAJOR "0")
|
||||
@@ -36,8 +41,16 @@ if (NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug RelWithDebInfo." FORCE)
|
||||
endif()
|
||||
set(VERSION_TAG "" CACHE STRING "Build date for nightly versioning")
|
||||
-set(EXTRA_DATA_DIR "" CACHE STRING "Directory for externalized data")
|
||||
-set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
|
||||
+if (UNIX AND NOT MINGW AND NOT APPLE)
|
||||
+ set(EXTRA_DATA_DIR "${CMAKE_INSTALL_FULL_DATADIR}/ja2" CACHE STRING "Directory for externalized data (usually just set CMAKE_INSTALL_DATADIR instead)")
|
||||
+else()
|
||||
+ set(EXTRA_DATA_DIR "" CACHE STRING "Directory for externalized data")
|
||||
+endif()
|
||||
+if (UNIX AND NOT MINGW AND NOT APPLE)
|
||||
+ set(INSTALL_LIB_DIR ${CMAKE_INSTALL_FULL_LIBDIR})
|
||||
+else()
|
||||
+ set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
|
||||
+endif()
|
||||
set(LOCAL_SDL_LIB "" CACHE STRING "Use local SDL library from this directory")
|
||||
set(LIBSTRACCIATELLA_TARGET "" CACHE STRING "Rust target architecture for libstracciatella")
|
||||
option(LOCAL_FLTK_LIB "Build with fltk lib" OFF)
|
||||
@@ -316,22 +329,18 @@ set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}_${CPACK_PACKAGE_VERSION}_${PACKAGE_
|
||||
include(CPack)
|
||||
|
||||
if (UNIX AND NOT MINGW AND NOT APPLE)
|
||||
- install(TARGETS ${JA2_BINARY} RUNTIME DESTINATION bin)
|
||||
+ install(TARGETS ${JA2_BINARY} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
if(BUILD_LAUNCHER)
|
||||
- install(TARGETS ${LAUNCHER_BINARY} RUNTIME DESTINATION bin)
|
||||
+ install(TARGETS ${LAUNCHER_BINARY} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif()
|
||||
- install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/assets/externalized assets/mods assets/unittests DESTINATION share/ja2)
|
||||
- install(FILES ${STRACCIATELLA_SHARED_LIB} DESTINATION ${INSTALL_LIB_DIR})
|
||||
- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/distr-files-linux/ja2-stracciatella.desktop DESTINATION share/applications)
|
||||
+ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/assets/externalized assets/mods assets/unittests DESTINATION ${CMAKE_INSTALL_DATADIR}/ja2)
|
||||
+ install(FILES ${STRACCIATELLA_SHARED_LIB} DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/distr-files-linux/ja2-stracciatella.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
|
||||
install(
|
||||
FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/icons/logo.svg
|
||||
RENAME ja2-stracciatella.svg
|
||||
- DESTINATION share/icons/hicolor/scalable/apps)
|
||||
- if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD|DragonFly|OpenBSD")
|
||||
- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/distr-files-linux/ja2_manpage DESTINATION man/man6 RENAME ja2.6)
|
||||
- else()
|
||||
- install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/distr-files-linux/ja2_manpage DESTINATION share/man/man6 RENAME ja2.6)
|
||||
- endif()
|
||||
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/scalable/apps)
|
||||
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/assets/distr-files-linux/ja2_manpage DESTINATION ${CMAKE_INSTALL_MANDIR}/man6 RENAME ja2.6)
|
||||
else()
|
||||
install(TARGETS ${JA2_BINARY} RUNTIME DESTINATION .)
|
||||
if(BUILD_LAUNCHER)
|
||||
--
|
||||
2.16.1
|
||||
|
@ -1,6 +1,7 @@
|
||||
# Copyright 2016 Julian Ospald <hasufell@posteo.de>
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
require cmake [ api=2 ]
|
||||
require github [ user=ja2-stracciatella tag=v${PV} ]
|
||||
require desktop-utils gtk-icon-cache
|
||||
|
||||
@ -22,44 +23,40 @@ SLOT="0"
|
||||
PLATFORMS="~amd64 ~x86"
|
||||
|
||||
DEPENDENCIES="
|
||||
build:
|
||||
dev-lang/rust
|
||||
build+run:
|
||||
media-libs/SDL:0[X]
|
||||
dev-libs/boost
|
||||
media-libs/SDL:2[>=2.0.4][X]
|
||||
suggestion:
|
||||
games-strategy/ja2-stracciatella-data [[ description = [ GOG data files
|
||||
of ja2 ] ]]
|
||||
"
|
||||
|
||||
DEFAULT_SRC_PREPARE_PATCHES=(
|
||||
"${FILES}"/0001-BUILD-fix-install-paths-by-utilizing-GNUInstallDirs.patch
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
default
|
||||
|
||||
# set the default datadir in ja2.ini to a sane value
|
||||
edo sed -i \
|
||||
-e '/fprintf(IniFile/s#/some/place/where/the/data/is#/usr/share/ja2#' \
|
||||
sgp/SGP.cc
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
# not an autoconf script
|
||||
edo ./configure --prefix=/usr
|
||||
-e 's#/some/place/where/the/data/is#/usr/share/ja2#' \
|
||||
"${CMAKE_SOURCE}"/rust/src/stracciatella.rs
|
||||
default
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
emake Q=""
|
||||
# cargo fetching during build time
|
||||
esandbox disable_net
|
||||
default
|
||||
esandbox enable_net
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake \
|
||||
BINARY_DIR="${IMAGE}/usr/$(exhost --target)/bin" \
|
||||
MANPAGE_DIR="${IMAGE}/usr/share/man/man6" \
|
||||
SHARED_DIR="${IMAGE}/usr/share" \
|
||||
FULL_PATH_EXTRA_DATA_DIR="${IMAGE}/usr/share/ja2" \
|
||||
install
|
||||
cmake_src_install
|
||||
|
||||
insinto /usr/share/ja2/data
|
||||
doins "${WORKBASE}"/editor.slf
|
||||
|
||||
# install our own desktop file
|
||||
edo rm "${IMAGE}"/usr/share/applications/ja2-stracciatella.desktop
|
||||
install_desktop_entry 'Exec=ja2'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user