From b7d86baa6d0f45fb653bf201a9f2a7dbe469065a Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 11 Jan 2015 18:20:24 -0800 Subject: [PATCH 1/9] Fix python crash on resource.getrusage --- dev-lang/python/patches/python-2.7.9.patchset | 98 +++++++++++++------ dev-lang/python/python-2.7.9.recipe | 2 +- 2 files changed, 68 insertions(+), 32 deletions(-) diff --git a/dev-lang/python/patches/python-2.7.9.patchset b/dev-lang/python/patches/python-2.7.9.patchset index fafb60a2f..b09445b20 100644 --- a/dev-lang/python/patches/python-2.7.9.patchset +++ b/dev-lang/python/patches/python-2.7.9.patchset @@ -1,4 +1,4 @@ -From f7d6b2b6f44a8f9337c9103d298222747d547ebf Mon Sep 17 00:00:00 2001 +From ca78f3e4c26f1d94def56bd1a5fec519d2b0579c Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Wed, 12 Mar 2014 21:17:06 +0000 Subject: initial Haiku patch @@ -79,7 +79,7 @@ index b9f1c6c..7be61d3 100644 # finalize_unix () diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py -index 4aa9334..d06e5e8 100644 +index de7da1d..8180c8e 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py @@ -90,7 +90,8 @@ def get_python_inc(plat_specific=0, prefix=None): @@ -497,10 +497,10 @@ index 53a6c3e..6c5f52f 100644 if (PyErr_Occurred()) { Py_DECREF(result); diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c -index 880f311..54b66f7 100644 +index e9e4479..84b6305 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c -@@ -4868,7 +4868,9 @@ init_socket(void) +@@ -4869,7 +4869,9 @@ init_socket(void) #ifndef __BEOS__ /* We have incomplete socket support. */ PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW); @@ -511,7 +511,7 @@ index 880f311..54b66f7 100644 PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM); #endif diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h -index 8515499..4e33e4f 100644 +index d98e00e..2bfb3dc 100644 --- a/Modules/socketmodule.h +++ b/Modules/socketmodule.h @@ -47,6 +47,10 @@ typedef int socklen_t; @@ -584,10 +584,10 @@ index c64501e..7df3ad7 100755 elif sys.platform.startswith("atheos"): searchdirs=os.environ['C_INCLUDE_PATH'].split(':') diff --git a/configure.ac b/configure.ac -index 54f8c0f..1ea438a 100644 +index 94a215e..41fbd47 100644 --- a/configure.ac +++ b/configure.ac -@@ -883,7 +883,7 @@ if test $enable_shared = "yes"; then +@@ -886,7 +886,7 @@ if test $enable_shared = "yes"; then RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} INSTSONAME="$LDLIBRARY".$SOVERSION ;; @@ -596,7 +596,7 @@ index 54f8c0f..1ea438a 100644 LDLIBRARY='libpython$(VERSION).so' BLDLIBRARY='-L. -lpython$(VERSION)' RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} -@@ -891,6 +891,9 @@ if test $enable_shared = "yes"; then +@@ -894,6 +894,9 @@ if test $enable_shared = "yes"; then FreeBSD*) SOVERSION=`echo $SOVERSION|cut -d "." -f 1` ;; @@ -606,7 +606,7 @@ index 54f8c0f..1ea438a 100644 esac INSTSONAME="$LDLIBRARY".$SOVERSION ;; -@@ -1006,7 +1009,7 @@ AC_PROG_MKDIR_P +@@ -1009,7 +1012,7 @@ AC_PROG_MKDIR_P AC_SUBST(LN) if test -z "$LN" ; then case $ac_sys_system in @@ -615,7 +615,7 @@ index 54f8c0f..1ea438a 100644 CYGWIN*) LN="ln -s";; atheos*) LN="ln -s";; *) LN=ln;; -@@ -2030,7 +2033,7 @@ then +@@ -2033,7 +2036,7 @@ then BLDSHARED="$LDSHARED" fi ;; @@ -624,7 +624,7 @@ index 54f8c0f..1ea438a 100644 LDSHARED='$(CC) -shared' LDCXXSHARED='$(CXX) -shared';; BSD/OS*/4*) -@@ -2102,7 +2105,7 @@ then +@@ -2105,7 +2108,7 @@ then then CCSHARED="-fPIC"; else CCSHARED="+z"; fi;; @@ -633,7 +633,7 @@ index 54f8c0f..1ea438a 100644 BSD/OS*/4*) CCSHARED="-fpic";; FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";; OpenUNIX*|UnixWare*) -@@ -2134,7 +2137,7 @@ then +@@ -2137,7 +2140,7 @@ then LINKFORSHARED="-Wl,-E -Wl,+s";; # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; @@ -642,7 +642,7 @@ index 54f8c0f..1ea438a 100644 # -u libsys_s pulls in all symbols in libsys Darwin/*) # -u _PyMac_Error is needed to pull in the mac toolbox glue, -@@ -2249,14 +2252,16 @@ case "$ac_sys_system" in +@@ -2252,14 +2255,16 @@ case "$ac_sys_system" in esac # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. @@ -663,7 +663,7 @@ index 54f8c0f..1ea438a 100644 esac AC_MSG_CHECKING(for --with-libs) -@@ -3592,7 +3597,7 @@ fi], +@@ -3595,7 +3600,7 @@ fi], AC_SUBST(LIBM) case $ac_sys_system in Darwin) ;; @@ -673,10 +673,10 @@ index 54f8c0f..1ea438a 100644 esac AC_MSG_CHECKING(for --with-libm=STRING) diff --git a/setup.py b/setup.py -index a46bf35..9fe247f 100644 +index 7868b7b..bc4a1a4 100644 --- a/setup.py +++ b/setup.py -@@ -523,6 +523,12 @@ class PyBuildExt(build_ext): +@@ -525,6 +525,12 @@ class PyBuildExt(build_ext): lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) inc_dirs += ['/system/include', '/atheos/autolnk/include'] inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) @@ -689,7 +689,7 @@ index a46bf35..9fe247f 100644 # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) if host_platform in ['osf1', 'unixware7', 'openunix8']: -@@ -551,7 +557,7 @@ class PyBuildExt(build_ext): +@@ -553,7 +559,7 @@ class PyBuildExt(build_ext): # Check for MacOS X, which doesn't need libm.a at all math_libs = ['m'] @@ -698,7 +698,7 @@ index a46bf35..9fe247f 100644 math_libs = [] # XXX Omitted modules: gl, pure, dl, SGI-specific modules -@@ -790,15 +796,22 @@ class PyBuildExt(build_ext): +@@ -792,15 +798,22 @@ class PyBuildExt(build_ext): '/usr/local/ssl/include', '/usr/contrib/ssl/include/' ] @@ -724,7 +724,7 @@ index a46bf35..9fe247f 100644 ['/usr/local/ssl/lib', '/usr/contrib/ssl/lib/' ] ) -@@ -806,8 +819,8 @@ class PyBuildExt(build_ext): +@@ -808,8 +821,8 @@ class PyBuildExt(build_ext): if (ssl_incs is not None and ssl_libs is not None): exts.append( Extension('_ssl', ['_ssl.c'], @@ -735,7 +735,7 @@ index a46bf35..9fe247f 100644 libraries = ['ssl', 'crypto'], depends = ['socketmodule.h']), ) else: -@@ -845,8 +858,8 @@ class PyBuildExt(build_ext): +@@ -847,8 +860,8 @@ class PyBuildExt(build_ext): # The _hashlib module wraps optimized implementations # of hash functions from the OpenSSL library. exts.append( Extension('_hashlib', ['_hashopenssl.c'], @@ -746,7 +746,7 @@ index a46bf35..9fe247f 100644 libraries = ['ssl', 'crypto']) ) else: print ("warning: openssl 0x%08x is too old for _hashlib" % -@@ -1325,7 +1338,7 @@ class PyBuildExt(build_ext): +@@ -1327,7 +1340,7 @@ class PyBuildExt(build_ext): missing.append('resource') # Sun yellow pages. Some systems have the functions in libc. @@ -759,14 +759,14 @@ index a46bf35..9fe247f 100644 1.8.3.4 -From 571ed69e1ab40fd11c4a1fdcb6198ff787c5129b Mon Sep 17 00:00:00 2001 +From af64f0fbd90f24886cac80f79f3db0da46ede0e5 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sat, 5 Apr 2014 21:16:40 +0000 Subject: fix pyconfig.h path diff --git a/Makefile.pre.in b/Makefile.pre.in -index bcd83bf..f93c10a 100644 +index 7f4ec2f..25a93e5 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -105,7 +105,7 @@ BINDIR= @bindir@ @@ -782,7 +782,7 @@ index bcd83bf..f93c10a 100644 1.8.3.4 -From d49a8ee2494391b3a1c50bc652f0838ac036e046 Mon Sep 17 00:00:00 2001 +From fa99392d5c5df974b86ff319148514644731d192 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Wed, 18 Jun 2014 12:19:13 +0000 Subject: Import missed change from the 2.6.9 patches @@ -814,17 +814,17 @@ index d2e18f1..34d5aee 100644 1.8.3.4 -From a0b72ccfc2f385c3ec9148523d981c7d971e2636 Mon Sep 17 00:00:00 2001 +From c2e1dc174241f7beedf43ee5bef3c76e0600e069 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 21 Sep 2014 18:59:44 +0200 Subject: gcc2 fix. diff --git a/Modules/_ctypes/libffi/include/ffi_common.h b/Modules/_ctypes/libffi/include/ffi_common.h -index 650ca69..02a1913 100644 +index 37f5a9e..37b0b25 100644 --- a/Modules/_ctypes/libffi/include/ffi_common.h +++ b/Modules/_ctypes/libffi/include/ffi_common.h -@@ -115,7 +115,7 @@ typedef signed int SINT64 __attribute__((__mode__(__DI__))); +@@ -119,7 +119,7 @@ typedef signed int SINT64 __attribute__((__mode__(__DI__))); typedef float FLOAT32; @@ -837,17 +837,17 @@ index 650ca69..02a1913 100644 1.8.3.4 -From d50a28e47cbd54263d065f47b2650333d917c2b9 Mon Sep 17 00:00:00 2001 +From a0bdbb8e92894e1de5a453ca08659d68e75b67d1 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Fri, 28 Nov 2014 16:26:28 +0000 Subject: tarfile: let link fail and catch exception. diff --git a/Lib/tarfile.py b/Lib/tarfile.py -index 57ea877..bc3f82c 100644 +index b0d1292..b5952ae 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py -@@ -2242,7 +2242,7 @@ class TarFile(object): +@@ -2261,7 +2261,7 @@ class TarFile(object): (platform limitation), we try to make a copy of the referenced file instead of a link. """ @@ -856,7 +856,7 @@ index 57ea877..bc3f82c 100644 # For systems that support symbolic and hard links. if tarinfo.issym(): if os.path.lexists(targetpath): -@@ -2256,7 +2256,7 @@ class TarFile(object): +@@ -2275,7 +2275,7 @@ class TarFile(object): os.link(tarinfo._link_target, targetpath) else: self._extract_member(self._find_link_target(tarinfo), targetpath) @@ -868,3 +868,39 @@ index 57ea877..bc3f82c 100644 -- 1.8.3.4 + +From 77217bde28ee863a42421f87692d986a8f784896 Mon Sep 17 00:00:00 2001 +From: Timothy Gu +Date: Sun, 11 Jan 2015 18:18:22 -0800 +Subject: Fix resource module after the initial haiku patch + + +diff --git a/Modules/resource.c b/Modules/resource.c +index 6c5f52f..73758bb 100644 +--- a/Modules/resource.c ++++ b/Modules/resource.c +@@ -101,6 +101,21 @@ resource_getrusage(PyObject *self, PyObject *args) + PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals)); + PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw)); + PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw)); ++#else ++ PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 5, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 6, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 7, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 8, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 9, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 10, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 11, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 12, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(0)); + #endif + + if (PyErr_Occurred()) { +-- +1.8.3.4 + diff --git a/dev-lang/python/python-2.7.9.recipe b/dev-lang/python/python-2.7.9.recipe index dc6e40078..a5d00a643 100644 --- a/dev-lang/python/python-2.7.9.recipe +++ b/dev-lang/python/python-2.7.9.recipe @@ -13,7 +13,7 @@ LICENSE="Python" COPYRIGHT="1990-2012, Python Software Foundation" SRC_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz" CHECKSUM_SHA256="90d27e14ea7e03570026850e2e50ba71ad20b7eb31035aada1cf3def8f8d4916" -REVISION="1" +REVISION="2" ARCHITECTURES="x86_gcc2 x86 x86_64" PATCHES="python-$portVersion.patchset" From 0561b48fd8d48221848afa3284d3aebbdb022074 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 11 Jan 2015 18:43:34 -0800 Subject: [PATCH 2/9] python: Stricter [gs]et_rlimit mode detection There doesn't seem to be a better way, else than configure runtime checks, which is harmful for cross-compilation. --- dev-lang/python/patches/python-2.7.9.patchset | 91 +++++++++++++++++-- dev-lang/python/python-2.7.9.recipe | 2 +- 2 files changed, 86 insertions(+), 7 deletions(-) diff --git a/dev-lang/python/patches/python-2.7.9.patchset b/dev-lang/python/patches/python-2.7.9.patchset index b09445b20..6d16b8d6a 100644 --- a/dev-lang/python/patches/python-2.7.9.patchset +++ b/dev-lang/python/patches/python-2.7.9.patchset @@ -1,4 +1,4 @@ -From ca78f3e4c26f1d94def56bd1a5fec519d2b0579c Mon Sep 17 00:00:00 2001 +From 87c88af3eef31c978cecf0d96665af0c4109d7e5 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Wed, 12 Mar 2014 21:17:06 +0000 Subject: initial Haiku patch @@ -759,7 +759,7 @@ index 7868b7b..bc4a1a4 100644 1.8.3.4 -From af64f0fbd90f24886cac80f79f3db0da46ede0e5 Mon Sep 17 00:00:00 2001 +From 6347fda5298f9aa5eca939541924464fcf8a19d1 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sat, 5 Apr 2014 21:16:40 +0000 Subject: fix pyconfig.h path @@ -782,7 +782,7 @@ index 7f4ec2f..25a93e5 100644 1.8.3.4 -From fa99392d5c5df974b86ff319148514644731d192 Mon Sep 17 00:00:00 2001 +From 5e90b750c4bfef1376bb083d48524c41fc5fefa6 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Wed, 18 Jun 2014 12:19:13 +0000 Subject: Import missed change from the 2.6.9 patches @@ -814,7 +814,7 @@ index d2e18f1..34d5aee 100644 1.8.3.4 -From c2e1dc174241f7beedf43ee5bef3c76e0600e069 Mon Sep 17 00:00:00 2001 +From 307d21aa5ea6336db7ec3dd9429436441b61ab8d Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 21 Sep 2014 18:59:44 +0200 Subject: gcc2 fix. @@ -837,7 +837,7 @@ index 37f5a9e..37b0b25 100644 1.8.3.4 -From a0bdbb8e92894e1de5a453ca08659d68e75b67d1 Mon Sep 17 00:00:00 2001 +From b1aabdb8e27c669873ec393344389aa343a6aeab Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Fri, 28 Nov 2014 16:26:28 +0000 Subject: tarfile: let link fail and catch exception. @@ -869,7 +869,7 @@ index b0d1292..b5952ae 100644 1.8.3.4 -From 77217bde28ee863a42421f87692d986a8f784896 Mon Sep 17 00:00:00 2001 +From 5398326cd9e24ca71a025f48ea0079b8d40456ec Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 11 Jan 2015 18:18:22 -0800 Subject: Fix resource module after the initial haiku patch @@ -904,3 +904,82 @@ index 6c5f52f..73758bb 100644 -- 1.8.3.4 + +From 6d7958a9371618a6b7a53f8de6b71633be2af7c3 Mon Sep 17 00:00:00 2001 +From: Timothy Gu +Date: Sun, 11 Jan 2015 18:40:43 -0800 +Subject: resource: Fix [gs]et_rlimit() modes detection + +Haiku defines many of them, but they are actually empty stubs that will always +return EINVAL. No better way of doing this. + +diff --git a/Modules/resource.c b/Modules/resource.c +index 73758bb..0c396f6 100644 +--- a/Modules/resource.c ++++ b/Modules/resource.c +@@ -284,19 +284,19 @@ initresource(void) + (PyObject*) &StructRUsageType); + + /* insert constants */ +-#ifdef RLIMIT_CPU ++#if !defined(__HAIKU__) && defined(RLIMIT_CPU) + PyModule_AddIntConstant(m, "RLIMIT_CPU", RLIMIT_CPU); + #endif + +-#ifdef RLIMIT_FSIZE ++#if !defined(__HAIKU__) && defined(RLIMIT_FSIZE) + PyModule_AddIntConstant(m, "RLIMIT_FSIZE", RLIMIT_FSIZE); + #endif + +-#ifdef RLIMIT_DATA ++#if !defined(__HAIKU__) && defined(RLIMIT_DATA) + PyModule_AddIntConstant(m, "RLIMIT_DATA", RLIMIT_DATA); + #endif + +-#ifdef RLIMIT_STACK ++#if !defined(__HAIKU__) && defined(RLIMIT_STACK) + PyModule_AddIntConstant(m, "RLIMIT_STACK", RLIMIT_STACK); + #endif + +@@ -308,31 +308,31 @@ initresource(void) + PyModule_AddIntConstant(m, "RLIMIT_NOFILE", RLIMIT_NOFILE); + #endif + +-#ifdef RLIMIT_OFILE ++#if !defined(__HAIKU__) && defined(RLIMIT_OFILE) + PyModule_AddIntConstant(m, "RLIMIT_OFILE", RLIMIT_OFILE); + #endif + +-#ifdef RLIMIT_VMEM ++#if !defined(__HAIKU__) && defined(RLIMIT_VMEM) + PyModule_AddIntConstant(m, "RLIMIT_VMEM", RLIMIT_VMEM); + #endif + +-#ifdef RLIMIT_AS ++#if !defined(__HAIKU__) && defined(RLIMIT_AS) + PyModule_AddIntConstant(m, "RLIMIT_AS", RLIMIT_AS); + #endif + +-#ifdef RLIMIT_RSS ++#if !defined(__HAIKU__) && defined(RLIMIT_RSS) + PyModule_AddIntConstant(m, "RLIMIT_RSS", RLIMIT_RSS); + #endif + +-#ifdef RLIMIT_NPROC ++#if !defined(__HAIKU__) && defined(RLIMIT_NPROC) + PyModule_AddIntConstant(m, "RLIMIT_NPROC", RLIMIT_NPROC); + #endif + +-#ifdef RLIMIT_MEMLOCK ++#if !defined(__HAIKU__) && defined(RLIMIT_MEMLOCK) + PyModule_AddIntConstant(m, "RLIMIT_MEMLOCK", RLIMIT_MEMLOCK); + #endif + +-#ifdef RLIMIT_SBSIZE ++#if !defined(__HAIKU__) && defined(RLIMIT_SBSIZE) + PyModule_AddIntConstant(m, "RLIMIT_SBSIZE", RLIMIT_SBSIZE); + #endif + +-- +1.8.3.4 + diff --git a/dev-lang/python/python-2.7.9.recipe b/dev-lang/python/python-2.7.9.recipe index a5d00a643..34a5db8ca 100644 --- a/dev-lang/python/python-2.7.9.recipe +++ b/dev-lang/python/python-2.7.9.recipe @@ -13,7 +13,7 @@ LICENSE="Python" COPYRIGHT="1990-2012, Python Software Foundation" SRC_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz" CHECKSUM_SHA256="90d27e14ea7e03570026850e2e50ba71ad20b7eb31035aada1cf3def8f8d4916" -REVISION="2" +REVISION="3" ARCHITECTURES="x86_gcc2 x86 x86_64" PATCHES="python-$portVersion.patchset" From 56c2929f4756b357b2242c16b45552c6f8a037e9 Mon Sep 17 00:00:00 2001 From: Nav Date: Sun, 11 Jan 2015 15:03:54 +0200 Subject: [PATCH 3/9] Removed the unneeded haiku_devel requirement in BUILD_REQUIRES --- haiku-apps/sawteeth/sawteeth-1.3.recipe | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/haiku-apps/sawteeth/sawteeth-1.3.recipe b/haiku-apps/sawteeth/sawteeth-1.3.recipe index ae9b8494e..6a410535b 100644 --- a/haiku-apps/sawteeth/sawteeth-1.3.recipe +++ b/haiku-apps/sawteeth/sawteeth-1.3.recipe @@ -26,9 +26,7 @@ BUILD_PREREQUIRES=" cmd:cmake cmd:gcc " -BUILD_REQUIRES=" - haiku_devel - " +BUILD_REQUIRES="" BUILD() { From d9e4ca4eeaac83767872d0b694ad3270dadff440 Mon Sep 17 00:00:00 2001 From: Nav Date: Mon, 12 Jan 2015 15:11:55 +0200 Subject: [PATCH 4/9] Updated Box2D recipe and patch --- dev-games/box2d/box2d-2.1.2.recipe | 46 ++++++-- dev-games/box2d/patches/box2d-2.1.2.patch | 121 +++++++++++++++++----- 2 files changed, 129 insertions(+), 38 deletions(-) diff --git a/dev-games/box2d/box2d-2.1.2.recipe b/dev-games/box2d/box2d-2.1.2.recipe index 3740e7c64..8ce79fe03 100644 --- a/dev-games/box2d/box2d-2.1.2.recipe +++ b/dev-games/box2d/box2d-2.1.2.recipe @@ -1,22 +1,46 @@ -DESCRIPTION="Box2d is an open source 2d physics engine for games." +SUMMARY="A 2D Physics Engine for Games" +DESCRIPTION="Box2D is a feature rich 2D rigid body physics engine, written in C++. \ +It has been used in many games, including Crayon Physics Deluxe, \ +winner of the 2008 Independant Game Festival Grand Prize" HOMEPAGE="http://www.box2d.org" SRC_URI="http://box2d.googlecode.com/files/Box2D_v2.1.2.zip" -CHECKSUM_MD5="59d142cd8d4d73e8832c7b67591f590c" -REVISION="1" -STATUS_HAIKU="stable" -DEPEND="" +LICENSE="MIT" +COPYRIGHT="2007-2009 Erin Catto" +CHECKSUM_SHA256="3b351c3e51c6bf78c3e48a2b51260297f3f309fde389c9bfc21ebd484efbba54" +REVISION="2" +ARCHITECTURES="x86_gcc2 ?x86 ?x86_64" +SOURCE_DIR="Box2D_v2.1.2" + +PROVIDES=" + box2d + " + +REQUIRES=" + haiku +" + +PATCHES="box2d-2.1.2.patch" + +BUILD_PREREQUIRES=" + haiku_devel + cmd:make + cmd:cmake + cmd:gcc + devel:libgl + devel:libglu +" + +BUILD_REQUIRES="" + BUILD() { - cd Box2D_v2.1.2/Box2D - cmake . -DOPENGL_INCLUDE_DIR:=/boot/develop/headers/os/opengl/GL \ - -DHAIKU:=TRUE + cd Box2D + cmake . make } INSTALL() { - cd Box2D_v2.1.2/Box2D + cd Box2D make install } -LICENSE="MIT" -COPYRIGHT="2007-2009 Erin Catto" diff --git a/dev-games/box2d/patches/box2d-2.1.2.patch b/dev-games/box2d/patches/box2d-2.1.2.patch index e7bea1e19..8f4a8eb3a 100644 --- a/dev-games/box2d/patches/box2d-2.1.2.patch +++ b/dev-games/box2d/patches/box2d-2.1.2.patch @@ -1,7 +1,8 @@ -diff -urN Box2D_v2.1.2/Box2D/CMakeLists.txt Box2D_v2.1.2-haiku/Box2D/CMakeLists.txt ---- Box2D_v2.1.2/Box2D/CMakeLists.txt 2010-04-03 11:10:30.046661632 +0000 -+++ Box2D_v2.1.2-haiku/Box2D/CMakeLists.txt 2010-09-21 12:18:05.000000000 +0000 -@@ -26,7 +26,9 @@ +diff --git a/Box2D/CMakeLists.txt b/Box2D/CMakeLists.txt +index a8ad550..17b3069 100644 +--- a/Box2D/CMakeLists.txt ++++ b/Box2D/CMakeLists.txt +@@ -26,7 +26,9 @@ if(BOX2D_BUILD_EXAMPLES) # Testbed and dependencies. find_package(OpenGL REQUIRED) @@ -11,10 +12,11 @@ diff -urN Box2D_v2.1.2/Box2D/CMakeLists.txt Box2D_v2.1.2-haiku/Box2D/CMakeLists. add_subdirectory(glui) add_subdirectory(Testbed) endif(BOX2D_BUILD_EXAMPLES) -diff -urN Box2D_v2.1.2/Box2D/Testbed/CMakeLists.txt Box2D_v2.1.2-haiku/Box2D/Testbed/CMakeLists.txt ---- Box2D_v2.1.2/Box2D/Testbed/CMakeLists.txt 2010-04-04 11:07:26.007077888 +0000 -+++ Box2D_v2.1.2-haiku/Box2D/Testbed/CMakeLists.txt 2010-09-21 13:44:55.000000000 +0000 -@@ -72,10 +72,19 @@ +diff --git a/Box2D/Testbed/CMakeLists.txt b/Box2D/Testbed/CMakeLists.txt +index d1be5c0..ad716e4 100644 +--- a/Box2D/Testbed/CMakeLists.txt ++++ b/Box2D/Testbed/CMakeLists.txt +@@ -72,10 +72,19 @@ add_executable(Testbed ${Testbed_Tests_SRCS} ) @@ -24,27 +26,28 @@ diff -urN Box2D_v2.1.2/Box2D/Testbed/CMakeLists.txt Box2D_v2.1.2-haiku/Box2D/Tes - freeglut_static - glui - ${OPENGL_LIBRARIES} -+if(HAIKU) # Haiku has glut, so no need for freeglut +-) ++if(HAIKU) # Haiku has glut, so no need for freeglut + target_link_libraries ( + Testbed + Box2D + glui + ${OPENGL_LIBRARIES} -+) -+else(HAIKU) ++) ++else(HAIKU) + target_link_libraries ( + Testbed + Box2D + freeglut_static + glui + ${OPENGL_LIBRARIES} - ) -+endif(HAIKU) -\ No newline at end of file -diff -urN Box2D_v2.1.2/Box2D/Testbed/Framework/Render.cpp Box2D_v2.1.2-haiku/Box2D/Testbed/Framework/Render.cpp ---- Box2D_v2.1.2/Box2D/Testbed/Framework/Render.cpp 2010-02-01 02:12:46.031719424 +0000 -+++ Box2D_v2.1.2-haiku/Box2D/Testbed/Framework/Render.cpp 2010-09-21 11:29:02.000000000 +0000 -@@ -18,7 +18,11 @@ ++) ++endif(HAIKU) +diff --git a/Box2D/Testbed/Framework/Render.cpp b/Box2D/Testbed/Framework/Render.cpp +index 3a6c680..b406367 100644 +--- a/Box2D/Testbed/Framework/Render.cpp ++++ b/Box2D/Testbed/Framework/Render.cpp +@@ -18,12 +18,16 @@ #include "Render.h" @@ -56,9 +59,16 @@ diff -urN Box2D_v2.1.2/Box2D/Testbed/Framework/Render.cpp Box2D_v2.1.2-haiku/Box #include #include -diff -urN Box2D_v2.1.2/Box2D/Testbed/Framework/Test.cpp Box2D_v2.1.2-haiku/Box2D/Testbed/Framework/Test.cpp ---- Box2D_v2.1.2/Box2D/Testbed/Framework/Test.cpp 2010-02-14 12:15:52.031719424 +0000 -+++ Box2D_v2.1.2-haiku/Box2D/Testbed/Framework/Test.cpp 2010-09-21 11:28:49.000000000 +0000 + +-#include ++#include + + void DebugDraw::DrawPolygon(const b2Vec2* vertices, int32 vertexCount, const b2Color& color) + { +diff --git a/Box2D/Testbed/Framework/Test.cpp b/Box2D/Testbed/Framework/Test.cpp +index 9e6a935..f43ee39 100644 +--- a/Box2D/Testbed/Framework/Test.cpp ++++ b/Box2D/Testbed/Framework/Test.cpp @@ -19,7 +19,11 @@ #include "Test.h" #include "Render.h" @@ -71,9 +81,10 @@ diff -urN Box2D_v2.1.2/Box2D/Testbed/Framework/Test.cpp Box2D_v2.1.2-haiku/Box2D #include -diff -urN Box2D_v2.1.2/Box2D/Testbed/Tests/TestEntries.cpp Box2D_v2.1.2-haiku/Box2D/Testbed/Tests/TestEntries.cpp ---- Box2D_v2.1.2/Box2D/Testbed/Tests/TestEntries.cpp 2010-04-17 11:18:18.035127296 +0000 -+++ Box2D_v2.1.2-haiku/Box2D/Testbed/Tests/TestEntries.cpp 2010-09-21 11:30:22.000000000 +0000 +diff --git a/Box2D/Testbed/Tests/TestEntries.cpp b/Box2D/Testbed/Tests/TestEntries.cpp +index e12c102..1ca1db1 100644 +--- a/Box2D/Testbed/Tests/TestEntries.cpp ++++ b/Box2D/Testbed/Tests/TestEntries.cpp @@ -18,7 +18,11 @@ #include "../Framework/Test.h" @@ -86,9 +97,10 @@ diff -urN Box2D_v2.1.2/Box2D/Testbed/Tests/TestEntries.cpp Box2D_v2.1.2-haiku/Bo #include #include "ApplyForce.h" -diff -urN Box2D_v2.1.2/Box2D/glui/GL/glui.h Box2D_v2.1.2-haiku/Box2D/glui/GL/glui.h ---- Box2D_v2.1.2/Box2D/glui/GL/glui.h 2010-02-01 02:12:42.030408704 +0000 -+++ Box2D_v2.1.2-haiku/Box2D/glui/GL/glui.h 2010-09-21 11:25:12.000000000 +0000 +diff --git a/Box2D/glui/GL/glui.h b/Box2D/glui/GL/glui.h +index a412a77..66a846e 100644 +--- a/Box2D/glui/GL/glui.h ++++ b/Box2D/glui/GL/glui.h @@ -49,6 +49,8 @@ #ifdef __APPLE__ @@ -98,3 +110,58 @@ diff -urN Box2D_v2.1.2/Box2D/glui/GL/glui.h Box2D_v2.1.2-haiku/Box2D/glui/GL/glu #else #include "../../freeglut/GL/glut.h" //#include +diff --git a/Box2D/glui/algebra3.cpp b/Box2D/glui/algebra3.cpp +index ddc18f4..47f93b3 100644 +--- a/Box2D/glui/algebra3.cpp ++++ b/Box2D/glui/algebra3.cpp +@@ -830,11 +830,7 @@ vec4 operator*(float d, const vec4 &a) + + vec4 operator*(const mat4 &a, const vec4 &v) + { +- #define ROWCOL(i) \ +- a.v[i].n[0]*v.n[VX] + \ +- a.v[i].n[1]*v.n[VY] + \ +- a.v[i].n[2]*v.n[VZ] + \ +- a.v[i].n[3]*v.n[VW] ++ #define ROWCOL(i) a.v[i].n[0]*v.n[VX] + a.v[i].n[1]*v.n[VY] + a.v[i].n[2]*v.n[VZ] + a.v[i].n[3]*v.n[VW] + + return vec4(ROWCOL(0), ROWCOL(1), ROWCOL(2), ROWCOL(3)); + +@@ -1107,8 +1103,7 @@ mat3 operator-(const mat3 &a, const mat3 &b) + + mat3 operator*(const mat3 &a, const mat3 &b) + { +- #define ROWCOL(i, j) \ +- a.v[i].n[0]*b.v[0][j] + a.v[i].n[1]*b.v[1][j] + a.v[i].n[2]*b.v[2][j] ++ #define ROWCOL(i, j) a.v[i].n[0]*b.v[0][j] + a.v[i].n[1]*b.v[1][j] + a.v[i].n[2]*b.v[2][j] + + return mat3( + vec3(ROWCOL(0,0), ROWCOL(0,1), ROWCOL(0,2)), +@@ -1413,11 +1408,7 @@ mat4 operator-(const mat4 &a, const mat4 &b) + + mat4 operator*(const mat4 &a, const mat4 &b) + { +- #define ROWCOL(i, j) \ +- a.v[i].n[0]*b.v[0][j] + \ +- a.v[i].n[1]*b.v[1][j] + \ +- a.v[i].n[2]*b.v[2][j] + \ +- a.v[i].n[3]*b.v[3][j] ++ #define ROWCOL(i, j) a.v[i].n[0]*b.v[0][j] + a.v[i].n[1]*b.v[1][j] + a.v[i].n[2]*b.v[2][j] + a.v[i].n[3]*b.v[3][j] + + return mat4( + vec4(ROWCOL(0,0), ROWCOL(0,1), ROWCOL(0,2), ROWCOL(0,3)), +diff --git a/Box2D/glui/glui_internal.h b/Box2D/glui/glui_internal.h +index 20efc6f..8f450e1 100644 +--- a/Box2D/glui/glui_internal.h ++++ b/Box2D/glui/glui_internal.h +@@ -74,8 +74,7 @@ + + /************ check if a 2D point lies within a 2D box ***************/ + #ifndef PT_IN_BOX +-#define PT_IN_BOX( x, y, lo_x, hi_x, lo_y, hi_y ) \ +-( IN_BOUNDS(x,lo_x,hi_x) AND IN_BOUNDS(y,lo_y,hi_y) ) ++#define PT_IN_BOX( x, y, lo_x, hi_x, lo_y, hi_y ) ( IN_BOUNDS(x,lo_x,hi_x) AND IN_BOUNDS(y,lo_y,hi_y) ) + #endif + + /****** check if value lies on proper side of another value *****/ + From da4a3b2dee48d51634b41613182f82e48877cfd1 Mon Sep 17 00:00:00 2001 From: Markus Himmel Date: Mon, 12 Jan 2015 22:26:36 +0000 Subject: [PATCH 5/9] LTris: Save config/themes/highscores to the user settings directory --- games-puzzle/ltris/ltris-1.0.19.recipe | 9 +- games-puzzle/ltris/patches/ltris-1.0.19.patch | 40 ---- .../ltris/patches/ltris-1.0.19.patchset | 187 ++++++++++++++++++ 3 files changed, 194 insertions(+), 42 deletions(-) delete mode 100644 games-puzzle/ltris/patches/ltris-1.0.19.patch create mode 100644 games-puzzle/ltris/patches/ltris-1.0.19.patchset diff --git a/games-puzzle/ltris/ltris-1.0.19.recipe b/games-puzzle/ltris/ltris-1.0.19.recipe index 487bcf18c..6412a2068 100644 --- a/games-puzzle/ltris/ltris-1.0.19.recipe +++ b/games-puzzle/ltris/ltris-1.0.19.recipe @@ -11,8 +11,7 @@ LICENSE="GNU GPL v2" COPYRIGHT="2002-2011 Michael Speck" ARCHITECTURES="x86_gcc2 ?x86 ?x86_64" -PATCHES="ltris-1.0.19.patch" -GLOBAL_WRITABLE_FILES="var/ltris.hscr keep-old" +PATCHES="ltris-1.0.19.patchset" PROVIDES=" ltris = $portVersion @@ -50,5 +49,11 @@ BUILD() INSTALL() { make install + + # Clean up some unnecessary things from the package + rm $localStateDir/ltris.hscr + rm -rf $dataDir/applications + rm -rf $dataDir/icons + addAppDeskbarSymlink $binDir/ltris LTris } diff --git a/games-puzzle/ltris/patches/ltris-1.0.19.patch b/games-puzzle/ltris/patches/ltris-1.0.19.patch deleted file mode 100644 index 3a4a239e7..000000000 --- a/games-puzzle/ltris/patches/ltris-1.0.19.patch +++ /dev/null @@ -1,40 +0,0 @@ ---- /dev/null 2014-09-03 18:56:15.136019000 +0200 -+++ ltris-1.0.19/LTris.rdef 2014-09-03 17:14:27.000000000 +0200 -@@ -0,0 +1,37 @@ -+resource app_signature "application/x-vnd-ltris"; -+ -+resource app_flags B_SINGLE_LAUNCH; -+ -+resource app_version { -+ major = 1, -+ middle = 0, -+ minor = 19, -+ -+ /* 0 = development 1 = alpha 2 = beta -+ 3 = gamma 4 = golden master 5 = final */ -+ variety = 5, -+ -+ internal = 0, -+ -+ short_info = "LTris is a tetris clone.", -+ long_info = "LTris is a tetris clone: differently shaped blocks are falling down the rectangular playing field." -+}; -+ -+resource vector_icon { -+ $"6E6369660A05000200060239BCD5357062B86B6C3CA1364826E049473700C0BE" -+ $"33FF6A6925020006023C15033A71ACB873493A166346BF9949CB5C00FFFC1BFF" -+ $"CDCB16020006023A39972E8567AFC35B3B523345A11E4863C900CECC1BFF9E9D" -+ $"150392901702001602399F0E3686A9B98DF63C8C42488EEB4924C900C2FF5A02" -+ $"0016023C15033A71ACB873493A166347FF994A15AE00FAFFD7020016023C9D60" -+ $"377C1EB78C243CA9674705BF48FA9100DAFFB30578040174060A04223E224A2D" -+ $"4F2D420A042D422D4F334B333F0A04223E2D42333F283B0A1C224A223E233D22" -+ $"3C222F282D2E2F2E2735243F283F2A41294B2D4B394A3B4B3C5740574C51504B" -+ $"4E4B5545593A543A483B473344334B2D4F0A072D513A4F455B5159575A605337" -+ $"420A04463F533E35332E351B0A090104000A0001031001178403040A01010100" -+ $"0A020100000A040102000A05010120382A0A06010020382A0A08010220382A0A" -+ $"0101012020120A0201002020120A0301022020120A010101202C170A02010020" -+ $"2C170A040102202C170A05010120381C0A06010020381C0A08010220381C0A05" -+ $"01012044210A0601002044210A0701022044210A090105000A010101202C090A" -+ $"020100202C090A030102202C090A05010120380E0A06010020380E0A07010220" -+ $"380E" -+}; diff --git a/games-puzzle/ltris/patches/ltris-1.0.19.patchset b/games-puzzle/ltris/patches/ltris-1.0.19.patchset new file mode 100644 index 000000000..7a5d753f0 --- /dev/null +++ b/games-puzzle/ltris/patches/ltris-1.0.19.patchset @@ -0,0 +1,187 @@ +From 3afd9f9500c8cc0a9cc7d8f09128e4c44b5c2538 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Mon, 12 Jan 2015 20:53:30 +0000 +Subject: [PATCH 1/2] Original resource definition file + +--- + LTris.rdef | 37 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + create mode 100644 LTris.rdef + +diff --git a/LTris.rdef b/LTris.rdef +new file mode 100644 +index 0000000..b1cea42 +--- /dev/null ++++ b/LTris.rdef +@@ -0,0 +1,37 @@ ++resource app_signature "application/x-vnd.lgames.ltris"; ++ ++resource app_flags B_SINGLE_LAUNCH; ++ ++resource app_version { ++ major = 1, ++ middle = 0, ++ minor = 19, ++ ++ /* 0 = development 1 = alpha 2 = beta ++ 3 = gamma 4 = golden master 5 = final */ ++ variety = 5, ++ ++ internal = 0, ++ ++ short_info = "LTris is a tetris clone.", ++ long_info = "LTris is a tetris clone: differently shaped blocks are falling down the rectangular playing field." ++}; ++ ++resource vector_icon { ++ $"6E6369660A05000200060239BCD5357062B86B6C3CA1364826E049473700C0BE" ++ $"33FF6A6925020006023C15033A71ACB873493A166346BF9949CB5C00FFFC1BFF" ++ $"CDCB16020006023A39972E8567AFC35B3B523345A11E4863C900CECC1BFF9E9D" ++ $"150392901702001602399F0E3686A9B98DF63C8C42488EEB4924C900C2FF5A02" ++ $"0016023C15033A71ACB873493A166347FF994A15AE00FAFFD7020016023C9D60" ++ $"377C1EB78C243CA9674705BF48FA9100DAFFB30578040174060A04223E224A2D" ++ $"4F2D420A042D422D4F334B333F0A04223E2D42333F283B0A1C224A223E233D22" ++ $"3C222F282D2E2F2E2735243F283F2A41294B2D4B394A3B4B3C5740574C51504B" ++ $"4E4B5545593A543A483B473344334B2D4F0A072D513A4F455B5159575A605337" ++ $"420A04463F533E35332E351B0A090104000A0001031001178403040A01010100" ++ $"0A020100000A040102000A05010120382A0A06010020382A0A08010220382A0A" ++ $"0101012020120A0201002020120A0301022020120A010101202C170A02010020" ++ $"2C170A040102202C170A05010120381C0A06010020381C0A08010220381C0A05" ++ $"01012044210A0601002044210A0701022044210A090105000A010101202C090A" ++ $"020100202C090A030102202C090A05010120380E0A06010020380E0A07010220" ++ $"380E" ++}; +-- +1.8.3.4 + + +From c735a348244339d0e12c90a027e20cce1de18370 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Mon, 12 Jan 2015 22:16:46 +0000 +Subject: [PATCH 2/2] Move settings and highscores to B_USER_SETTINGS_DIRECTORY + +--- + src/chart.c | 4 ++++ + src/config.c | 18 +++++++++++++++++- + src/config.h | 4 ++++ + src/manager.c | 20 ++++++++++++++++++++ + 4 files changed, 45 insertions(+), 1 deletion(-) + +diff --git a/src/chart.c b/src/chart.c +index 87d8e03..8cee31d 100644 +--- a/src/chart.c ++++ b/src/chart.c +@@ -189,15 +189,19 @@ void chart_load() + if ( charts ) list_delete( charts ); charts = 0; + charts = list_create( LIST_AUTO_DELETE, chart_set_delete ); + /* load highscore */ ++#ifndef __HAIKU__ + if ( !chart_load_from_path( HI_DIR ) ) { + fprintf( stderr, "Unable to access highscore chart in '%s'.\n", HI_DIR ); + fprintf( stderr, "Trying to use config directory '%s'.\n", config.dir_name ); ++#endif + if ( !chart_load_from_path( config.dir_name ) ) { + fprintf( stderr, "Unable to access highscore chart in config directory... won't be " + "able to save any results. Sorry.\n" ); + return; + } ++#ifndef __HAIKU__ + } ++#endif + printf( "Saving highscore chart in: %s\n", chart_path ); + /* load resources */ + cfont = load_fixed_font( "f_small_yellow.bmp", 32, 96, 8 ); +diff --git a/src/config.c b/src/config.c +index 00f7e9c..c4d6ea0 100644 +--- a/src/config.c ++++ b/src/config.c +@@ -23,6 +23,11 @@ + #include + #include + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "sdl.h" + #include "config.h" + #include "parser.h" +@@ -40,7 +45,18 @@ void config_check_dir() + { + #ifdef DISABLE_INSTALL + sprintf( config.dir_name, "." ); +-#else ++#elif __HAIKU__ ++ dev_t volume = dev_for_path("/boot"); ++ if ( find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, ++ config.dir_name, sizeof(config.dir_name)-1 ) == B_OK && ++ strlen(config.dir_name) + strlen(CONFIG_DIR_NAME) ++ < sizeof(config.dir_name)-1 ) { ++ strcat(config.dir_name, "/"); ++ strcat(config.dir_name, CONFIG_DIR_NAME); ++ } else ++ snprintf( config.dir_name, sizeof(config.dir_name)-1, "%s/%s", getenv( "HOME" ), CONFIG_DIR_NAME ); ++ fprintf( stderr, "HAIKU: Config directory is '%s'\n", config.dir_name ); ++#else + snprintf( config.dir_name, sizeof(config.dir_name)-1, "%s/%s", getenv( "HOME" ), CONFIG_DIR_NAME ); + #endif + if ( opendir( config.dir_name ) == 0 ) { +diff --git a/src/config.h b/src/config.h +index ee52a64..491ed64 100644 +--- a/src/config.h ++++ b/src/config.h +@@ -99,7 +99,11 @@ typedef struct { + } Config; + + /* config directory name in home directory */ ++#ifdef __HAIKU__ ++#define CONFIG_DIR_NAME "LGames" ++#else + #define CONFIG_DIR_NAME ".lgames" ++#endif + + /* set config to default */ + void config_reset(); +diff --git a/src/manager.c b/src/manager.c +index b8cc411..de07f73 100644 +--- a/src/manager.c ++++ b/src/manager.c +@@ -19,6 +19,11 @@ + #include "../config.h" + #endif + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "ltris.h" + #include "manager.h" + #include "chart.h" +@@ -143,7 +148,22 @@ void cb_delete_set() + return; + } + /* get file name + path */ ++#ifdef __HAIKU__ ++ dev_t volume = dev_for_path("/boot"); ++ if ( find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, ++ fname, sizeof(config.dir_name)-1 ) == B_OK && ++ strlen(fname) + strlen(CONFIG_DIR_NAME) ++ + strlen(levelset_home_names[config.levelset_home_id]) ++ < sizeof(fname)-9 ) { ++ strcat(fname, "/"); ++ strcat(fname, CONFIG_DIR_NAME); ++ strcat(fname, "/levels/"); ++ strcat(fname, levelset_home_names[config.levelset_home_id]); ++ } else ++ snprintf( fname, sizeof(fname)-1, "%s/%s/levels/%s", getenv( "HOME" ), CONFIG_DIR_NAME, levelset_home_names[config.levelset_home_id] ); ++#else + snprintf( fname, sizeof(fname)-1, "%s/%s/levels/%s", getenv( "HOME" ), CONFIG_DIR_NAME, levelset_home_names[config.levelset_home_id] ); ++#endif + remove( fname ); + levelsets_load_names(); /* reinit name lists and configs indices */ + /* reassign these name lists as position in memory has changed */ +-- +1.8.3.4 + From 8a09a9e0b54561de89e8568e939c5148767951e2 Mon Sep 17 00:00:00 2001 From: Markus Himmel Date: Wed, 14 Jan 2015 18:17:06 +0000 Subject: [PATCH 6/9] LBreakout2: Move config, high scores, saved games and custom levels to the user settings directory. --- .../lbreakout2/lbreakout2-2.6.4.recipe | 8 +- .../lbreakout2/patches/lbreakout2-2.6.4.patch | 107 ---- .../patches/lbreakout2-2.6.4.patchset | 601 ++++++++++++++++++ 3 files changed, 607 insertions(+), 109 deletions(-) delete mode 100644 games-puzzle/lbreakout2/patches/lbreakout2-2.6.4.patch create mode 100644 games-puzzle/lbreakout2/patches/lbreakout2-2.6.4.patchset diff --git a/games-puzzle/lbreakout2/lbreakout2-2.6.4.recipe b/games-puzzle/lbreakout2/lbreakout2-2.6.4.recipe index 513d176bd..53ba0257f 100644 --- a/games-puzzle/lbreakout2/lbreakout2-2.6.4.recipe +++ b/games-puzzle/lbreakout2/lbreakout2-2.6.4.recipe @@ -13,8 +13,7 @@ LICENSE="GNU GPL v2" COPYRIGHT="2001-2011 Michael Speck" ARCHITECTURES="x86_gcc2 ?x86 ?x86_64" -PATCHES="lbreakout2-2.6.4.patch" -GLOBAL_WRITABLE_FILES="var/lbreakout2.hscr keep-old" +PATCHES="lbreakout2-2.6.4.patchset" PROVIDES=" lbreakout2 = $portVersion @@ -59,5 +58,10 @@ BUILD() INSTALL() { make install + + rm $localStateDir/lbreakout2.hscr + rm -rf $dataDir/applications + rm -rf $dataDir/icons + addAppDeskbarSymlink $binDir/lbreakout2 LBreakout2 } diff --git a/games-puzzle/lbreakout2/patches/lbreakout2-2.6.4.patch b/games-puzzle/lbreakout2/patches/lbreakout2-2.6.4.patch deleted file mode 100644 index 796ec586a..000000000 --- a/games-puzzle/lbreakout2/patches/lbreakout2-2.6.4.patch +++ /dev/null @@ -1,107 +0,0 @@ ---- lbreakout2-2.6.4/configure.orig 2012-06-19 21:49:30.000000000 +0200 -+++ lbreakout2-2.6.4/configure 2014-07-13 22:23:51.202375168 +0200 -@@ -11392,7 +11392,7 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lm $LIBS" -+LIBS=" $LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF -@@ -11446,7 +11446,7 @@ - #define HAVE_LIBM 1 - _ACEOF - -- LIBS="-lm $LIBS" -+ LIBS=" $LIBS" - - else - { { echo "$as_me:$LINENO: error: lib math is needed" >&5 - ---- lbreakout2-2.6.4/client/chart.c.org 2014-08-23 14:15:06.036700160 +0200 -+++ lbreakout2-2.6.4/client/chart.c 2014-08-23 14:11:54.634650624 +0200 -@@ -213,6 +213,7 @@ - } - printf( _("Saving highscore chart in: %s\n"), chart_path ); - /* compute size and position stuff of highscore */ -+ { - char *cheader = _("Name Level Score"); - chart_pos.w = stk_font_string_width( ccfont, cheader ); - chart_pos.h = ccfont->height + chart_gap + /* title + gap */ -@@ -220,6 +221,7 @@ - chart_gap + /*gap between caption and entries */ - ccfont->height; /* caption size */ - chart_level_offset = stk_font_string_width( ccfont, _("name.-----") ) + stk_font_string_width( ccfont, _("Level") ) / 2; /* level offset centered */ -+ } - } - /* - ==================================================================== -@@ -344,6 +346,7 @@ - chart->name ); - /* caption */ - ccfont->align = STK_FONT_ALIGN_LEFT | STK_FONT_ALIGN_TOP; -+ { - char *cheader = _("Name Level Score"); - stk_font_write( ccfont, stk_display, - chart_pos.x, chart_pos.y + ccfont->height + chart_gap, -1, -@@ -370,6 +373,7 @@ - chart_pos.x + chart_pos.w, entry_offset, -1, number_buffer ); - /* change offset */ - entry_offset += font->height; -+ } - } - stk_display_store_rect( &chart_pos ); - } -@@ -389,6 +393,7 @@ - - /* caption */ - ccfont->align = STK_FONT_ALIGN_LEFT | STK_FONT_ALIGN_TOP; -+ { - char *cheader = _("Name Level Score"); - stk_font_write( ccfont, stk_display, px, py, -1, cheader ); - -@@ -416,6 +421,7 @@ - /* change offset */ - entry_offset += font->height - 1; - } -+ } - { SDL_Rect region = { x, y, w, h }; - stk_display_store_rect( ®ion ); } - } ---- /dev/null 2014-09-02 10:55:51.858924000 +0200 -+++ lbreakout2-2.6.4/LBreakout2.rdef 2014-09-02 09:38:25.879230976 +0200 -@@ -0,0 +1,33 @@ -+resource app_signature "application/x-vnd-lbreakout"; -+ -+resource app_flags B_SINGLE_LAUNCH; -+ -+resource app_version { -+ major = 2, -+ middle = 6, -+ minor = 4, -+ -+ /* 0 = development 1 = alpha 2 = beta -+ 3 = gamma 4 = golden master 5 = final */ -+ variety = 5, -+ -+ internal = 0, -+ -+ short_info = "LBreakout2 arcade game.", -+ long_info = "LBreakout2 is a fun breakout-style arcade game." -+}; -+ -+resource vector_icon { -+ $"6E63696605020106023D5738B7D6E13769AC3CF83249ADC94642AAFFA5040400" -+ $"FF9E9E02000205B6B6DB3925EEBD5FCABAE8BF4A54944AC9EB00846C1BFF34B6" -+ $"9627FF77DBCD5CF983C9C088FFFE6A5716FF020106023B7084B697593638963A" -+ $"F2BB4202AB49ECC600AAD2A5F440503F050001010000850502044C24C62E24C2" -+ $"E124442C44B62144B96E4C34C2E134C62E34542C54B96E54B6210604AF303937" -+ $"3C2B3A2948243E2D4A48584E450204B6C93AB8A73AB4EA3AB365C0BFB365BEE0" -+ $"B365C29DB6C94BB4EA4BB8A74B32C0BF32C29D32BEE006033E402E5037423A50" -+ $"374438493B3F330606BE0F3039233D27352242294822452948445654574E5C5B" -+ $"504E4555474642090A0401042028220A0301041001178500040A020102024000" -+ $"000000000000003FC3C3400000BDC3C30A010101000A02010202404DAB000000" -+ $"000000404DAB4A26D645D13D0A000100000A0301001001178100040A03010300" -+ $"0A030103023EC27B0000000000003EC27B46388E46B10D" -+}; diff --git a/games-puzzle/lbreakout2/patches/lbreakout2-2.6.4.patchset b/games-puzzle/lbreakout2/patches/lbreakout2-2.6.4.patchset new file mode 100644 index 000000000..02dd8bc98 --- /dev/null +++ b/games-puzzle/lbreakout2/patches/lbreakout2-2.6.4.patchset @@ -0,0 +1,601 @@ +From 4bb650564a24ec9d6915684c3370caa293bdd002 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Mon, 12 Jan 2015 18:11:27 +0000 +Subject: [PATCH 1/3] applying patch lbreakout2-2.6.4.patch + +--- + LBreakout2.rdef | 33 +++++++++++++++++++++++++++++++++ + client/chart.c | 6 ++++++ + configure | 4 ++-- + 3 files changed, 41 insertions(+), 2 deletions(-) + create mode 100644 LBreakout2.rdef + +diff --git a/LBreakout2.rdef b/LBreakout2.rdef +new file mode 100644 +index 0000000..6b165ae +--- /dev/null ++++ b/LBreakout2.rdef +@@ -0,0 +1,33 @@ ++resource app_signature "application/x-vnd-lbreakout"; ++ ++resource app_flags B_SINGLE_LAUNCH; ++ ++resource app_version { ++ major = 2, ++ middle = 6, ++ minor = 4, ++ ++ /* 0 = development 1 = alpha 2 = beta ++ 3 = gamma 4 = golden master 5 = final */ ++ variety = 5, ++ ++ internal = 0, ++ ++ short_info = "LBreakout2 arcade game.", ++ long_info = "LBreakout2 is a fun breakout-style arcade game." ++}; ++ ++resource vector_icon { ++ $"6E63696605020106023D5738B7D6E13769AC3CF83249ADC94642AAFFA5040400" ++ $"FF9E9E02000205B6B6DB3925EEBD5FCABAE8BF4A54944AC9EB00846C1BFF34B6" ++ $"9627FF77DBCD5CF983C9C088FFFE6A5716FF020106023B7084B697593638963A" ++ $"F2BB4202AB49ECC600AAD2A5F440503F050001010000850502044C24C62E24C2" ++ $"E124442C44B62144B96E4C34C2E134C62E34542C54B96E54B6210604AF303937" ++ $"3C2B3A2948243E2D4A48584E450204B6C93AB8A73AB4EA3AB365C0BFB365BEE0" ++ $"B365C29DB6C94BB4EA4BB8A74B32C0BF32C29D32BEE006033E402E5037423A50" ++ $"374438493B3F330606BE0F3039233D27352242294822452948445654574E5C5B" ++ $"504E4555474642090A0401042028220A0301041001178500040A020102024000" ++ $"000000000000003FC3C3400000BDC3C30A010101000A02010202404DAB000000" ++ $"000000404DAB4A26D645D13D0A000100000A0301001001178100040A03010300" ++ $"0A030103023EC27B0000000000003EC27B46388E46B10D" ++}; +diff --git a/client/chart.c b/client/chart.c +index 68e9f44..8fbd8c6 100644 +--- a/client/chart.c ++++ b/client/chart.c +@@ -213,6 +213,7 @@ void chart_load() + } + printf( _("Saving highscore chart in: %s\n"), chart_path ); + /* compute size and position stuff of highscore */ ++ { + char *cheader = _("Name Level Score"); + chart_pos.w = stk_font_string_width( ccfont, cheader ); + chart_pos.h = ccfont->height + chart_gap + /* title + gap */ +@@ -220,6 +221,7 @@ void chart_load() + chart_gap + /*gap between caption and entries */ + ccfont->height; /* caption size */ + chart_level_offset = stk_font_string_width( ccfont, _("name.-----") ) + stk_font_string_width( ccfont, _("Level") ) / 2; /* level offset centered */ ++ } + } + /* + ==================================================================== +@@ -344,6 +346,7 @@ void chart_show( Set_Chart *chart, int x, int y, int w, int h ) + chart->name ); + /* caption */ + ccfont->align = STK_FONT_ALIGN_LEFT | STK_FONT_ALIGN_TOP; ++ { + char *cheader = _("Name Level Score"); + stk_font_write( ccfont, stk_display, + chart_pos.x, chart_pos.y + ccfont->height + chart_gap, -1, +@@ -370,6 +373,7 @@ void chart_show( Set_Chart *chart, int x, int y, int w, int h ) + chart_pos.x + chart_pos.w, entry_offset, -1, number_buffer ); + /* change offset */ + entry_offset += font->height; ++ } + } + stk_display_store_rect( &chart_pos ); + } +@@ -389,6 +393,7 @@ void chart_show_compact( Set_Chart *chart, int x, int y, int w, int h ) + + /* caption */ + ccfont->align = STK_FONT_ALIGN_LEFT | STK_FONT_ALIGN_TOP; ++ { + char *cheader = _("Name Level Score"); + stk_font_write( ccfont, stk_display, px, py, -1, cheader ); + +@@ -416,6 +421,7 @@ void chart_show_compact( Set_Chart *chart, int x, int y, int w, int h ) + /* change offset */ + entry_offset += font->height - 1; + } ++ } + { SDL_Rect region = { x, y, w, h }; + stk_display_store_rect( ®ion ); } + } +diff --git a/configure b/configure +index e3da323..eb8b692 100755 +--- a/configure ++++ b/configure +@@ -11392,7 +11392,7 @@ if test "${ac_cv_lib_m_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lm $LIBS" ++LIBS=" $LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -11446,7 +11446,7 @@ if test $ac_cv_lib_m_main = yes; then + #define HAVE_LIBM 1 + _ACEOF + +- LIBS="-lm $LIBS" ++ LIBS=" $LIBS" + + else + { { echo "$as_me:$LINENO: error: lib math is needed" >&5 +-- +1.8.3.4 + + +From 9c323258dc4be15ba6299abb40af19b76dbe80b8 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Tue, 13 Jan 2015 16:19:54 +0000 +Subject: [PATCH 2/3] Relocate save files, high scores and config + +--- + client/chart.c | 4 ++++ + client/config.c | 17 +++++++++++++++++ + client/editor.c | 20 ++++++++++++++++++++ + client/lbreakout.h | 2 ++ + client/main.c | 17 +++++++++++++++++ + client/manager.c | 31 +++++++++++++++++++++++++++++++ + client/slot.c | 36 ++++++++++++++++++++++++++++++++++-- + client/theme.c | 38 ++++++++++++++++++++++++++++++++++++-- + game/levels.c | 42 ++++++++++++++++++++++++++++++++++++++++-- + 9 files changed, 201 insertions(+), 6 deletions(-) + +diff --git a/client/chart.c b/client/chart.c +index 8fbd8c6..6dfe30e 100644 +--- a/client/chart.c ++++ b/client/chart.c +@@ -202,15 +202,19 @@ void chart_load() + if ( charts ) list_delete( charts ); charts = 0; + charts = list_create( LIST_AUTO_DELETE, chart_set_delete ); + /* load highscore */ ++#ifndef __HAIKU__ + if ( !chart_load_from_path( HI_DIR ) ) { + fprintf( stderr, _("Unable to access highscore chart in '%s'.\n"), HI_DIR ); + fprintf( stderr, _("Trying to use config directory '%s'.\n"), config.dir_name ); ++#endif + if ( !chart_load_from_path( config.dir_name ) ) { + fprintf( stderr, _("Unable to access highscore chart in config directory... won't be " + "able to save any results. Sorry.\n") ); + return; + } ++#ifndef __HAIKU__ + } ++#endif + printf( _("Saving highscore chart in: %s\n"), chart_path ); + /* compute size and position stuff of highscore */ + { +diff --git a/client/config.c b/client/config.c +index 83a924c..7b2ed81 100644 +--- a/client/config.c ++++ b/client/config.c +@@ -21,6 +21,11 @@ + #include + #include + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "config.h" + #include "../common/parser.h" + +@@ -38,7 +43,19 @@ Config config; + void config_check_dir() + { + char level_dir[512]; ++#ifdef __HAIKU__ ++ dev_t volume = dev_for_path("/boot"); ++ if ( find_directory( B_USER_SETTINGS_DIRECTORY, volume, false, ++ config.dir_name, sizeof(config.dir_name)-1 ) == B_OK && ++ strlen(config.dir_name) + strlen(CONFIG_DIR_NAME) ++ < sizeof(config.dir_name)-1 ) { ++ strcat(config.dir_name, "/"); ++ strcat(config.dir_name, CONFIG_DIR_NAME); ++ } else ++ snprintf( config.dir_name, sizeof(config.dir_name)-1, "%s/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); ++#else + snprintf( config.dir_name, sizeof(config.dir_name)-1, "%s/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); ++#endif + /* test and create .lgames */ + if ( opendir( config.dir_name ) == 0 ) { + fprintf( stderr, "couldn't find/open config directory '%s'\n", config.dir_name ); +diff --git a/client/editor.c b/client/editor.c +index e182081..81a4b7c 100644 +--- a/client/editor.c ++++ b/client/editor.c +@@ -15,6 +15,11 @@ + * * + ***************************************************************************/ + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "lbreakout.h" + #include "../game/game.h" + #include "game.h" +@@ -722,7 +727,22 @@ int editor_init( char *file_name ) + { + FILE *file = 0; + /* set full file name */ ++#ifdef __HAIKU__ ++ dev_t volume = dev_for_path("/boot"); ++ if ( find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, ++ edit_file_name, sizeof(edit_file_name)-1 ) == B_OK && ++ strlen(edit_file_name) + strlen(CONFIG_DIR_NAME) + strlen(file_name) ++ < sizeof(edit_file_name) - 18 ) { ++ strcat(edit_file_name, "/"); ++ strcat(edit_file_name, CONFIG_DIR_NAME); ++ strcat(edit_file_name, "/lbreakout2-levels/"); ++ strcat(edit_file_name, file_name); ++ } else ++ snprintf( edit_file_name, sizeof(edit_file_name)-1, "%s/%s/lbreakout2-levels/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, file_name ); ++ fprintf( stderr, "HAIKU: Saving at %s\n", edit_file_name); ++#else + snprintf( edit_file_name, sizeof(edit_file_name)-1, "%s/%s/lbreakout2-levels/%s", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, file_name ); ++#endif + /* test this file for write access. use append to keep contents */ + if ( ( file = fopen( edit_file_name, "a" ) ) == 0 ) { + fprintf( stderr, "Permission to write to file '%s' denied.\n", edit_file_name ); +diff --git a/client/lbreakout.h b/client/lbreakout.h +index 4b0090c..8ab9cd6 100644 +--- a/client/lbreakout.h ++++ b/client/lbreakout.h +@@ -48,6 +48,8 @@ Global definitions for LBreakout and general system includes. + /* config directory name in home directory */ + #ifdef _WIN32 + #define CONFIG_DIR_NAME "lgames" ++#elif __HAIKU__ ++#define CONFIG_DIR_NAME "LGames" + #else + #define CONFIG_DIR_NAME ".lgames" + #endif +diff --git a/client/main.c b/client/main.c +index 81e7f57..7f29cfc 100644 +--- a/client/main.c ++++ b/client/main.c +@@ -23,6 +23,11 @@ + #include + #endif + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "lbreakout.h" + #include "../game/game.h" + #include "file.h" +@@ -198,7 +203,19 @@ int main(int argc, char *argv[]) + /* new set? */ + if ( strequal( NEW_SET, edit_set ) ) { + editor_file = calloc( 16, sizeof( char ) ); ++#ifdef __HAIKU__ ++ if ( find_directory(B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ path, sizeof(path)-1 ) == B_OK && ++ strlen(path) + strlen(CONFIG_DIR_NAME) ++ < sizeof(path) - 18 ) { ++ strcat(path, "/"); ++ strcat(path, CONFIG_DIR_NAME); ++ strcat(path, "/lbreakout2-levels"); ++ } else ++ snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels", getenv( "HOME" )? getenv("HOME"):".", CONFIG_DIR_NAME ); ++#else + snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels", getenv( "HOME" )? getenv("HOME"):".", CONFIG_DIR_NAME ); ++#endif + if ( !enter_string( font, _("Set Name:"), editor_file, 12 ) || !file_check( path, editor_file, "w" ) ) { + free( editor_file ); + break; +diff --git a/client/manager.c b/client/manager.c +index 5c94c38..9cbbcdd 100644 +--- a/client/manager.c ++++ b/client/manager.c +@@ -15,6 +15,11 @@ + * * + ***************************************************************************/ + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "manager.h" + #include "../game/game.h" + #include "file.h" +@@ -278,7 +283,19 @@ void levelsets_load_names() + delete_text( text ); + } + /* parse home directory */ ++#ifdef __HAIKU__ ++ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ level_dir, sizeof(level_dir)-1 ) == B_OK && ++ strlen(level_dir) + strlen(CONFIG_DIR_NAME) ++ < sizeof(level_dir)-19 ) { ++ strcat(level_dir, "/"); ++ strcat(level_dir, CONFIG_DIR_NAME); ++ strcat(level_dir, "/lbreakout2-levels"); ++ } else ++ snprintf( level_dir, sizeof(level_dir)-1, "%s/%s/lbreakout2-levels", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); ++#else + snprintf( level_dir, sizeof(level_dir)-1, "%s/%s/lbreakout2-levels", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); ++#endif + if ( ( text = get_file_list( level_dir, 0, level_dir ) ) ) { + for ( i = 0; i < text->count; i++ ) { + /* filter stuff */ +@@ -353,7 +370,21 @@ void cb_delete_set() + return; + } + /* get file name + path */ ++#ifdef __HAIKU__ ++ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ fname, sizeof(fname)-1 ) == B_OK && ++ strlen(fname) + strlen(CONFIG_DIR_NAME) ++ + strlen(levelset_names_home[config.levelset_id_home]) ++ < sizeof(fname)-19 ) { ++ strcat(fname, "/"); ++ strcat(fname, CONFIG_DIR_NAME); ++ strcat(fname, "/lbreakout2-levels/"); ++ strcat(fname, levelset_names_home[config.levelset_id_home]); ++ } else ++ snprintf( fname, sizeof(fname)-1,"%s/%s/lbreakout2-levels/%s", getenv( "HOME" ), CONFIG_DIR_NAME, levelset_names_home[config.levelset_id_home] ); ++#else + snprintf( fname, sizeof(fname)-1,"%s/%s/lbreakout2-levels/%s", getenv( "HOME" ), CONFIG_DIR_NAME, levelset_names_home[config.levelset_id_home] ); ++#endif + remove( fname ); + levelsets_load_names(); /* reinit name lists and configs indices */ + /* reassign these name lists as position in memory has changed */ +diff --git a/client/slot.c b/client/slot.c +index 238d4c8..a32805a 100644 +--- a/client/slot.c ++++ b/client/slot.c +@@ -15,15 +15,34 @@ + * * + ***************************************************************************/ + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "lbreakout.h" + #include "slot.h" + + static FILE *open_slot( int id, char *mode ) + { + char fname[512]; +- snprintf( fname, 511, "%s/%s/lbr2_save_%d", +- (getenv( "HOME" )?getenv( "HOME" ):"."), ++#ifdef __HAIKU__ ++ dev_t volume = dev_for_path("/boot"); ++ if ( find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, ++ fname, sizeof(fname)-1 ) == B_OK && strlen(fname) + ++ strlen(CONFIG_DIR_NAME) < sizeof(fname) - 16 ) { ++ off_t len = strlen(fname); ++ snprintf( fname+len, 511-len, "/%s/lbr2_save_%d", CONFIG_DIR_NAME, id); ++ } else ++ snprintf( fname, 511, "%s/%s/lbr2_save_%d", ++ (getenv( "HOME" )?getenv( "HOME" ):"."), + CONFIG_DIR_NAME, id ); ++ fprintf( stderr, "HAIKU: Accessing savefile at %s\n", fname ); ++#else ++ snprintf( fname, 511, "%s/%s/lbr2_save_%d", ++ (getenv( "HOME" )?getenv( "HOME" ):"."), ++ CONFIG_DIR_NAME, id ); ++#endif + //printf( "accessing '%s' in mode '%s'\n", fname, mode ); + return fopen( fname, mode ); + } +@@ -62,9 +81,22 @@ int slot_save( int slot_id, GameSlot *gs ) + int slot_delete( int slot_id ) + { + char fname[512]; ++#ifdef __HAIKU__ ++ dev_t volume = dev_for_path("/boot"); ++ if ( find_directory(B_USER_SETTINGS_DIRECTORY, volume, false, ++ fname, sizeof(fname)-1 ) == B_OK && strlen(fname) + ++ strlen(CONFIG_DIR_NAME) < sizeof(fname) - 16 ) { ++ off_t len = strlen(fname); ++ snprintf( fname+len, 511-len, "/%s/lbr2_save_%d", CONFIG_DIR_NAME, slot_id); ++ } else ++ snprintf( fname, 511, "%s/%s/lbr2_save_%d", ++ (getenv( "HOME" )?getenv( "HOME" ):"."), ++ CONFIG_DIR_NAME, slot_id ); ++#else + snprintf( fname, 511, "%s/%s/lbr2_save_%d", + (getenv( "HOME" )?getenv( "HOME" ):"."), + CONFIG_DIR_NAME, slot_id ); ++#endif + if ( remove(fname) != 0 ) + { + fprintf( stderr, "ERROR: couldn't delete file %s\n", fname ); +diff --git a/client/theme.c b/client/theme.c +index ad6de96..a0e1b8e 100644 +--- a/client/theme.c ++++ b/client/theme.c +@@ -15,6 +15,11 @@ + * * + ***************************************************************************/ + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include + #include + #include +@@ -133,10 +138,25 @@ static char theme_dir[512]; + static char theme_path[512]; + void theme_set_dir( char *name ) + { +- if ( name[0] == '~' ) ++ if ( name[0] == '~' ) { ++#ifdef __HAIKU__ ++ dev_t volume = dev_for_path("/boot"); ++ if ( find_directory( B_USER_SETTINGS_DIRECTORY, volume, false, ++ theme_dir, sizeof(theme_dir)-1 ) == B_OK && ++ strlen(theme_dir) + strlen(CONFIG_DIR_NAME) + strlen(name) ++ < sizeof(theme_dir)-19 ) { ++ strcat(theme_dir, "/"); ++ strcat(theme_dir, CONFIG_DIR_NAME); ++ strcat(theme_dir, "/lbreakout2-themes/"); ++ strcat(theme_dir, name + (off_t)1); ++ } else ++ snprintf( theme_dir, sizeof(theme_dir)-1, "%s/%s/lbreakout2-themes/%s", ++ (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, name + 1 ); ++#else + snprintf( theme_dir, sizeof(theme_dir)-1, "%s/%s/lbreakout2-themes/%s", + (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME, name + 1 ); +- else { ++#endif ++ } else { + if ( STRCMP( SRC_DIR, "." ) ) { + getcwd( theme_dir, 511 ); + strcat( theme_dir, "/gfx/" ); +@@ -327,6 +347,20 @@ void theme_get_list() + closedir( hdir ); + } + /* home theme directory */ ++#ifdef __HAIKU__ ++ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ dir, sizeof(dir)-1 ) == B_OK && ++ strlen(dir) + strlen(CONFIG_DIR_NAME) ++ < sizeof(dir)-19 ) { ++ strcat(dir, "/"); ++ strcat(dir, CONFIG_DIR_NAME); ++ strcat(dir, "/lbreakout2-themes"); ++ } else ++ snprintf( dir, sizeof(dir)-1, "%s/%s/lbreakout2-themes", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); ++#else ++ snprintf( dir, sizeof(dir)-1, "%s/%s/lbreakout2-themes", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); ++#endif ++ + snprintf( dir, sizeof(dir)-1, "%s/%s/lbreakout2-themes", (getenv( "HOME" )?getenv( "HOME" ):"."), CONFIG_DIR_NAME ); + if ( ( hdir = opendir( dir ) ) != 0 ) { + while ( ( entry = readdir( hdir ) ) ) { +diff --git a/game/levels.c b/game/levels.c +index a93a633..0d728ac 100644 +--- a/game/levels.c ++++ b/game/levels.c +@@ -15,6 +15,11 @@ + * * + ***************************************************************************/ + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include "levels.h" + + /* +@@ -66,9 +71,26 @@ FILE *levelset_open( const char *fname, char *mode ) + FILE *file; + char path[512]; + if ( fname[0] == '~' ) { +- snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s", +- (getenv( "HOME" )?getenv( "HOME" ):"."), ++#ifdef __HAIKU__ ++ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ path, sizeof(path)-1 ) == B_OK && ++ strlen(path) + strlen(CONFIG_DIR_NAME) ++ + strlen(fname) ++ < sizeof(path)-19 ) { ++ strcat(path, "/"); ++ strcat(path, CONFIG_DIR_NAME); ++ strcat(path, "/lbreakout2-levels/"); ++ strcat(path, fname + 1); ++ } else ++ snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s", ++ (getenv( "HOME" )?getenv( "HOME" ):"."), ++ CONFIG_DIR_NAME, fname + 1 ); ++ fprintf ( stderr, "HAIKU: opening %s\n", path ); ++#else ++ snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s", ++ (getenv( "HOME" )?getenv( "HOME" ):"."), + CONFIG_DIR_NAME, fname + 1 ); ++#endif + } + else + if ( fname[0] != '/' ) /* keep global pathes */ +@@ -276,9 +298,25 @@ int levelset_save( LevelSet *set, char *fname ) + + if ( set == 0 || set->count == 0 ) return 0; + ++#ifdef __HAIKU__ ++ if ( find_directory( B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ path, sizeof(path)-1 ) == B_OK && ++ strlen(path) + strlen(CONFIG_DIR_NAME) ++ + strlen(fname) ++ < sizeof(path)-19 ) { ++ strcat(path, "/"); ++ strcat(path, CONFIG_DIR_NAME); ++ strcat(path, "/lbreakout2-levels/"); ++ strcat(path, (fname[0]=='~') ? fname + 1 : fname); ++ } else ++ snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s", ++ (getenv( "HOME" )?getenv( "HOME" ):"."), ++ CONFIG_DIR_NAME, (fname[0]=='~')?fname+1:fname ); ++#else + snprintf( path, sizeof(path)-1, "%s/%s/lbreakout2-levels/%s", + (getenv( "HOME" )?getenv( "HOME" ):"."), + CONFIG_DIR_NAME, (fname[0]=='~')?fname+1:fname ); ++#endif + if ( ( file = fopen( path, "w" ) ) == 0 ) { + fprintf( stderr, "couldn't open %s\n", path ); + return 0; +-- +1.8.3.4 + + +From 18758854c84c8fc8e12ce85ecf441b278aaa0d59 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Wed, 14 Jan 2015 18:23:21 +0000 +Subject: [PATCH 3/3] Add updated icon + +--- + LBreakout2.rdef | 23 ++++++++++++----------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +diff --git a/LBreakout2.rdef b/LBreakout2.rdef +index 6b165ae..69a4652 100644 +--- a/LBreakout2.rdef ++++ b/LBreakout2.rdef +@@ -18,16 +18,17 @@ resource app_version { + }; + + resource vector_icon { +- $"6E63696605020106023D5738B7D6E13769AC3CF83249ADC94642AAFFA5040400" +- $"FF9E9E02000205B6B6DB3925EEBD5FCABAE8BF4A54944AC9EB00846C1BFF34B6" +- $"9627FF77DBCD5CF983C9C088FFFE6A5716FF020106023B7084B697593638963A" +- $"F2BB4202AB49ECC600AAD2A5F440503F050001010000850502044C24C62E24C2" ++ $"6E63696605020106023D5FC8326AB4B225F53CFFCE4A14594559B7FFA5040400" ++ $"FF9E9E02000205B6B6DB3925EEBD5FCABAE8BF4A54944AC9EB00FFCD22FF34EA" ++ $"BE26FF77F1D806F983E5D882FFFEC2A43EFF020106023B7084B697593638963A" ++ $"F2BB44015549CCC600AAD2A5F440503F050001010000850502044C24C62E24C2" + $"E124442C44B62144B96E4C34C2E134C62E34542C54B96E54B6210604AF303937" +- $"3C2B3A2948243E2D4A48584E450204B6C93AB8A73AB4EA3AB365C0BFB365BEE0" +- $"B365C29DB6C94BB4EA4BB8A74B32C0BF32C29D32BEE006033E402E5037423A50" +- $"374438493B3F330606BE0F3039233D27352242294822452948445654574E5C5B" +- $"504E4555474642090A0401042028220A0301041001178500040A020102024000" +- $"000000000000003FC3C3400000BDC3C30A010101000A02010202404DAB000000" +- $"000000404DAB4A26D645D13D0A000100000A0301001001178100040A03010300" +- $"0A030103023EC27B0000000000003EC27B46388E46B10D" ++ $"3C2B3A2948243E2D4A48584E450204B6C93AB86F3AB5223AB3CBC0BFB3CBBEE0" ++ $"B3CBC29DB6C94BB5224BB86F4B31C0BF31C29D31BEE006033E402E5037423A50" ++ $"374438493B3F330606BE0F3039243D28352342294822452948445653574D5C5A" ++ $"504E4555474642090A040104023FFB5DB90A98390A983FFB5D4347234571E30A" ++ $"03010430222001178500040A020102024000000000000000003FC3C3430000BD" ++ $"C3C30A0101012022200A02010202404DAB000000000000404DAB4A46D645D13D" ++ $"0A0001002022200A03010030222001178100040A0301032022200A030103023E" ++ $"C27B0000000000003EC27B46B88E46B10D" + }; +-- +1.8.3.4 + From 31a7d8caa9e478fb879244a3d70d5419c9489a29 Mon Sep 17 00:00:00 2001 From: Markus Himmel Date: Wed, 14 Jan 2015 19:16:33 +0000 Subject: [PATCH 7/9] LMarbles: Move config and preferences to user settings dir --- games-puzzle/lmarbles/lmarbles-1.0.8.recipe | 6 +- .../lmarbles/patches/lmarbles-1.0.8.patchset | 83 ++++++++++++++++++- 2 files changed, 84 insertions(+), 5 deletions(-) diff --git a/games-puzzle/lmarbles/lmarbles-1.0.8.recipe b/games-puzzle/lmarbles/lmarbles-1.0.8.recipe index 41bbeb6cd..af7252acd 100644 --- a/games-puzzle/lmarbles/lmarbles-1.0.8.recipe +++ b/games-puzzle/lmarbles/lmarbles-1.0.8.recipe @@ -13,7 +13,6 @@ REVISION="2" LICENSE="GNU GPL v2" COPYRIGHT="2000 Michael Speck" ARCHITECTURES="x86_gcc2 ?x86 ?x86_64" -GLOBAL_WRITABLE_FILES="var/lmarbles.prfs keep-old" PATCHES="lmarbles-1.0.8.patchset" PROVIDES=" @@ -55,6 +54,11 @@ INSTALL() make install mkdir -p $appsDir mv $binDir/lmarbles $appsDir/LMarbles + + rm $localStateDir/lmarbles.prfs + rm -rf $dataDir/applications + rm -rf $dataDir/icons + addAppDeskbarSymlink $appsDir/LMarbles LMarbles mimeset -f $appsDir/LMarbles } diff --git a/games-puzzle/lmarbles/patches/lmarbles-1.0.8.patchset b/games-puzzle/lmarbles/patches/lmarbles-1.0.8.patchset index ae0e5c29e..898a87f1a 100644 --- a/games-puzzle/lmarbles/patches/lmarbles-1.0.8.patchset +++ b/games-puzzle/lmarbles/patches/lmarbles-1.0.8.patchset @@ -1,8 +1,11 @@ -From 6b5f57906db0f0fd8a15fc60da2a791d9ea2bc36 Mon Sep 17 00:00:00 2001 +From 9045675625d6ca5bc0c56bbd2be5498ab99776b9 Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Mon, 5 Jan 2015 17:41:59 +0100 -Subject: Apply original lmarbles patch +Subject: [PATCH 1/3] Apply original lmarbles patch +--- + configure | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 543fb95..b012313 100755 @@ -30,11 +33,15 @@ index 543fb95..b012313 100755 1.8.3.4 -From f837403562b62f6aa17a967597fe61e54499a7bb Mon Sep 17 00:00:00 2001 +From a5a1d08c9a5754c3f790088cec87de41a6ac84c5 Mon Sep 17 00:00:00 2001 From: Puck Meerburg Date: Mon, 5 Jan 2015 17:54:53 +0100 -Subject: Have lmarbles use find_directory for config +Subject: [PATCH 2/3] Have lmarbles use find_directory for config +--- + src/cfg.c | 10 ++++++++-- + src/profile.c | 11 ++++++++++- + 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/cfg.c b/src/cfg.c index 2831c1b..4d713f5 100644 @@ -103,3 +110,71 @@ index 218c856..9ebf47b 100644 -- 1.8.3.4 + +From b956be01acbcbf76175ee3a2303f87a99e501320 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Wed, 14 Jan 2015 18:38:13 +0000 +Subject: [PATCH 3/3] Move lmarbles config to LGames folder + +--- + src/cfg.c | 6 +++++- + src/profile.c | 6 +++++- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/src/cfg.c b/src/cfg.c +index 4d713f5..d9ec8f0 100644 +--- a/src/cfg.c ++++ b/src/cfg.c +@@ -27,6 +27,7 @@ + + #ifdef __HAIKU__ + #include ++#include + #endif + + #ifdef _WIN32 +@@ -45,7 +46,10 @@ void C_StPth() + { + DIR *dir; + #if defined(__HAIKU__) +- find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, c_pth, sizeof(c_pth) - 1); ++ size_t length; ++ find_directory(B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, c_pth, sizeof(c_pth) - 1); ++ length = strlen(c_pth); ++ snprintf( c_pth+length, sizeof(c_pth)-(1+length), "/LGames" ); + #elif defined(_WIN32) + snprintf( c_pth, sizeof(c_pth)-1, "%s/lgames", (getenv( "HOME" )?getenv( "HOME" ):".") ); + #else +diff --git a/src/profile.c b/src/profile.c +index 9ebf47b..927f217 100644 +--- a/src/profile.c ++++ b/src/profile.c +@@ -24,6 +24,7 @@ + + #ifdef __HAIKU__ + #include ++#include + #endif + + // profiles // +@@ -39,13 +40,16 @@ extern Cfg cfg; + /* initialize dyn list and source path */ + void Prf_Ini() + { ++ size_t length; + DL_Ini(&prfs); + prfs.flgs = DL_AUTODEL; + prfs.cb = Prf_Del; + #ifdef __HAIKU__ + find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, prf_pth, + sizeof(prf_pth) - 1); +- strcat(prf_pth, "/lmarbles.prfs"); ++ length = strlen(prf_pth); ++ snprintf(prf_pth + length, sizeof(prf_pth)-(1+length), ++ "/LGames/lmarbles.prfs"); + #else + sprintf(prf_pth, "%s/lmarbles.prfs", PRF_DIR); + #endif +-- +1.8.3.4 + From ad1fa2ba9213cc5ce7923d2e49e38c4e9313890b Mon Sep 17 00:00:00 2001 From: Markus Himmel Date: Wed, 14 Jan 2015 19:51:18 +0000 Subject: [PATCH 8/9] LPairs: Move config to user settings directory --- games-puzzle/lpairs/lpairs-1.0.4.recipe | 5 +- .../lpairs/patches/lpairs-1.0.4.patch | 11 --- .../lpairs/patches/lpairs-1.0.4.patchset | 73 +++++++++++++++++++ 3 files changed, 77 insertions(+), 12 deletions(-) delete mode 100644 games-puzzle/lpairs/patches/lpairs-1.0.4.patch create mode 100644 games-puzzle/lpairs/patches/lpairs-1.0.4.patchset diff --git a/games-puzzle/lpairs/lpairs-1.0.4.recipe b/games-puzzle/lpairs/lpairs-1.0.4.recipe index 137eeec41..cd69887de 100644 --- a/games-puzzle/lpairs/lpairs-1.0.4.recipe +++ b/games-puzzle/lpairs/lpairs-1.0.4.recipe @@ -10,7 +10,7 @@ LICENSE="GNU GPL v2" COPYRIGHT="2001 Michael Speck" ARCHITECTURES="x86_gcc2 ?x86 ?x86_64" -PATCHES="lpairs-1.0.4.patch" +PATCHES="lpairs-1.0.4.patchset" PROVIDES=" lpairs = $portVersion @@ -46,5 +46,8 @@ INSTALL() { make install + rm -rf $dataDir/applications + rm -rf $dataDir/icons + addAppDeskbarSymlink $binDir/lpairs LPairs } diff --git a/games-puzzle/lpairs/patches/lpairs-1.0.4.patch b/games-puzzle/lpairs/patches/lpairs-1.0.4.patch deleted file mode 100644 index c9f820fbf..000000000 --- a/games-puzzle/lpairs/patches/lpairs-1.0.4.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- lpairs-1.0.4/configure.org 2014-08-25 20:17:46.978059264 +0200 -+++ lpairs-1.0.4/configure 2014-08-25 20:13:42.108265472 +0200 -@@ -13034,7 +13034,7 @@ - localedir=$datadir/locale - locdir_flag="-DLOCALEDIR=\\\"$localedir\\\"" - --inst_dir=$datadir/games/lpairs -+inst_dir=$datadir/lpairs - inst_flag="-DSRC_DIR=\\\"$inst_dir/\\\"" - - # Check whether --enable-install was given. diff --git a/games-puzzle/lpairs/patches/lpairs-1.0.4.patchset b/games-puzzle/lpairs/patches/lpairs-1.0.4.patchset new file mode 100644 index 000000000..967dab056 --- /dev/null +++ b/games-puzzle/lpairs/patches/lpairs-1.0.4.patchset @@ -0,0 +1,73 @@ +From 62c097ba3a2dc90d55c7064ca9c28094354a7eb4 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Wed, 14 Jan 2015 19:19:28 +0000 +Subject: [PATCH 1/2] applying patch lpairs-1.0.4.patch + +--- + configure | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure b/configure +index 4dcecb1..a1908af 100755 +--- a/configure ++++ b/configure +@@ -13034,7 +13034,7 @@ fi + localedir=$datadir/locale + locdir_flag="-DLOCALEDIR=\\\"$localedir\\\"" + +-inst_dir=$datadir/games/lpairs ++inst_dir=$datadir/lpairs + inst_flag="-DSRC_DIR=\\\"$inst_dir/\\\"" + + # Check whether --enable-install was given. +-- +1.8.3.4 + + +From 563cfd6ddafe187d5555f801c539a16bccf960e0 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Wed, 14 Jan 2015 19:36:34 +0000 +Subject: [PATCH 2/2] Move config to LGames folder in user settings + +--- + lpairs/cfg.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/lpairs/cfg.c b/lpairs/cfg.c +index 301878a..a786e39 100644 +--- a/lpairs/cfg.c ++++ b/lpairs/cfg.c +@@ -15,6 +15,11 @@ + * * + ***************************************************************************/ + ++#ifdef __HAIKU__ ++#include ++#include ++#endif ++ + #include + #include + #include +@@ -32,10 +37,18 @@ Cfg cfg; + */ + void C_StPth(char *p) + { ++ size_t length; + memset( c_pth, 0, sizeof( c_pth ) ); + if (p[0] == '~') { ++#ifdef __HAIKU__ ++ find_directory(B_USER_SETTINGS_DIRECTORY, dev_for_path("/boot"), false, ++ c_pth, sizeof(c_pth) - 1); ++ length = strlen(c_pth); ++ snprintf(c_pth+length, sizeof(c_pth)-(1+length), "/LGames%s", p+1); ++#else + snprintf(c_pth, sizeof(c_pth)-1, "%s%s", + home_dir, p+1); ++#endif + } + else + strncpy(c_pth, p, sizeof(c_pth)-1); +-- +1.8.3.4 + From 958f88d1bd848abdc2a94f25d653367121815247 Mon Sep 17 00:00:00 2001 From: Markus Himmel Date: Wed, 14 Jan 2015 21:08:48 +0000 Subject: [PATCH 9/9] LGeneral: Move config and save files to user settings directory --- games-puzzle/lgeneral/lgeneral-1.2.3.recipe | 5 +- .../lgeneral/patches/lgeneral-1.2.3.patch | 20 ----- .../lgeneral/patches/lgeneral-1.2.3.patchset | 89 +++++++++++++++++++ 3 files changed, 93 insertions(+), 21 deletions(-) delete mode 100644 games-puzzle/lgeneral/patches/lgeneral-1.2.3.patch create mode 100644 games-puzzle/lgeneral/patches/lgeneral-1.2.3.patchset diff --git a/games-puzzle/lgeneral/lgeneral-1.2.3.recipe b/games-puzzle/lgeneral/lgeneral-1.2.3.recipe index a60248823..8520e06df 100644 --- a/games-puzzle/lgeneral/lgeneral-1.2.3.recipe +++ b/games-puzzle/lgeneral/lgeneral-1.2.3.recipe @@ -14,7 +14,7 @@ LICENSE="GNU GPL v2" COPYRIGHT="Michael Speck, Leo Savernik, Peter Ivanyi" ARCHITECTURES="x86_gcc2 ?x86 ?x86_64" -PATCHES="lgeneral-1.2.3.patch" +PATCHES="lgeneral-1.2.3.patchset" PROVIDES=" lgeneral = $portVersion @@ -60,6 +60,9 @@ BUILD() INSTALL() { make install + + rm -rf $dataDir/applications + rm -rf $dataDir/icons $binDir/lgc-pg -s ./pg-data addAppDeskbarSymlink $binDir/lgeneral LGeneral diff --git a/games-puzzle/lgeneral/patches/lgeneral-1.2.3.patch b/games-puzzle/lgeneral/patches/lgeneral-1.2.3.patch deleted file mode 100644 index 1719eb095..000000000 --- a/games-puzzle/lgeneral/patches/lgeneral-1.2.3.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- lgeneral-1.2.3/configure.org 2012-04-20 20:50:03.000000000 +0200 -+++ lgeneral-1.2.3/configure 2014-07-14 16:31:39.049283072 +0200 -@@ -5314,7 +5314,7 @@ - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lm $LIBS" -+LIBS="$LIBS" - cat >conftest.$ac_ext <<_ACEOF - /* confdefs.h. */ - _ACEOF -@@ -5368,7 +5368,7 @@ - #define HAVE_LIBM 1 - _ACEOF - -- LIBS="-lm $LIBS" -+ LIBS="$LIBS" - - else - { { echo "$as_me:$LINENO: error: maths library is needed" >&5 diff --git a/games-puzzle/lgeneral/patches/lgeneral-1.2.3.patchset b/games-puzzle/lgeneral/patches/lgeneral-1.2.3.patchset new file mode 100644 index 000000000..2f740fdbd --- /dev/null +++ b/games-puzzle/lgeneral/patches/lgeneral-1.2.3.patchset @@ -0,0 +1,89 @@ +From a7b2bc562fb3a4403fefc4061b8730f27bade615 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Mon, 12 Jan 2015 20:01:38 +0000 +Subject: [PATCH 1/2] applying patch lgeneral-1.2.3.patch + +--- + configure | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 846e301..e6073fd 100755 +--- a/configure ++++ b/configure +@@ -5314,7 +5314,7 @@ if test "${ac_cv_lib_m_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lm $LIBS" ++LIBS="$LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -5368,7 +5368,7 @@ if test $ac_cv_lib_m_main = yes; then + #define HAVE_LIBM 1 + _ACEOF + +- LIBS="-lm $LIBS" ++ LIBS="$LIBS" + + else + { { echo "$as_me:$LINENO: error: maths library is needed" >&5 +-- +1.8.3.4 + + +From b29a7822ee12df83585548077267afe2be0c78e1 Mon Sep 17 00:00:00 2001 +From: Markus Himmel +Date: Wed, 14 Jan 2015 20:15:41 +0000 +Subject: [PATCH 2/2] Move main config + +--- + src/config.c | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/src/config.c b/src/config.c +index 5baa759..b44e162 100644 +--- a/src/config.c ++++ b/src/config.c +@@ -22,6 +22,13 @@ + #include + #include + #include ++ ++#ifdef __HAIKU__ ++#include ++#include ++#include ++#endif ++ + #include "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; + +-- +1.8.3.4 +