X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=cscript;h=e0fe5adb3144bf7ceb89de9aa7218ce7ffa4d9ac;hb=c463929602252be95ca340b477b7f3b42ff6b0c0;hp=55b4fcd553599d13006ab0cbee99734eacfd2f45;hpb=1aa877613d49306b5026a5471edaf51ba3921889;p=dcpomatic.git diff --git a/cscript b/cscript index 55b4fcd55..e0fe5adb3 100644 --- a/cscript +++ b/cscript @@ -1,6 +1,6 @@ # -*- mode: python -*- # -# Copyright (C) 2012-2016 Carl Hetherington +# Copyright (C) 2012-2017 Carl Hetherington # # This file is part of DCP-o-matic. # @@ -24,21 +24,27 @@ import shutil import os import copy -deb_build_depends = {'debhelper', 'python', 'g++', 'pkg-config', 'libssh-dev', 'libsndfile1-dev', 'libgtk2.0-dev'} +deb_build_depends = dict() -deb_depends = dict() +deb_build_depends_base = ['debhelper', 'python', 'g++', 'pkg-config', 'libsndfile1-dev', 'libgtk2.0-dev', 'libx264-dev'] -deb_depends_base = ['libc6', 'libssh-4', 'libsndfile1', 'libsamplerate0', 'libxmlsec1', 'libxmlsec1-openssl', 'libcurl3', 'libgtk2.0-0'] +deb_build_depends['14.04'] = copy.deepcopy(deb_build_depends_base) +deb_build_depends['14.04'].extend(['libssh-dev']) +deb_build_depends['16.04'] = copy.deepcopy(deb_build_depends_base) +deb_build_depends['16.04'].extend(['libssh-dev']) +deb_build_depends['17.10'] = copy.deepcopy(deb_build_depends_base) +deb_build_depends['17.10'].extend(['libssh-dev']) +deb_build_depends['7'] = copy.deepcopy(deb_build_depends_base) +deb_build_depends['7'].extend(['libssh-dev']) +deb_build_depends['8'] = copy.deepcopy(deb_build_depends_base) +deb_build_depends['8'].extend(['libssh-gcrypt-dev']) +deb_build_depends['9'] = copy.deepcopy(deb_build_depends_base) +deb_build_depends['9'].extend(['libssh-gcrypt-dev']) +deb_build_depends['unstable'] = copy.deepcopy(deb_build_depends_base) -deb_depends['12.04'] = copy.deepcopy(deb_depends_base) -deb_depends['12.04'].extend(['libboost-filesystem1.48.0', - 'libboost-thread1.48.0', - 'libboost-regex1.48.0', - 'libmagick++4', - 'libxml++2.6-2', - 'libboost-date-time1.48.0', - 'libzip2', - 'libicu48']) +deb_depends = dict() + +deb_depends_base = ['libc6', 'libsndfile1', 'libsamplerate0', 'libxmlsec1', 'libxmlsec1-openssl', 'libcurl3', 'libgtk2.0-0'] deb_depends['14.04'] = copy.deepcopy(deb_depends_base) deb_depends['14.04'].extend(['libboost-filesystem1.54.0', @@ -49,30 +55,41 @@ deb_depends['14.04'].extend(['libboost-filesystem1.54.0', 'libboost-date-time1.54.0', 'libzip2', 'libcairomm-1.0-1', - 'libpangomm-1.4-1', - 'libicu52']) + 'libpangomm-1.4-1,' + 'libicu52', + 'libnettle4', + 'libssh-4', + 'libx264-142']) -deb_depends['15.10'] = copy.deepcopy(deb_depends_base) -deb_depends['15.10'].extend(['libboost-filesystem1.58.0', +deb_depends['16.04'] = copy.deepcopy(deb_depends_base) +deb_depends['16.04'].extend(['libboost-filesystem1.58.0', 'libboost-thread1.58.0', 'libboost-regex1.58.0', 'libmagick++-6.q16-5v5', 'libxml++2.6-2v5', 'libboost-date-time1.58.0', 'libzip4', + 'libcairomm-1.0-1v5', + 'libpangomm-1.4-1v5', 'libwxgtk3.0-0v5', - 'libicu55']) - -deb_depends['16.04'] = copy.deepcopy(deb_depends_base) -deb_depends['16.04'].extend(['libboost-filesystem1.58.0', - 'libboost-thread1.58.0', - 'libboost-regex1.58.0', - 'libmagick++-6.q16-5v5', + 'libicu55', + 'libnettle6', + 'libssh-4', + 'libx264-148']) + +deb_depends['17.10'] = copy.deepcopy(deb_depends_base) +deb_depends['17.10'].extend(['libboost-filesystem1.62.0', + 'libboost-thread1.62.0', + 'libboost-regex1.62.0', + 'libmagick++-6.q16-7', 'libxml++2.6-2v5', - 'libboost-date-time1.58.0', + 'libboost-date-time1.62.0', 'libzip4', 'libwxgtk3.0-0v5', - 'libicu55']) + 'libicu57', + 'libnettle6', + 'libssh-4', + 'libx264-148']) deb_depends['7'] = copy.deepcopy(deb_depends_base) deb_depends['7'].extend(['libboost-filesystem1.49.0', @@ -84,7 +101,10 @@ deb_depends['7'].extend(['libboost-filesystem1.49.0', 'libzip2', 'libcairomm-1.0-1', 'libpangomm-1.4-1', - 'libicu48']) + 'libicu48', + 'libnettle4', + 'libnotify4', + 'libx264-123']) deb_depends['8'] = copy.deepcopy(deb_depends_base) deb_depends['8'].extend(['libboost-filesystem1.55.0', @@ -94,21 +114,41 @@ deb_depends['8'].extend(['libboost-filesystem1.55.0', 'libmagick++-6.q16-5', 'libxml++2.6-2', 'libzip2', + 'libcairomm-1.0-1', + 'libpangomm-1.4-1', 'libwxgtk3.0-0', 'libxcb-xfixes0', 'libxcb-shape0', - 'libicu52']) + 'libicu52', + 'libnettle4', + 'libssh-4', + 'libx264-142']) + +deb_depends['9'] = copy.deepcopy(deb_depends_base) +deb_depends['9'].extend(['libboost-filesystem1.62.0', + 'libboost-thread1.62.0', + 'libboost-regex1.62.0', + 'libboost-date-time1.62.0', + 'libmagick++-6.q16-7', + 'libxml++2.6-2v5', + 'libgtk2.0-0', + 'libzip4', + 'libicu57', + 'libnettle6', + 'libx264-148']) deb_depends['unstable'] = copy.deepcopy(deb_depends_base) -deb_depends['unstable'].extend(['libboost-filesystem1.58.0', - 'libboost-thread1.58.0', - 'libboost-regex1.58.0', - 'libmagick++-6.q16-5v5', +deb_depends['unstable'].extend(['libboost-filesystem1.62.0', + 'libboost-thread1.62.0', + 'libboost-regex1.62.0', + 'libboost-date-time1.62.0', + 'libmagick++-6.q16-7', 'libxml++2.6-2v5', 'libgtk2.0-0', - 'libboost-date-time1.58.0', - 'libzip2', - 'libicu52']) + 'libzip4', + 'libicu57', + 'libnettle6', + 'libx264-148']) def packages(name, packages, f): s = '%s: ' % name @@ -122,7 +162,7 @@ def make_control(debian_version, bits, filename, debug): print('Section: video', file=f) print('Priority: extra', file=f) print('Maintainer: Carl Hetherington ', file=f) - packages('Build-Depends', deb_build_depends, f) + packages('Build-Depends', deb_build_depends[debian_version], f) print('Standards-Version: 3.9.3', file=f) print('Homepage: http://dcpomatic.com/', file=f) print('', file=f) @@ -135,9 +175,9 @@ def make_control(debian_version, bits, filename, debug): packages('Depends', deb_depends[debian_version], f) print('Description: Generator of Digital Cinema Packages (DCPs)', file=f) - print(' DCP-o-matic generates Digital Cinema Packages (DCPs) from video and audio', file=f) - print(' files (such as those from DVDs or Blu-Rays) for presentation on DCI-compliant', file=f) - print(' digital projectors.', file=f) + print(' DCP-o-matic generates Digital Cinema Packages (DCPs) from videos, images,', file=f) + print(' sound and subtitle files. You can use it to make content for playback on DCI-compliant', file=f) + print(' cinema projectors.', file=f) if debug: print('', file=f) @@ -179,6 +219,7 @@ def make_spec(filename, version, target): print('%{_bindir}/dcpomatic2_server', file=f) print('%{_bindir}/dcpomatic2_server_cli', file=f) print('%{_bindir}/dcpomatic2_kdm_cli', file=f) + print('%{_bindir}/dcpomatic2_player', 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) @@ -193,6 +234,7 @@ def make_spec(filename, version, target): print('%%{_datadir}/icons/hicolor/%s/apps/dcpomatic2_batch.png' % r, file=f) print('%%{_datadir}/icons/hicolor/%s/apps/dcpomatic2_kdm.png' % r, file=f) print('%%{_datadir}/icons/hicolor/%s/apps/dcpomatic2_server.png' % r, file=f) + print('%%{_datadir}/icons/hicolor/%s/apps/dcpomatic2_player.png' % r, file=f) for l in ['de_DE', 'es_ES', 'fr_FR', 'it_IT', 'sv_SE', 'nl_NL', 'ru_RU', 'pl_PL', 'da_DK', 'pt_PT', 'pt_BR', 'sk_SK', 'cs_CZ', 'uk_UA', 'zh_CN']: print('%%{_datadir}/locale/%s/LC_MESSAGES/dcpomatic2.mo' % l, file=f) print('%%{_datadir}/locale/%s/LC_MESSAGES/libdcpomatic2-wx.mo' % l, file=f) @@ -205,13 +247,8 @@ def make_spec(filename, version, target): 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) - if target.distro == 'centos' and target.version == '5': - prefix = 'BUILDROOT/usr' - else: - prefix = '%{buildroot}/usr' - - print('CXXFLAGS="-I%s/include" LDFLAGS="-L%s/lib" ./waf configure --prefix=%s --install-prefix=/usr %s' % - (target.directory, target.directory, prefix, configure_options(target)), file=f) + print('CXXFLAGS="-I%s/include" LDFLAGS="-L%s/lib" ./waf configure --prefix=%%{buildroot}/usr --install-prefix=/usr %s' % + (target.directory, target.directory, configure_options(target)), file=f) print('./waf', file=f) print('%install', file=f) print('cd dcpomatic-%s' % version, file=f) @@ -236,9 +273,10 @@ def dependencies(target): else: ffmpeg_options = {} - return (('ffmpeg-cdist', 'aab2fb1', ffmpeg_options), - ('libdcp', 'a5bf0e4'), - ('libsub', '6825d70')) + return (('ffmpeg-cdist', '5fce90f', ffmpeg_options), + ('libdcp', '0a47e4c'), + ('libsub', '688c501'), + ('rtaudio-cdist', None)) def configure_options(target): opt = '' @@ -249,11 +287,20 @@ def configure_options(target): elif target.platform == 'linux': opt += ' --static-dcpomatic --static-wxwidgets --static-ffmpeg --static-dcp --static-sub --static-cxml' if target.distro == 'centos': - opt += ' --static-xmlsec --static-ssh --disable-tests' + opt += ' --disable-tests' if target.version == '6.5': opt += ' --static-boost --static-xmlpp' elif target.version == '7': - opt += ' --workaround-gssapi --static-xmlpp' + opt += ' --workaround-gssapi' + # Centos 7 ships with glibmm 2.50.0 which requires C++11 + # but its compiler (gcc 4.8.5) defaults to C++97. Go figure. + # I worry that this will cause ABI problems but I don't have + # a better solution. + opt += ' --force-cpp11' + + # Build Windows debug versions with static linking as I think gdb works better then + if target.debug and target.platform == 'windows': + opt += ' --static-dcpomatic' return opt @@ -300,10 +347,10 @@ def package_debian(target, cpu, version): target.set('CDIST_CONFIGURE', '"' + configure_options(target) + '"') if target.debug: target.set('CDIST_DEBUG_PACKAGE', '--dbg-package=dcpomatic-dbg') - if target.version in ['15.04', '15.10', '16.04', '8']: - target.set('CDIST_LOCALE_PREFIX', '/usr/share/locale') - else: + if target.version in ['7', '14.04']: target.set('CDIST_LOCALE_PREFIX', '/usr/local/share/locale') + else: + target.set('CDIST_LOCALE_PREFIX', '/usr/share/locale') target.command('dpkg-buildpackage -uc -us') @@ -314,6 +361,7 @@ def package_debian(target, cpu, version): return debs def package_rpm(target, cpu, version): + print('package_rpm %s %s %s' % (target, cpu, version)) topdir = os.path.realpath('build/rpmbuild') os.makedirs('%s/BUILD' % topdir) os.makedirs('%s/RPMS' % topdir) @@ -328,9 +376,7 @@ def package_rpm(target, cpu, version): ) make_spec('build/platform/linux/dcpomatic2.spec', version, target) - cmd = 'rpmbuild --define \'_topdir %s\' -bb build/platform/linux/dcpomatic2.spec' % topdir - if target.distro == 'centos' and target.version == '5': - cmd += ' --buildroot %s/BUILD/dcpomatic-%s/BUILDROOT' % (topdir, version) + cmd = 'rpmbuild --define "_topdir %s" -bb build/platform/linux/dcpomatic2.spec' % topdir target.command(cmd) rpms = [] @@ -357,11 +403,26 @@ def package(target, version): if target.distro == 'debian' or target.distro == 'ubuntu': return package_debian(target, cpu, version) - elif target.distro == 'centos' or target.distro == 'fedora': + elif target.distro == 'centos' or target.distro == 'fedora' or target.distro == 'mageia': return package_rpm(target, cpu, version) elif target.platform == 'osx': target.command('bash platform/osx/make_dmg.sh %s' % target.directory) - return os.path.abspath(glob.glob('build/platform/osx/DCP-o-matic*.dmg')[0]) + return [os.path.abspath(x) for x in glob.glob('build/platform/osx/DCP-o-matic*.dmg')] + elif target.platform == 'docker': + shutil.copyfile(target.deb, 'build/platform/docker') + f = open('build/platform/docker/Dockerfile', 'w') + print('FROM debian:jessie', file=f) + print('MAINTAINER carl@dcpomatic.com', file=f) + print('ADD build/platform/docker/dcpomatic_%s-1_amd64.deb /tmp' % (version, version), file=f) + print('RUN apt-get -o Acquire:http::Timeout="5" update; exit 0', file=f) + print('RUN dpkg -i /tmp/dcpomatic_*.deb; exit 0', file=f) + print('RUN apt-get -y -f install', file=f) + print('RUN apt-get clean', file=f) + print('EXPOSE 6192', file=f) + print('CMD ["/usr/bin/dcpomatic2_server_cli", "--verbose"]', file=f) + f.close() + target.command('docker build build/platform/docker -t dcpomatic-server:%s' % version) + target.command('docker save dcpomatic-server:%s -o dcpomatic-server-%s-docker.tar' % (version, version)) def make_pot(target): target.command('./waf pot') @@ -378,7 +439,9 @@ def make_manual(target): def test(target, test): if target.platform != 'windows': target.set('LC_ALL', 'C') - if test is None: - target.command('run/tests') - else: - target.command('run/tests --run_test=%s' % test) + cmd = 'run/tests ' + if target.debug: + cmd += '--backtrace ' + if test is not None: + cmd += '--run_test=%s' % test + target.command(cmd)