Add xsd_path() and use it to fix access to .xsd files on Linux (#1830).
authorCarl Hetherington <cth@carlh.net>
Mon, 14 Sep 2020 11:04:16 +0000 (13:04 +0200)
committerCarl Hetherington <cth@carlh.net>
Mon, 14 Sep 2020 11:04:16 +0000 (13:04 +0200)
src/lib/cross.h
src/lib/cross_linux.cc
src/lib/cross_osx.cc
src/lib/cross_windows.cc
src/lib/verify_dcp_job.cc
wscript

index 64cb2e6b83f5bb8952fb1d2c4c10d629e7515385..0ba43cc4058c615fe426e23babdc1239cae1dfb9 100644 (file)
@@ -54,6 +54,7 @@ extern boost::filesystem::path disk_writer_path ();
 extern void maybe_open_console ();
 #endif
 extern boost::filesystem::path shared_path ();
+extern boost::filesystem::path xsd_path ();
 extern FILE * fopen_boost (boost::filesystem::path, std::string);
 extern int dcpomatic_fseek (FILE *, int64_t, int);
 extern void start_batch_converter ();
index e17f188b9f8aacece46cfa29eb7cd884ab3d9797..95bd975f8bdad0063f43c2d508271c93f231a741 100644 (file)
@@ -103,11 +103,23 @@ shared_path ()
 {
        char const * p = getenv ("DCPOMATIC_LINUX_SHARE_PREFIX");
        if (p) {
-               return p;
+               return boost::filesystem::path(p) / "dcpomatic2";
+       }
+       return boost::filesystem::canonical(LINUX_SHARE_PREFIX) / "dcpomatic2";
+}
+
+
+boost::filesystem::path
+xsd_path ()
+{
+       char const * p = getenv ("DCPOMATIC_LINUX_SHARE_PREFIX");
+       if (p) {
+               return boost::filesystem::path(p) / "libdcp" / "xsd";
        }
-       return boost::filesystem::canonical (LINUX_SHARE_PREFIX);
+       return boost::filesystem::canonical(LINUX_SHARE_PREFIX) / "libdcp" / "xsd";
 }
 
+
 void
 run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
 {
index e91d3df16c4a6e982bcd871aee39d3b2de77ed1e..412259e6a0e687ef62a23a1c899040c2b6c61c09 100644 (file)
@@ -123,6 +123,13 @@ shared_path ()
 }
 
 
+boost::filesystem::path
+xsd_path ()
+{
+       return shared_path() / "xsd";
+}
+
+
 void
 run_ffprobe (boost::filesystem::path content, boost::filesystem::path out)
 {
index 337750dcbfd4525520c82ddc13990f44cb95f55c..272467bd3aee35af4b7293b00f3c73d87b86e05f 100644 (file)
@@ -199,6 +199,13 @@ shared_path ()
 }
 
 
+boost::filesystem::path
+xsd_path ()
+{
+       return directory_containing_executable().parent_path() / "xsd";
+}
+
+
 boost::filesystem::path
 openssl_path ()
 {
index 3d28fe759d83c4c7d5862a9913883d1406b4e6d1..f6dc1006397fc0242e794d22cf0aa276423a6df8 100644 (file)
@@ -68,7 +68,7 @@ VerifyDCPJob::update_stage (string s, optional<boost::filesystem::path> path)
 void
 VerifyDCPJob::run ()
 {
-       _notes = dcp::verify (_directories, bind (&VerifyDCPJob::update_stage, this, _1, _2), bind (&VerifyDCPJob::set_progress, this, _1, false), shared_path() / "xsd");
+       _notes = dcp::verify (_directories, bind (&VerifyDCPJob::update_stage, this, _1, _2), bind (&VerifyDCPJob::set_progress, this, _1, false), xsd_path());
 
        bool failed = false;
        BOOST_FOREACH (dcp::VerificationNote i, _notes) {
diff --git a/wscript b/wscript
index f9aa784397dae9599ae64e7c017ddc3cb652c87a..00665bbacfdf7469a3276360bec21c4bb6b3f4ae 100644 (file)
--- a/wscript
+++ b/wscript
@@ -198,7 +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/dcpomatic2"' % 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')