From 83137678f67949971fbdbad839dc0dffc810084c Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Fri, 20 Jun 2014 13:40:28 +0200 Subject: [PATCH] NetSurf: fix install. * Don't hardcode the path to resources in the executable, use FindPaths * Set the proper desination dirs so things actually end up in the package. --- www-client/netsurf/netsurf-3.1.recipe | 7 ++- .../netsurf/patches/netsurf-3.1.patchset | 62 ++++++++++++++++++- 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/www-client/netsurf/netsurf-3.1.recipe b/www-client/netsurf/netsurf-3.1.recipe index 6d4d66c04..5b9e461e7 100644 --- a/www-client/netsurf/netsurf-3.1.recipe +++ b/www-client/netsurf/netsurf-3.1.recipe @@ -47,6 +47,7 @@ BUILD_PREREQUIRES=" cmd:bison cmd:flex cmd:gcc + cmd:git cmd:gperf cmd:make cmd:pkg_config @@ -62,12 +63,14 @@ PATCHES="netsurf-3.1.patchset" BUILD() { - make TARGET=beos PREFIX=$prefix + make TARGET=beos PREFIX=$prefix/ DESTDIR=$appsDir/ \ + NETSURF_BEOS_BIN=netsurf/ NETSURF_BEOS_RESOURCES=netsurf/res/ } INSTALL() { - make TARGET=beos PREFIX=$prefix install + make TARGET=beos PREFIX=$prefix/ DESTDIR=$appsDir/ \ + NETSURF_BEOS_BIN=netsurf/ NETSURF_BEOS_RESOURCES=netsurf/res/ install addAppDeskbarSymlink $appsDir/netsurf/NetSurf NetSurf } diff --git a/www-client/netsurf/patches/netsurf-3.1.patchset b/www-client/netsurf/patches/netsurf-3.1.patchset index a91a3ac35..2943ad429 100644 --- a/www-client/netsurf/patches/netsurf-3.1.patchset +++ b/www-client/netsurf/patches/netsurf-3.1.patchset @@ -1,4 +1,4 @@ -From 74431b243c18aa2e161037a7384dfcef907bb689 Mon Sep 17 00:00:00 2001 +From e461303c7a9f1c6e71ec10e9e0d910e897f493f5 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Mon, 9 Jun 2014 21:44:48 +0200 Subject: Fix include path for 3.1 release. @@ -20,3 +20,63 @@ index cd8070e..2483a22 100644 -- 1.8.3.4 + +From e00ad71338b86fde1cecf9b6cfc65676e3d2f153 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Fri, 20 Jun 2014 13:23:22 +0200 +Subject: Use PathFinder to locate resource folder. + +So it can work wherever NetSurf is installed... + +diff --git a/beos/gui.cpp b/beos/gui.cpp +index 365a356..caa6ef4 100644 +--- a/beos/gui.cpp ++++ b/beos/gui.cpp +@@ -37,6 +37,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -79,9 +80,6 @@ extern "C" { + + static void *myrealloc(void *ptr, size_t len, void *pw); + +-/* Where to search for shared resources. Must have trailing / */ +-#define RESPATH "/boot/apps/netsurf/res/" +- + //TODO: use resources + // enable using resources instead of files + #define USE_RESOURCES 1 +@@ -297,7 +295,13 @@ static char *find_resource(char *buf, const char *filename, const char *def) + return buf; + } + +- strcpy(t, RESPATH); ++ ++ BPathFinder f((void*)find_resource); ++ ++ BPath p; ++ f.FindPath(B_FIND_PATH_APPS_DIRECTORY, "netsurf/res/", p); ++ strcpy(t, p.Path()); ++ + strcat(t, filename); + realpath(t, buf); + if (access(buf, R_OK) == 0) +@@ -488,7 +492,10 @@ static bool nslog_stream_configure(FILE *fptr) + + static BPath get_messages_path() + { +- BPath p("/boot/apps/netsurf/res"); ++ BPathFinder f((void*)get_messages_path); ++ ++ BPath p; ++ f.FindPath(B_FIND_PATH_APPS_DIRECTORY, "netsurf/res", p); + // TODO: use Haiku's BLocale stuff + BString lang(getenv("LC_MESSAGES")); + lang.Truncate(2); +-- +1.8.3.4 +