X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=cscript;h=57a2a43e4571eb6111fa366e98e9e8b6f5a07032;hb=d09211f0e6a6b5e3bd69d09cade8b9bfb22db297;hp=665e151b1615834dcc74d712297ee915864602d1;hpb=7f6f5b60813efcf2610ead424ea216d59a256482;p=dcpomatic.git diff --git a/cscript b/cscript index 665e151b1..57a2a43e4 100644 --- a/cscript +++ b/cscript @@ -363,7 +363,7 @@ def make_spec(filename, version, target, options, requires=None): print('cd dcpomatic-%s' % version, file=f) print('export PKG_CONFIG_PATH=%s/lib/pkgconfig:%s/lib64/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig' % (target.directory, target.directory), file=f) print('CXXFLAGS="-I%s/include" LDFLAGS="-L%s/lib" ./waf configure --prefix=%%{buildroot}/usr --destdir=/usr %s' % - (target.directory, target.directory, configure_options(target, options)), file=f) + (target.directory, target.directory, configure_options(target, options, for_package=True)), file=f) print('./waf', file=f) print('%install', file=f) print('cd dcpomatic-%s' % version, file=f) @@ -417,12 +417,14 @@ def dependencies(target, options): option_defaults = { "gui": True, "variant": None } -def configure_options(target, options): +def configure_options(target, options, for_package=False): opt = ' --warnings-are-errors' - if not ((target.platform == 'linux' and target.distro == 'ubuntu' and target.version == '18.04') or + if for_package or not ( + (target.platform == 'linux' and target.distro == 'ubuntu' and target.version == '18.04') or (target.platform == 'osx') or - (target.platform == 'windows')): + (target.platform == 'windows') + ): # Currently we only build tests on Ubuntu 18.04, macOS and Windows opt += ' --disable-tests' @@ -456,7 +458,7 @@ def configure_options(target, options): return opt -def build(target, options): +def build(target, options, for_package): if target.platform == 'flatpak': target.checkout_dependencies() prefix = 'https://dcpomatic.com/deps' @@ -571,8 +573,8 @@ def build(target, options): with open('build/com.dcpomatic.DCP-o-matic.json', 'w') as outfile: json.dump(desc, outfile) target.command('%s --repo=build/platform/repo build/platform/flatpak build/com.dcpomatic.DCP-o-matic.json' % target.flatpak_builder()) - else: - target.command('./waf configure --prefix=%s %s' % (target.directory, configure_options(target, options))) + elif target.platform != 'linux' or target.detail == 'appimage' or not for_package: + target.command('./waf configure --prefix=%s %s' % (target.directory, configure_options(target, options, for_package))) target.command('./waf') target.command('./waf install') @@ -617,7 +619,7 @@ def package_debian(target, cpu, version, options): target.set('CDIST_PKG_CONFIG_PATH', target.get('PKG_CONFIG_PATH')) target.set('CDIST_DIRECTORY', target.directory) - target.set('CDIST_CONFIGURE', '"' + configure_options(target, options) + '"') + target.set('CDIST_CONFIGURE', '"' + configure_options(target, options, for_package=True) + '"') target.set('CDIST_PACKAGE', f'dcpomatic{suffix}') if not target.debug: target.set('CDIST_DEBUG_PACKAGE_FLAG', '--no-ddebs') @@ -713,10 +715,6 @@ def make_appimage(target, nice_name, internal_name, version): def package(target, version, options): """version: DCP-o-matic version string""" - if target.platform != 'linux' or target.detail == 'appimage': - # In most cases we need to build ourselves before packaging, but on some Linux targets the packaging - # tool wants to build DCP-o-matic so we don't bother here. - build(target, options) if target.platform == 'windows': return package_windows(target) elif target.platform == 'linux':