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.
This commit is contained in:
Adrien Destugues
2014-06-20 13:40:28 +02:00
parent 6b27300332
commit 83137678f6
2 changed files with 66 additions and 3 deletions

View File

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

View File

@@ -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 <pulkomandy@pulkomandy.tk>
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 <pulkomandy@pulkomandy.tk>
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 <FindDirectory.h>
#include <Mime.h>
#include <Path.h>
+#include <PathFinder.h>
#include <Roster.h>
#include <Screen.h>
#include <String.h>
@@ -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