move lgeneral to the correct place according to gentoo packages, added new recipe for 1.3.1 (#744)

This commit is contained in:
Begasus
2016-07-29 23:16:11 +02:00
committed by waddlesplash
parent 23310c267b
commit fe979a6652
5 changed files with 174 additions and 0 deletions

View File

@@ -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";

View File

@@ -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
}

View File

@@ -0,0 +1,73 @@
From b7ed76706d82e32bfb3f748dadffafa622eb3968 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
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 <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
+
+#ifdef __HAIKU__
+#include <SupportDefs.h>
+#include <FindDirectory.h>
+#include <fs_info.h>
+#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