fix: update NetSurf port & montauk frontend to use new paths for fonts and icons

This commit is contained in:
daniel committed 2026-09-30 08:47:44 +02:00
1 parent 6f3cf99667
commit 35e3d1a0bb
21 files changed
+3376 -34

No files matched your search

@@ -1,14 +1,34 @@
diff --git a/frontends/monkey/main.c b/frontends/monkey/main.c
index 463f0bea6..578d148e4 100644
index 463f0bea6..04b0e1c9f 100644
--- a/frontends/monkey/main.c
+++ b/frontends/monkey/main.c
@@ -422,7 +422,12 @@ main(int argc, char **argv)
@@ -422,7 +422,32 @@ main(int argc, char **argv)
setbuf(stderr, NULL);
/* Prep the search paths */
+#if defined(__montauk__)
+ char bundle_res[PATH_MAX];
+ char resource_path[PATH_MAX * 2];
+ const char *exec_path = argv[0];
+ const char *last_slash = strrchr(exec_path, '/');
+ size_t bundle_dir_len = last_slash == NULL ? 0 :
+ (size_t)(last_slash - exec_path + 1);
+
+ /* Locate res/ beside the running ELF so the app bundle is relocatable.
+ * MONKEY_RESPATH remains as a fallback for older startup environments. */
+ if (bundle_dir_len > 0 &&
+ bundle_dir_len + sizeof("res/") <= sizeof(bundle_res)) {
+ memcpy(bundle_res, exec_path, bundle_dir_len);
+ memcpy(bundle_res + bundle_dir_len, "res/", sizeof("res/"));
+ } else {
+ snprintf(bundle_res, sizeof(bundle_res), "%s", MONKEY_RESPATH);
+ }
+
+ /* see NS_RESPATH_SEP: ':' is part of a MontaukOS drive path */
+ respaths = nsmonkey_init_resource("${HOME}/.netsurf/;${NETSURFRES};"MONKEY_RESPATH";./frontends/monkey/res");
+ snprintf(resource_path, sizeof(resource_path),
+ "${HOME}/.netsurf/;${NETSURFRES};%s;%s;./frontends/monkey/res",
+ bundle_res, MONKEY_RESPATH);
+ respaths = nsmonkey_init_resource(resource_path);
+#else
respaths = nsmonkey_init_resource("${HOME}/.netsurf/:${NETSURFRES}:"MONKEY_RESPATH":./frontends/monkey/res");
+#endif