Revert some of the Linux stuff from a few commits ago.
authorCarl Hetherington <cth@carlh.net>
Sun, 27 Sep 2020 18:05:48 +0000 (20:05 +0200)
committerCarl Hetherington <cth@carlh.net>
Sun, 27 Sep 2020 18:05:48 +0000 (20:05 +0200)
This fixes startup from the source tree.

run/dcpomatic
src/lib/cross_linux.cc
wscript

index 8ce6d060a2c23bc0ee3608ed44d20aff97670f28..43703fe68d0ee49d7119a7c358c208b0e18fda63 100755 (executable)
@@ -5,6 +5,7 @@ build=$DIR/../build
 export LD_LIBRARY_PATH=$build/src/lib:$build/src/wx:$build/src/asdcplib/src:$LD_LIBRARY_PATH
 export DYLD_LIBRARY_PATH=$build/src/lib:$build/src/wx:$build/src/asdcplib/src:/Users/c.hetherington/osx-environment/64/lib
 export DCPOMATIC_GRAPHICS=$DIR/../graphics
+export DCPOMATIC_SHARE_PREFIX=.
 binary=$build/src/tools/dcpomatic2
 if [ "$1" == "--debug" ]; then
     shift
index 5c1bb7d9090772d2968c95b45f77ae0bfdac7897..0f31c108cda69327f5c7e3a7c2d999afe14aebb7 100644 (file)
@@ -101,6 +101,11 @@ cpu_info ()
 boost::filesystem::path
 resources_path ()
 {
+       char* prefix = getenv ("DCPOMATIC_SHARE_PREFIX");
+       if (prefix) {
+               return boost::filesystem::path(prefix) / "dcpomatic2";
+       }
+
        return directory_containing_executable().parent_path() / "share" / "dcpomatic2";
 }
 
@@ -108,14 +113,14 @@ resources_path ()
 boost::filesystem::path
 xsd_path ()
 {
-       return directory_containing_executable().parent_path() / "share" / "libdcp" / "xsd";
+       return boost::filesystem::canonical(LINUX_SHARE_PREFIX) / "libdcp" / "xsd";
 }
 
 
 boost::filesystem::path
 tags_path ()
 {
-       return directory_containing_executable().parent_path() / "share" / "libdcp" / "tags";
+       return boost::filesystem::canonical(LINUX_SHARE_PREFIX) / "libdcp" / "tags";
 }
 
 
diff --git a/wscript b/wscript
index 1ac069f0b2d4ed80053bf3d2c2e17ad712b66804..00665bbacfdf7469a3276360bec21c4bb6b3f4ae 100644 (file)
--- a/wscript
+++ b/wscript
@@ -198,6 +198,7 @@ def configure(conf):
     if conf.env.TARGET_LINUX:
         conf.env.append_value('CXXFLAGS', '-mfpmath=sse')
         conf.env.append_value('CXXFLAGS', '-DLINUX_LOCALE_PREFIX="%s/share/locale"' % conf.env['INSTALL_PREFIX'])
+        conf.env.append_value('CXXFLAGS', '-DLINUX_SHARE_PREFIX="%s/share"' % conf.env['INSTALL_PREFIX'])
         conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_LINUX')
         conf.env.append_value('CXXFLAGS', ['-Wlogical-op', '-Wcast-align'])
         conf.check(lib='dl', uselib_store='DL', msg='Checking for library dl')