From c534afede0c41f3ce013a19da6d5f212e5111e0e Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Wed, 3 Feb 2021 09:52:18 +0100 Subject: [PATCH] Small adjustments for native Mac bundle. Works fine, but porting all the helpers to work from the bundle would be a lot of work. All must be changed to find their resources inside the .app Proof of concept done with antiword. Does not make sense to ship without at least poppler (and maybe unrtf, mutagen, exiftool). --- src/common/rclinit.cpp | 8 ++++++-- src/qtgui/recoll-win.pro | 4 +++- src/utils/rclutil.cpp | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/common/rclinit.cpp b/src/common/rclinit.cpp index 7512836f..e2d7395e 100644 --- a/src/common/rclinit.cpp +++ b/src/common/rclinit.cpp @@ -290,8 +290,12 @@ RclConfig *recollinit(int flags, PATH = string("/usr/local/bin/") + ":" + PATH; #else // Native qt build. Add our own directory to the path so that - // recoll finds recollindex - // pkgdatadir: /Applications/recoll.app/Contents/Resources + // recoll finds recollindex pkgdatadir: + // /Applications/recoll.app/Contents/Resources + // + // NOTE: This does not work when running from a mounted dmg + // because the location contains colons:/Volumes/:Users:dockes:Recoll:... + // which messes with the PATH colon separators of course. std::string exedir = path_cat(path_getfather(path_pkgdatadir()), "MacOS"); PATH = exedir + ":" + PATH; #endif diff --git a/src/qtgui/recoll-win.pro b/src/qtgui/recoll-win.pro index f38391e0..3e8e8d90 100644 --- a/src/qtgui/recoll-win.pro +++ b/src/qtgui/recoll-win.pro @@ -167,6 +167,8 @@ mac { -lxslt -lxml2 -liconv -lz ICON = images/recoll.icns + + system(cp ../sampleconf/mimeview.mac ../mimeview) APP_EXAMPLES.files = \ ../sampleconf/fragbuts.xml \ @@ -177,7 +179,7 @@ mac { ../sampleconf/recoll-dark.qss \ ../sampleconf/recoll-dark.css \ ../sampleconf/mimemap \ - ../sampleconf/mimeview + ../mimeview APP_EXAMPLES.path = Contents/Resources/examples APP_FILTERS.files = \ diff --git a/src/utils/rclutil.cpp b/src/utils/rclutil.cpp index 5d0b18cc..83962e56 100644 --- a/src/utils/rclutil.cpp +++ b/src/utils/rclutil.cpp @@ -285,6 +285,7 @@ const string& path_pkgdatadir() char *path= (char*)malloc(size+1); _NSGetExecutablePath(path, &size); datadir = path_cat(path_getfather(path_getfather(path)), "Resources"); + free(path); #else // If not in environment, use the compiled-in constant. datadir = RECOLL_DATADIR;