BillardGL: fix working directory

This commit is contained in:
Gerasim Troeglazov
2019-09-05 23:18:24 +10:00
parent b9f5dab6c5
commit cf829dad5b
2 changed files with 38 additions and 5 deletions

View File

@@ -5,7 +5,7 @@ DESCRIPTION="BillardGL is a very nice looking OpenGL pool billiard simulation,\
HOMEPAGE="https://sourceforge.net/projects/billardgl/"
COPYRIGHT="2001-2008 Tobias Nopper"
LICENSE="GNU GPL v2"
REVISION="3"
REVISION="4"
SOURCE_URI="http://prdownloads.sourceforge.net/billardgl/BillardGL-$portVersion.tar.gz"
CHECKSUM_SHA256="9b865b1254aa30125480ec7ea2ce00d91524db066a524b78492545782856df96"
SOURCE_DIR="BillardGL-$portVersion/src"

View File

@@ -1,4 +1,4 @@
From 186837c0739785d3aa5fa1444f453e0723844d1c Mon Sep 17 00:00:00 2001
From 1044318e9dd0a6dfe000b5fe1bf11109a01e9ce5 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3deyes@gmail.com>
Date: Fri, 27 Mar 2015 09:41:50 +0300
Subject: Add Haiku support
@@ -128,10 +128,10 @@ index fa3874b..b04a5c1 100644
#endif
--
2.19.1
2.23.0
From 61bab43b0afdf6c9dd93cdaba66b45d1fde2cd6f Mon Sep 17 00:00:00 2001
From 45d89f9b8e2d1a73a6568c631df5bca7de55c717 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sun, 25 Nov 2018 12:29:17 +1000
Subject: Fix build for gcc7
@@ -160,5 +160,38 @@ index 2dafaac..6d92960 100644
WORDX readWord(FILE *f) {
--
2.19.1
2.23.0
From 5b8e9509363f2ddc79c94661a7e7b5fa28787e81 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Thu, 5 Sep 2019 23:17:51 +1000
Subject: Resolve symlink
diff --git a/BillardGL.cpp b/BillardGL.cpp
index 39f934d..a6965e7 100644
--- a/BillardGL.cpp
+++ b/BillardGL.cpp
@@ -268,12 +268,12 @@ int main(int argc, char **argv)
{
//char string[10];
#if defined(__HAIKU__)
- if (argc && argv[0]) {
- char * slash = strrchr(argv[0], '/');
- char c = *(slash+1);
- *(slash + 1) = '\0';
- chdir(argv[0]);
- *(slash + 1) = c;
+ char *binpath = realpath(argv[0], NULL);
+ if (binpath != NULL) {
+ char *appdir = strrchr(binpath, '/');
+ *appdir = '\0';
+ chdir(binpath);
+ free(binpath);
}
#endif
--
2.23.0