summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-08-07 19:19:02 +0200
committerCarl Hetherington <cth@carlh.net>2023-08-30 00:38:14 +0200
commit3b51e992033302a3e7fcf9f0944be22dca596f82 (patch)
tree5b6d326e1b86ecafe1b034c5fcc7bdbcbb523a51
parente71e6d33210e4a4c7d7841d0d5d8e906e00bb82f (diff)
Works but builds everything.
-rw-r--r--cscript188
-rw-r--r--src/lib/cross_linux.cc6
2 files changed, 95 insertions, 99 deletions
diff --git a/cscript b/cscript
index 7dd1cf0e1..2daf8ae3e 100644
--- a/cscript
+++ b/cscript
@@ -566,111 +566,101 @@ def configure_options(target, options, for_package=False):
def build(target, options, for_package):
if target.platform == 'flatpak':
- target.checkout_dependencies()
- prefix = 'https://dcpomatic.com/deps'
+ prefix = 'https://dcpomatic.com/deps/linux'
modules = []
- modules.append({'name': 'libzip',
- 'buildsystem': 'cmake',
- 'sources': [{'type': 'archive',
- 'url': '%s/libzip-1.4.0.tar.xz' % prefix,
- 'sha256': 'e508aba025f5f94b267d5120fc33761bcd98440ebe49dbfe2ed3df3afeacc7b1'}]})
- modules.append({'name': 'libsigc++',
- 'sources': [{'type': 'archive',
- 'url': '%s/libsigc++-2.10.0.tar.xz' % prefix,
- 'sha256': 'f843d6346260bfcb4426259e314512b99e296e8ca241d771d21ac64f28298d81'}]})
- modules.append({'name': 'glibmm',
- 'sources': [{'type': 'archive',
- 'url': '%s/glibmm-2.48.1.tar.xz' % prefix,
- 'sha256': 'dc225f7d2f466479766332483ea78f82dc349d59399d30c00de50e5073157cdf'}]})
- modules.append({'name': 'cairomm',
- 'sources': [{'type': 'archive',
- 'url': '%s/cairomm-1.12.2.tar.gz' % prefix,
- 'sha256': '45c47fd4d0aa77464a75cdca011143fea3ef795c4753f6e860057da5fb8bd599'}]})
- modules.append({'name': 'pangomm',
- 'sources': [{'type': 'archive',
- 'url': '%s/pangomm-2.40.1.tar.xz' % prefix,
- 'sha256': '9762ee2a2d5781be6797448d4dd2383ce14907159b30bc12bf6b08e7227be3af'}]})
- modules.append({'name': 'libxml++',
- 'sources': [{'type': 'archive',
- 'url': '%s/libxml++-2.40.1.tar.xz' % prefix,
- 'sha256': '4ad4abdd3258874f61c2e2a41d08e9930677976d303653cd1670d3e9f35463e9'}]})
- modules.append({'name': 'xmlsec1',
- 'sources': [{'type': 'archive',
- 'url': '%s/xmlsec1-1.2.25.tar.gz' % prefix,
- 'sha256': '967ca83edf25ccb5b48a3c4a09ad3405a63365576503bf34290a42de1b92fcd2'}]})
- modules.append({'name': 'openjpeg2',
- 'buildsystem': 'cmake',
- 'sources': [{'type': 'dir', 'path': os.path.abspath('../openjpeg2-cdist')}]})
- modules.append({'name': 'boost',
- 'buildsystem': 'simple',
- 'build-commands': [
- './bootstrap.sh --prefix=/app',
- './b2 install'
- ],
- 'sources': [{'type': 'archive',
- 'url': '%s/boost_1_66_0.tar.bz2' % prefix,
- 'sha256': '5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9'}]})
- modules.append({'name': 'asdcplib',
- 'buildsystem': 'simple',
- 'build-commands': [
- './waf configure --prefix=/app --libdir=/app/lib build install'
- ],
- 'sources': [{'type': 'dir', 'path': os.path.abspath('../asdcplib-carl')}]})
- modules.append({'name': 'locked_sstream',
- 'buildsystem': 'simple',
- 'build-commands': [
- './waf configure --prefix=/app build install'
- ],
- 'sources': [{'type': 'dir', 'path': os.path.abspath('../locked_sstream')}]})
- modules.append({'name': 'libcxml',
- 'buildsystem': 'simple',
- 'build-commands': [
- './waf configure --prefix=/app --libdir=/app/lib build install'
- ],
- 'sources': [{'type': 'dir', 'path': os.path.abspath('../libcxml')}]})
- modules.append({'name': 'libdcp',
+
+ def module(name, version, sha256, buildsystem, extension='xz', config_opts=None):
+ desc = {'name': name,
+ 'buildsystem': buildsystem,
+ 'sources': [{'type': 'archive',
+ 'url': '%s/%s-%s.tar.%s' % (prefix, name, version, extension),
+ 'sha256': sha256}]}
+ if buildsystem == 'cmake':
+ desc['builddir'] = True
+ if config_opts:
+ desc['config-opts'] = config_opts
+ print(desc)
+ modules.append(desc)
+
+ def waf(name, config=''):
+ modules.append({'name': name,
+ 'buildsystem': 'simple',
+ 'sources': [{'type': 'dir',
+ 'path': '../../%s' % name}],
+ 'build-commands': [
+ './waf configure --prefix=/app --libdir=/app/lib %s' % config,
+ './waf install',
+ ]})
+
+ module('libzip', '1.4.0', 'e508aba025f5f94b267d5120fc33761bcd98440ebe49dbfe2ed3df3afeacc7b1', 'cmake')
+ module('mm-common', '1.0.2', 'a2a99f3fa943cf662f189163ed39a2cfc19a428d906dd4f92b387d3659d1641d', 'meson')
+ module('libsigc++', '2.10.6', 'dda176dc4681bda9d5a2ac1bc55273bdd381662b7a6d49e918267d13e8774e1b', 'autotools')
+ module('glibmm', '2.64.5', '508fc86e2c9141198aa16c225b16fd6b911917c0d3817602652844d0973ea386', 'meson')
+ module('cairomm', '1.12.2', '45c47fd4d0aa77464a75cdca011143fea3ef795c4753f6e860057da5fb8bd599', 'autotools', extension='gz')
+ module('pangomm', '2.42.2', '1b24c92624ae1275ccb57758175d35f7c39ad3342d8c0b4ba60f0d9849d2d08a', 'meson')
+ module('libxml++', '2.40.1', '4ad4abdd3258874f61c2e2a41d08e9930677976d303653cd1670d3e9f35463e9', 'autotools')
+ module('xmlsec1', '1.2.25', '967ca83edf25ccb5b48a3c4a09ad3405a63365576503bf34290a42de1b92fcd2', 'autotools', extension='gz')
+ module('xerces-c', '3.2.3', '12fc99a9fc1d1a79bd0e927b8b5637a576d6656f45b0d5e70ee3694d379cc149', 'autotools')
+ module('glu', '9.0.3', 'bd43fe12f374b1192eb15fe20e45ff456b9bc26ab57f0eee919f96ca0f8a330f', 'meson')
+ module('x264', 'snapshot-20170705-2245', '633d72105a67ce034355a7f2c5fc7646c06c32063841c4d71b292656996b48bf', 'autotools', extension='bz2', config_opts=['--enable-pic', '--enable-static', '--disable-shared'])
+ module(
+ 'ImageMagick', '7.0.10-31', 'c0d2b79dc959bb5f20c90596b41ac9baad34f659d9192f2abb3c06a0778f47d1', 'autotools',
+ config_opts=['--without-x', '--disable-opencl', '--disable-dependency-tracking', '--disable-openmp', '--with-png=yes', '--with-tiff=yes']
+ )
+ modules.append({'name': 'openssl',
'buildsystem': 'simple',
'build-commands': [
- './waf configure --prefix=/app --libdir=/app/lib build install'
+ './config --prefix=/app',
+ 'make -j16',
+ 'make install',
],
- 'sources': [{'type': 'dir', 'path': os.path.abspath('../libdcp')}]})
- modules.append({'name': 'libsub',
+ 'sources': [
+ {
+ 'type': 'dir',
+ 'path': '../../openssl'
+ },
+ ]})
+ modules.append({'name': 'boost',
'buildsystem': 'simple',
'build-commands': [
- './waf configure --prefix=/app --libdir=/app/lib build install'
+ './bootstrap.sh --prefix=/app',
+ './b2 --with-filesystem --with-thread --with-regex --with-date_time --with-locale install',
],
- 'sources': [{'type': 'dir', 'path': os.path.abspath('../libsub')}]})
- modules.append({'name': 'rtaudio',
- 'build-options': {
- 'config-opts': [
- '--prefix=/app',
- '--with-pulse',
- '--with-alsa'
- ]
- },
- 'sources': [{'type': 'dir', 'path': os.path.abspath('../rtaudio-cdist')}]})
- modules.append({'name': 'wxwidgets',
- 'sources': [{'type': 'archive',
- 'url': '%s/wxWidgets-3.0.3.tar.bz2' % prefix,
- 'sha256': '08c8033f48ec1b23520f036cde37b5ae925a6a65f137ded665633ca159b9307b'}]})
- modules.append({'name': 'libssh',
+ 'sources': [
+ { 'type': 'archive',
+ 'url': '%s/boost_1_66_0.tar.bz2' % prefix,
+ 'sha256': '5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9'
+ },
+ ]})
+ module('wxWidgets', '3.0.3', '08c8033f48ec1b23520f036cde37b5ae925a6a65f137ded665633ca159b9307b', 'autotools', extension='bz2')
+ module('libssh', '0.9.5', 'acffef2da98e761fc1fd9c4fddde0f3af60ab44c4f5af05cd1b2d60a3fa08718', 'cmake')
+ waf('leqm-nrt', '--without-libsndfile')
+ waf('libcxml', '--disable-tests')
+ modules.append({'name': 'openjpeg',
'buildsystem': 'cmake',
- 'builddir': True,
- 'sources': [{'type': 'archive',
- 'url': '%s/libssh-0.7.5.tar.xz' % prefix,
- 'sha256': '54e86dd5dc20e5367e58f3caab337ce37675f863f80df85b6b1614966a337095'}]})
- modules.append({'name': 'dcpomatic',
- 'buildsystem': 'simple',
- 'build-commands': [
- './waf configure --prefix=/app build install'
- ],
- 'build-options': {
- 'build-args': ['--share=network']
- },
- 'sources': [{'type': 'dir', 'path': os.path.abspath('.')}]})
+ 'config-opts': ['-DBUILD_PKGCONFIG_FILES=ON'],
+ 'sources': [{'type': 'dir',
+ 'path': '../../openjpeg'}],
+ })
+ waf('asdcplib')
+ waf('libdcp', '--disable-tests --disable-examples --disable-benchmarks')
+ waf('libsub', '--disable-tests')
+ modules.append({'name': 'ffmpeg',
+ 'buildsystem': 'autotools',
+ 'config-opts': ['--disable-indev=jack', '--enable-gpl', '--enable-libx264', '--enable-libdav1d', '--enable-shared'],
+ 'sources': [{'type': 'dir',
+ 'path': '../../ffmpeg'}],
+ })
+ modules.append({'name': 'rtaudio',
+ 'buildsystem': 'autotools',
+ 'config-opts': ['--with-pulse', '--with-alsa'],
+ 'sources': [{'type': 'dir',
+ 'path': '../../rtaudio'}],
+ })
+ waf('dcpomatic', '--disable-tests')
desc = {'app-id': 'com.dcpomatic.DCP-o-matic',
'runtime': 'org.gnome.Sdk',
- 'runtime-version': '3.26',
+ 'runtime-version': '3.38',
'sdk': 'org.gnome.Sdk',
'command': 'dcpomatic2',
'finish-args': ['--socket=x11', '--share=ipc', '--share=network', '--socket=pulseaudio', '--filesystem=host'],
@@ -678,7 +668,7 @@ def build(target, options, for_package):
os.makedirs('build/platform')
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())
+ target.command('%s -v --user --repo=build/platform/repo build/platform/flatpak --gpg-sign 70AAE40A90A2466AD8C57ADEF85070CB89F81088 --gpg-homedir=/tmp/gpg build/com.dcpomatic.DCP-o-matic.json' % target.flatpak_builder())
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')
@@ -829,6 +819,9 @@ def package(target, version, options):
"""version: DCP-o-matic version string"""
if target.platform == 'windows':
return package_windows(target)
+ elif target.platform == 'flatpak':
+ target.command('%s build-bundle build/platform/repo build/dcpomatic_%s.flatpak com.dcpomatic.DCP-o-matic' % (target.flatpak(), version))
+ return os.path.abspath('build/dcpomatic_%s.flatpak' % version)
elif target.platform == 'linux':
if target.detail == 'appimage':
out = []
@@ -873,9 +866,6 @@ def package(target, version, options):
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))
- elif target.platform == 'flatpak':
- target.command('%s build-bundle build/platform/repo build/dcpomatic_%s.flatpak com.dcpomatic.DCP-o-matic' % (target.flatpak(), version))
- return os.path.abspath('build/dcpomatic_%s.flatpak' % version)
def make_pot(target):
target.command('./waf pot')
diff --git a/src/lib/cross_linux.cc b/src/lib/cross_linux.cc
index 0a12d7cca..74e6f1132 100644
--- a/src/lib/cross_linux.cc
+++ b/src/lib/cross_linux.cc
@@ -157,6 +157,12 @@ openssl_path ()
return p;
}
+ /* flatpak */
+ p = directory_containing_executable() / "openssl";
+ if (boost::filesystem::is_regular_file(p)) {
+ return p;
+ }
+
return "dcpomatic2_openssl";
}