From: Friedrich Beckmann Date: Fri, 30 May 2025 11:51:29 +0000 (+0200) Subject: MacOS: Adapt Readme and initialization for bundle X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c3e4c635bfc96f5b781a8acdb1c715a93cbee23;p=pspp MacOS: Adapt Readme and initialization for bundle I changed the way the bundle is build to allow codesigning. The binary is moved to Content/MacOS and therefore the location of the resources like icons is changed with respect to the binary location. --- diff --git a/README.Git b/README.Git index dc56bebbfe..020bd45366 100644 --- a/README.Git +++ b/README.Git @@ -83,15 +83,17 @@ or for a more thorough test: Building from git on Mac OS --------------------------- -You can build on MacOS in the brew environment. After installing all -required packages to resolve library dependencies and autotools e.t.c, you -run make -f Smake as described above. +You can build on MacOS in the brew environment. Install all +required packages to resolve library dependencies and autotools. +In brew the gettext automake macros are not found by default. Run + +ACLOCAL_PATH=`brew --prefix`/Cellar/gettext/0.25/share/gettext/m4 make -f Smake The brew system provides the libraries and header files in a separate location from the MacOS system libraries. The typical locations are -Libraries: /usr/local/lib -Headers: /usr/local/include +Libraries: `brew --prefix`/lib +Headers: `brew --prefix`/include pspp under brew will be linked against the brew libraries. The configure script has to be informed about the library and header locations. Assume the following @@ -103,14 +105,18 @@ directory structure for an out of tree build: |----build (The build directory) |----gnulib (The gnulib directory as described above) +The configure command finds by default the MacOS libiconv library. That library +is not fully compatible to the gnu libiconv. So add the brew libiconv to the linker +and compiler flags such that the brew libiconv is found. Then you can build with the following commands: cd ~/mypspp/pspp make -f Smake cd ../build ../pspp/configure --prefix=/Users/USER/mypspp/install \ - LDFLAGS=-L/usr/local/lib \ - CPPFLAGS=-I/usr/local/include \ + --without-perl-module \ + LDFLAGS='-L/opt/homebrew/lib -L/opt/homebrew/Cellar/libiconv/1.18/lib'\ + CPPFLAGS='-I/opt/homebrew/include -I/opt/homebrew/Cellar/libiconv/1.18/include'\ CFLAGS='-g -O0' make make install diff --git a/src/ui/gui/pre-initialisation.h b/src/ui/gui/pre-initialisation.h index de5014147f..3f0cfc8daf 100644 --- a/src/ui/gui/pre-initialisation.h +++ b/src/ui/gui/pre-initialisation.h @@ -27,6 +27,7 @@ pre_initialisation (int *argc, char **argv) #include #include +#include "gl/relocatable.h" static inline void pre_initialisation (int *argc, char **argv) @@ -67,7 +68,7 @@ pre_initialisation (int *argc, char **argv) struct stat sb; app_dir = g_path_get_dirname (resolved_path); - g_snprintf (tmp, sizeof(tmp), "%s/../../Resources", app_dir); + g_snprintf (tmp, sizeof(tmp), "%s/../Resources", app_dir); if (realpath (tmp, res_dir) && !stat (res_dir,&sb) && S_ISDIR (sb.st_mode)) g_print ("pspp is started as MacOS application\n"); else @@ -93,10 +94,12 @@ pre_initialisation (int *argc, char **argv) g_snprintf (tmp, sizeof(tmp), "%s/share", res_dir); g_setenv ("XDG_DATA_DIRS", tmp, TRUE); + set_relocation_prefix(INSTALLPREFIX,res_dir); + if (g_getenv ("HOME")!=NULL) { g_snprintf (tmp, sizeof(tmp), - "%s/Library/Application Support/pspp/1.3/cache", + "%s/Library/Application Support/pspp/cache", g_getenv("HOME")); g_setenv ("XDG_CACHE_HOME", tmp, TRUE); }