Merge branch '1.0' of /Users/carl/git/dvdomatic into 1.0
authorCarl Hetherington <cth@carlh.net>
Sun, 13 Oct 2013 12:12:19 +0000 (13:12 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 13 Oct 2013 12:12:19 +0000 (13:12 +0100)
ChangeLog
src/lib/cross.cc
src/lib/cross.h
src/lib/util.cc

index e870f50f092f6cd2bfb6d8f71126cc1eba11a23a..7cd3c67e5c3fa830a00e5583f0cc011e90accf66 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
 
        * Add some missing libraries to the OS X build.
 
+       * Fix libltdl search path on OS X.
+
 2013-10-12  Carl Hetherington  <cth@carlh.net>
        
        * Version 1.13 released.
index 47f07cf9d3edcf2b16c287dbff2a508aa9f11c46..ac94e8015af3554473424d8f672690f5cef8fef0 100644 (file)
@@ -35,6 +35,7 @@
 #include <sys/sysctl.h>
 #include <mach-o/dyld.h>
 #endif
+#include "exceptions.h"
 
 using std::pair;
 using std::list;
@@ -114,6 +115,28 @@ cpu_info ()
        return info;
 }
 
+#ifdef DCPOMATIC_OSX
+/** @return Path of the Contents directory in the .app */
+boost::filesystem::path
+app_contents ()
+{
+       uint32_t size = 1024;
+       char buffer[size];
+       if (_NSGetExecutablePath (buffer, &size)) {
+               throw StringError ("_NSGetExecutablePath failed");
+       }
+       
+       boost::filesystem::path path (buffer);
+       path = boost::filesystem::canonical (path);
+       std::cout << "start " << path << "\n";
+       path = path.parent_path ();
+       std::cout << "then " << path << "\n";
+       path = path.parent_path ();
+       std::cout << "and then " << path << "\n";
+       return path;
+}
+#endif
+
 void
 run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, shared_ptr<Log> log)
 {
@@ -189,15 +212,8 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, share
 #endif
 
 #ifdef DCPOMATIC_OSX
-       uint32_t size = 1024;
-       char buffer[size];
-       if (_NSGetExecutablePath (buffer, &size)) {
-               log->log ("_NSGetExecutablePath failed");
-               return;
-       }
-       
-       boost::filesystem::path path (buffer);
-       path.remove_filename ();
+       boost::filesystem::path path = app_contents();
+       path /= "MacOS";
        path /= "ffprobe";
        
        string ffprobe = path.string() + " \"" + content.string() + "\" 2> \"" + out.string() + "\"";
index c3bb20b47ba6fcb07f1425d1f2068d07ca2ceb2a..1fe34edbe0760d9e86f00c47a6689c61acf073a0 100644 (file)
@@ -30,3 +30,6 @@ extern std::string cpu_info ();
 extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path, boost::shared_ptr<Log>);
 extern std::list<std::pair<std::string, std::string> > mount_info ();
 extern boost::filesystem::path openssl_path ();
+#ifdef DCPOMATIC_OSX
+extern boost::filesystem::path app_contents ();
+#endif
index 4b780e1b7f9471176a54274c7ad983914027818f..b13d905bf0983a00bb132b80d7b33b860dd32c6a 100644 (file)
@@ -279,6 +279,15 @@ dcpomatic_setup ()
        
        avfilter_register_all ();
 
+#ifdef DCPOMATIC_OSX
+       /* Add our lib directory to the libltdl search path so that
+          xmlsec can find xmlsec1-openssl.
+       */
+       boost::filesystem::path lib = app_contents ();
+       lib /= "lib";
+       setenv ("LTDL_LIBRARY_PATH", lib.c_str (), 1);
+#endif 
+
        libdcp::init ();
        
        Ratio::setup_ratios ();