Merge branch 'dist' of git://git.carlh.net/git/dcpomatic into dist
[dcpomatic.git] / cscript
diff --git a/cscript b/cscript
index e548df08c5ee832c0ef5443f7bd1dadf6a627029..f258f5dfe7b9dd1f1d9b119797fb4d6ffd275295 100644 (file)
--- a/cscript
+++ b/cscript
@@ -196,8 +196,8 @@ deb_depends['unstable'].extend(['libboost-filesystem1.67.0',
                                 'libx264-155',
                                 'libcurl4'])
 
-def build_dist(target):
-    # We can build dcpomatic2_dist on platforms that have Boost process and can build the lwext4
+def can_build_disk(target):
+    # We can build dcpomatic2_disk on platforms that have Boost process and can build the lwext4
     # library.  For now, just whitelist good ones here.
     #
     # - Lots of Linux distros don't have a new enough boost (1.64 or above)
@@ -286,9 +286,9 @@ def make_spec(filename, version, target, options, requires=None):
     if options['variant'] == 'swaroop-studio':
         print('%{_bindir}/dcpomatic2_ecinema', file=f)
         print('%{_bindir}/dcpomatic2_uuid', file=f)
-    if os.path.exists(os.path.join(tools, "dcpomatic2_dist")):
-        print('%{_bindir}/dcpomatic2_dist', file=f)
-        print('%{_bindir}/dcpomatic2_dist_writer', file=f)
+    if os.path.exists(os.path.join(tools, "dcpomatic2_disk")):
+        print('%{_bindir}/dcpomatic2_disk', file=f)
+        print('%{_bindir}/dcpomatic2_disk_writer', file=f)
     print('%{_datadir}/applications/dcpomatic2.desktop', file=f)
     print('%{_datadir}/applications/dcpomatic2_batch.desktop', file=f)
     print('%{_datadir}/applications/dcpomatic2_server.desktop', file=f)
@@ -347,7 +347,7 @@ def make_spec(filename, version, target, options, requires=None):
     print('%posttrans', file=f)
     print('/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :', file=f)
 
-def dependencies(target):
+def dependencies(target, options):
 
     if target.platform == 'linux':
         ffmpeg_options = { 'shared': False }
@@ -362,21 +362,23 @@ def dependencies(target):
         # Use distro-provided FFmpeg on Arch
         deps = []
 
-    deps.append(('libdcp', None, {'force-cpp11': True}))
-    deps.append(('libsub', None, {'force-cpp11': True}))
+    # Let's use C++11 mode if we can
+    cpp_lib_options = {'force-cpp11': True} if target.platform == 'osx' and target.bits == 64 else {}
+
+    deps.append(('libdcp', None, cpp_lib_options))
+    deps.append(('libsub', None, cpp_lib_options))
     deps.append(('rtaudio', 'carl'))
     # We get our OpenSSL libraries from the environment, but we
     # also need a patched openssl binary to make certificates.
     # This dependency is to get that binary, which is added into
     # the appropriate place later
     deps.append(('openssl', 'carl'))
-    if build_dist(target):
+    if can_build_disk(target):
         deps.append(('lwext4', 'carl2'))
 
     return deps
 
-def option_defaults():
-    return { "gui": True, "variant": None }
+option_defaults = { "gui": True, "variant": None, "disk": False }
 
 def configure_options(target, options):
     opt = ''
@@ -414,8 +416,8 @@ def configure_options(target, options):
     if target.debug and target.platform == 'windows':
         opt += ' --static-dcpomatic'
 
-    if build_dist(target):
-       opt += ' --enable-dist'
+    if can_build_disk(target) and options['disk']:
+       opt += ' --enable-disk'
 
     return opt