From fe979a665271b8fff2ed9545fb4b59a4b66f0eb7 Mon Sep 17 00:00:00 2001 From: Begasus Date: Fri, 29 Jul 2016 23:16:11 +0200 Subject: [PATCH] move lgeneral to the correct place according to gentoo packages, added new recipe for 1.3.1 (#744) --- .../lgeneral/additional-files/lgeneral.rdef | 14 +++ .../lgeneral/lgeneral-1.2.3.recipe | 0 games-strategy/lgeneral/lgeneral-1.3.1.recipe | 87 +++++++++++++++++++ .../lgeneral/patches/lgeneral-1.2.3.patchset | 0 .../lgeneral/patches/lgeneral-1.3.1.patchset | 73 ++++++++++++++++ 5 files changed, 174 insertions(+) create mode 100644 games-strategy/lgeneral/additional-files/lgeneral.rdef rename {games-puzzle => games-strategy}/lgeneral/lgeneral-1.2.3.recipe (100%) create mode 100644 games-strategy/lgeneral/lgeneral-1.3.1.recipe rename {games-puzzle => games-strategy}/lgeneral/patches/lgeneral-1.2.3.patchset (100%) create mode 100644 games-strategy/lgeneral/patches/lgeneral-1.3.1.patchset diff --git a/games-strategy/lgeneral/additional-files/lgeneral.rdef b/games-strategy/lgeneral/additional-files/lgeneral.rdef new file mode 100644 index 000000000..b3a1a8fa0 --- /dev/null +++ b/games-strategy/lgeneral/additional-files/lgeneral.rdef @@ -0,0 +1,14 @@ + +resource app_flags B_SINGLE_LAUNCH | B_ARGV_ONLY; + +resource app_version { + major = @MAJOR@, + middle = @MIDDLE@, + minor = @MINOR@, + variety = B_APPV_FINAL, + internal = 0, + short_info = "LGeneral", + long_info = "A turn-based strategy engine" +}; + +resource app_signature "application/x-vnd.lgeneral"; diff --git a/games-puzzle/lgeneral/lgeneral-1.2.3.recipe b/games-strategy/lgeneral/lgeneral-1.2.3.recipe similarity index 100% rename from games-puzzle/lgeneral/lgeneral-1.2.3.recipe rename to games-strategy/lgeneral/lgeneral-1.2.3.recipe diff --git a/games-strategy/lgeneral/lgeneral-1.3.1.recipe b/games-strategy/lgeneral/lgeneral-1.3.1.recipe new file mode 100644 index 000000000..6adb7dde7 --- /dev/null +++ b/games-strategy/lgeneral/lgeneral-1.3.1.recipe @@ -0,0 +1,87 @@ +SUMMARY="A turn-based strategy engine" +DESCRIPTION="LGeneral is a turn-based strategy engine heavily inspired \ +by Panzer General. You play single scenarios or whole campaigns turn by \ +turn against a human player or the AI. Entrenchment, rugged defense, \ +defensive fire, surprise contacts, surrender, unit supply, weather \ +influence, reinforcements and other implementations contribute to the \ +tactical and strategic depth of the game." +HOMEPAGE="http://lgames.sourceforge.net/" +COPYRIGHT="2000-2015 Michael Speck, Leo Savernik, Peter Ivanyi" +LICENSE="GNU GPL v2" +REVISION="1" +SOURCE_URI="http://downloads.sf.net/lgeneral/lgeneral-$portVersion.tar.gz" +CHECKSUM_SHA256="6e95a84d7772f0bd2d64edac8c2aa45c6f750ae47bfb9dc203fe53a089e5562c" +SOURCE_URI_2="http://downloads.sf.net/lgeneral/pg-data.tar.gz" +CHECKSUM_SHA256_2="cc6fa5d263d1d5824d706517958b1bb09b405ba0ed21e63e4a4d38e2727d7a04" +PATCHES="lgeneral-$portVersion.patchset" +ADDITIONAL_FILES="lgeneral.rdef" + +ARCHITECTURES="!x86_gcc2 x86 ?x86_64" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + lgeneral$secondaryArchSuffix = $portVersion + cmd:lgeneral$secondaryArchSuffix = $portVersion + cmd:lgc_pg$secondaryArchSuffix = $portVersion + cmd:lged$secondaryArchSuffix = $portVersion + cmd:ltrextract$secondaryArchSuffix = $portVersion + cmd:shptool$secondaryArchSuffix = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libcrypto$secondaryArchSuffix + lib:libiconv$secondaryArchSuffix + lib:libsdl$secondaryArchSuffix + lib:libsdl_mixer$secondaryArchSuffix + lib:libsdl_net$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libcrypto$secondaryArchSuffix + devel:libiconv$secondaryArchSuffix + devel:libsdl$secondaryArchSuffix + devel:libsdl_mixer$secondaryArchSuffix + devel:libsdl_net$secondaryArchSuffix + devel:libintl$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:make + cmd:gcc$secondaryArchSuffix + cmd:ld + cmd:libtoolize$secondaryArchSuffix + " + +BUILD() +{ + libtoolize --force --copy --install + runConfigure ./configure --disable-nls + + mkdir -p pg-data + cp ../../sources-2/pg-data/* ./pg-data/ + + make $jobArgs +} + +INSTALL() +{ + make install + + local MAJOR="`echo "$portVersion" | cut -d. -f1`" + local MIDDLE="`echo "$portVersion" | cut -d. -f2`" + local MINOR="`echo "$portVersion" | cut -d. -f3`" + sed \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + $portDir/additional-files/lgeneral.rdef > lgeneral.rdef + + addResourcesToBinaries lgeneral.rdef \ + $binDir/lgeneral + + rm -rf $dataDir/applications + rm -rf $dataDir/icons + mkdir -p $dataDir/lgeneral/gfx/{flags,units,terrain} + $binDir/lgc-pg --separate-bridges -s ./pg-data + addAppDeskbarSymlink $binDir/lgeneral LGeneral +} diff --git a/games-puzzle/lgeneral/patches/lgeneral-1.2.3.patchset b/games-strategy/lgeneral/patches/lgeneral-1.2.3.patchset similarity index 100% rename from games-puzzle/lgeneral/patches/lgeneral-1.2.3.patchset rename to games-strategy/lgeneral/patches/lgeneral-1.2.3.patchset diff --git a/games-strategy/lgeneral/patches/lgeneral-1.3.1.patchset b/games-strategy/lgeneral/patches/lgeneral-1.3.1.patchset new file mode 100644 index 000000000..67416e725 --- /dev/null +++ b/games-strategy/lgeneral/patches/lgeneral-1.3.1.patchset @@ -0,0 +1,73 @@ +From b7ed76706d82e32bfb3f748dadffafa622eb3968 Mon Sep 17 00:00:00 2001 +From: begasus +Date: Thu, 28 Jul 2016 11:46:18 +0200 +Subject: applying patch lgeneral 1.3.1 + + +diff --git a/configure b/configure +index 39e357b..fa13fe3 100755 +--- a/configure ++++ b/configure +@@ -5472,7 +5472,7 @@ if ${ac_cv_lib_m_main+:} false; then : + $as_echo_n "(cached) " >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lm $LIBS" ++LIBS="$LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +@@ -5501,7 +5501,7 @@ if test "x$ac_cv_lib_m_main" = xyes; then : + #define HAVE_LIBM 1 + _ACEOF + +- LIBS="-lm $LIBS" ++ LIBS="$LIBS" + + else + as_fn_error $? "maths library is needed" "$LINENO" 5 +diff --git a/src/config.c b/src/config.c +index 3b1dfef..fb495c0 100644 +--- a/src/config.c ++++ b/src/config.c +@@ -22,6 +22,13 @@ + #include + #include + #include ++ ++#ifdef __HAIKU__ ++#include ++#include ++#include ++#endif ++ + #include "lg-sdl.h" + #include "config.h" + #include "parser.h" +@@ -32,13 +39,21 @@ Config config; + /* check if config directory exists; if not create it and set config_dir */ + void check_config_dir_name() + { ++ size_t length; + struct stat info; + #ifndef INSTALLDIR + /* if no installation store config to current directory not home */ + sprintf( config.dir_name, "." ); +-#else ++#elif __HAIKU__ ++ find_directory(B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ config.dir_name, sizeof(config.dir_name) - 1); ++ length = strlen(config.dir_name); ++ snprintf(config.dir_name + length, sizeof(config.dir_name) - (1 + length), ++ "/LGames"); ++ fprintf( stderr, "HAIKU: Config path is %s\n", config.dir_name); ++#else + sprintf( config.dir_name, "%s/.lgames", getenv( "HOME" ) ); +-#endif ++#endif + if ( stat( config.dir_name, &info ) != 0 ) { + int res; + +-- +2.7.0 +