summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'games-strategy/freesynd')
-rw-r--r--games-strategy/freesynd/Manifest1
-rw-r--r--games-strategy/freesynd/files/freesynd-0.7.5-cmake.patch28
-rw-r--r--games-strategy/freesynd/freesynd-0.7.5.ebuild74
3 files changed, 103 insertions, 0 deletions
diff --git a/games-strategy/freesynd/Manifest b/games-strategy/freesynd/Manifest
index ec0c30a3ed23..3649211a0f11 100644
--- a/games-strategy/freesynd/Manifest
+++ b/games-strategy/freesynd/Manifest
@@ -1 +1,2 @@
DIST freesynd-0.7.1.tar.gz 2576695 BLAKE2B 11b8f1d25768cdef6cf6894e8141cd13562a133a3253aa5b19034f0c54f114081dd97d41d230c74b5b1aaf66d84ad45d0c09ca5cdc72fb1de00a39ff23ad1272 SHA512 b87e6adaf71206532b4f90cd230ca6be00438fe26f000c5a0bfebf2839fea80d78d98ddc27331a2224874338c3e14ffbfa58b8c5bdbdc53c93bba8d6a9e6b7b4
+DIST freesynd-0.7.5.tar.gz 2622888 BLAKE2B 1fedaa8a4e07c64941f83b0352b84419d61f8ef828cd923947643b9547aa92016bc765b6acc4f8272bf2ca7aafa60bd25c5eaba85a37ab1410c826c0d9d46253 SHA512 70cd28c660c7e000f799746be62dbcdc284a5ab8da8670e5b4f0fca0fdbe265cde1014f08fd6f0ed41fb50188fc1e672c8a4267722715cecaa354f47a8ef746c
diff --git a/games-strategy/freesynd/files/freesynd-0.7.5-cmake.patch b/games-strategy/freesynd/files/freesynd-0.7.5-cmake.patch
new file mode 100644
index 000000000000..6448271b1f99
--- /dev/null
+++ b/games-strategy/freesynd/files/freesynd-0.7.5-cmake.patch
@@ -0,0 +1,28 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -34,6 +34,13 @@
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_C_FLAGS}")
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXX_FLAGS}")
+
++option(BUILD_DEV_TOOLS "Build development tools")
++option(WITH_DEBUG "Enable debug definitions")
++
++if(WITH_DEBUG)
++ add_definitions (-D_DEBUG)
++endif()
++
+ # Set standard definitions for all platforms.
+ add_definitions (-DSYSTEM_SDL)
+ add_definitions (-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\")
+@@ -59,10 +66,7 @@
+ message (FATAL_ERROR "Unable to locate PNG")
+ endif ()
+
+-if (CMAKE_BUILD_TYPE STREQUAL "debug" OR CMAKE_BUILD_TYPE STREQUAL "Debug")
+- set (BUILD_DEV_TOOLS TRUE)
+-else ()
+- set (BUILD_DEV_TOOLS FALSE)
++if (CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE STREQUAL "debug")
+ # We only define an install target if we're doing a release build.
+ # Furthermore, on Mac, the data folder is a part of the app bundle.
+ if (NOT APPLE)
diff --git a/games-strategy/freesynd/freesynd-0.7.5.ebuild b/games-strategy/freesynd/freesynd-0.7.5.ebuild
new file mode 100644
index 000000000000..b42449bf5823
--- /dev/null
+++ b/games-strategy/freesynd/freesynd-0.7.5.ebuild
@@ -0,0 +1,74 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_IN_SOURCE_BUILD=1
+inherit cmake desktop xdg-utils readme.gentoo-r1
+
+DESCRIPTION="Portable engine reimplementation for the classic Bullfrog game Syndicate"
+HOMEPAGE="https://freesynd.sourceforge.io/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug devtools"
+
+RDEPEND="
+ media-libs/libogg
+ media-libs/libpng:0=
+ media-libs/libsdl[X,sound,video]
+ media-libs/libvorbis
+ media-libs/sdl-mixer[mp3,vorbis]
+ media-libs/sdl-image[png]
+"
+DEPEND="${RDEPEND}"
+
+DOCS=( NEWS README INSTALL AUTHORS )
+
+PATCHES=( "${FILESDIR}"/${P}-cmake.patch )
+
+DOC_CONTENTS="
+ You have to set \"data_dir = /my/path/to/synd-data\"
+ in \"~/.${PN}/${PN}.ini\".
+"
+
+src_prepare() {
+ cmake_src_prepare
+
+ sed -e "s:#freesynd_data_dir = /usr/share/freesynd/data:freesynd_data_dir = /usr/share/${PN}/data:" \
+ -i ${PN}.ini || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DWITH_DEBUG=$(usex debug)
+ -DBUILD_DEV_TOOLS=$(usex devtools)
+ )
+ cmake_src_configure
+}
+
+src_install() {
+ dobin src/${PN}
+ use devtools && newbin src/dump ${PN}-dump
+ insinto /usr/share/${PN}
+ doins -r data
+ newicon -s 128 icon/sword.png ${PN}.png
+ make_desktop_entry ${PN}
+ einstalldocs
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ xdg_icon_cache_update
+ if use debug ; then
+ ewarn "Debug build is not meant for regular playing,"
+ ewarn "game speed is higher."
+ fi
+ readme.gentoo_print_elog
+}
+
+pkg_postrm() {
+ xdg_icon_cache_update
+}