5 deb_build_depends = {'debhelper': '8.0.0',
10 'libsndfile1-dev': '1.0.25',
11 'libmagick++-dev': '8:6.6.9.7',
12 'libgtk2.0-dev': '2.24.10'}
16 deb_depends['12.04'] = {'libc6': '2.15',
18 'libboost-filesystem1.48.0': '1.48.0-3',
19 'libboost-thread1.48.0': '1.48.0-3',
20 'libsndfile1': '1.0.25',
21 'libmagick++4': '8:6.6.9.7',
22 'libxml++2.6-2': '2.34.1',
23 'libgtk2.0-0': '2.24.10',
24 'libxmlsec1': '1.2.14-1.2build1',
25 'libxmlsec1-openssl': '1.2.14-1.2build1',
26 'libboost-date-time1.48.0': '1.48.0-3',
27 'libcurl3': '7.22.0-3ubuntu4',
28 'libzip2': '0.10-1ubuntu1'}
30 deb_depends['12.10'] = {'libc6': '2.15',
32 'libboost-filesystem1.49.0': '1.49.0',
33 'libboost-thread1.49.0': '1.49.0',
34 'libsndfile1': '1.0.25',
35 'libmagick++5': '8:6.7.7.10',
36 'libxml++2.6-2': '2.34.2',
37 'libgtk2.0-0': '2.24.13',
38 'libxmlsec1': '1.2.18-2',
39 'libxmlsec1-openssl': '1.2.18-2',
40 'libboost-date-time1.49.0': '1.49.0',
41 'libcurl3': '7.27.0-1ubuntu1',
42 'libzip2': '0.10.1-1.1'}
44 deb_depends['13.04'] = {'libc6': '2.15',
46 'libboost-filesystem1.49.0': '1.49.0',
47 'libboost-thread1.49.0': '1.49.0',
48 'libsndfile1': '1.0.25',
49 'libmagick++5': '8:6.7.7.10',
50 'libxml++2.6-2': '2.34.2',
51 'libgtk2.0-0': '2.24.13',
52 'libxmlsec1': '1.2.18-2',
53 'libxmlsec1-openssl': '1.2.18-2',
54 'libboost-date-time1.49.0': '1.49.0',
55 'libcurl3': '7.29.0-1ubuntu3',
56 'libzip2': '0.10.1-1.1'}
58 deb_depends['13.10'] = {'libc6': '2.17-93',
60 'libboost-filesystem1.53.0': '1.53.0',
61 'libboost-thread1.53.0': '1.53.0',
62 'libsndfile1': '1.0.25',
63 'libmagick++5': '8:6.7.7.10',
64 'libxml++2.6-2': '2.36.0',
65 'libgtk2.0-0': '2.24.20',
66 'libxmlsec1': '1.2.18-2',
67 'libxmlsec1-openssl': '1.2.18-2',
68 'libboost-date-time1.49.0': '1.49.0',
69 'libcurl3': '7.29.0-1ubuntu3',
70 'libzip2': '0.10.1-1.1'}
72 deb_depends['14.04'] = {'libc6': '2.19-0ubuntu6',
73 'libssh-4': '0.6.1-0ubuntu3',
74 'libboost-filesystem1.54.0': '1.54.0-4ubuntu3',
75 'libboost-thread1.54.0': '1.54.0-4ubuntu3',
76 'libsndfile1': '1.0.25-7ubuntu2',
77 'libmagick++5': '8:6.7.7.10-6ubuntu3',
78 'libxml++2.6-2': '2.36.0-2ubuntu1',
79 'libgtk2.0-0': '2.24.23-0ubuntu1',
80 'libxmlsec1': '1.2.18-2ubuntu1',
81 'libxmlsec1-openssl': '1.2.18-2ubuntu1',
82 'libboost-date-time1.54.0': '1.54.0-4ubuntu3',
83 'libcurl3': '7.35.0-1ubuntu2',
84 'libzip2': '0.10.1-1.2'}
86 deb_depends['7'] = {'libc6': '2.13',
88 'libboost-filesystem1.49.0': '1.49.0',
89 'libboost-thread1.49.0': '1.49.0',
90 'libsndfile1': '1.0.25',
91 'libmagick++5': '8:6.7.7.10',
92 'libxml++2.6-2': '2.34.2',
93 'libgtk2.0-0': '2.24.10',
94 'libxmlsec1': '1.2.18',
95 'libboost-date-time1.49.0': '1.49.0',
96 'libxmlsec1-openssl': '1.2.18',
100 deb_depends['unstable'] = {'libc6': '2.13',
102 'libboost-filesystem1.55.0': '1.55.0',
103 'libboost-thread1.55.0': '1.55.0',
104 'libsndfile1': '1.0.25',
105 'libmagick++5': '8:6.7.7.10',
106 'libxml++2.6-2': '2.34.2',
107 'libgtk2.0-0': '2.24.10',
108 'libxmlsec1': '1.2.18',
109 'libboost-date-time1.55.0': '1.55.0',
110 'libxmlsec1-openssl': '1.2.18',
111 'libcurl3': '7.26.0',
115 def packages(name, packages, f):
121 def make_control(debian_version, bits, filename, debug):
122 f = open(filename, 'w')
123 print >>f,'Source: dcpomatic'
124 print >>f,'Section: video'
125 print >>f,'Priority: extra'
126 print >>f,'Maintainer: Carl Hetherington <carl@dcpomatic.com>'
127 packages('Build-Depends', deb_build_depends, f)
128 print >>f,'Standards-Version: 3.9.3'
129 print >>f,'Homepage: http://dcpomatic.com/'
131 print >>f,'Package: dcpomatic'
133 print >>f,'Architecture: i386'
135 print >>f,'Architecture: amd64'
137 packages('Depends', deb_depends[debian_version], f)
139 print >>f,'Description: Generator of Digital Cinema Packages (DCPs)'
140 print >>f,' DCP-o-matic generates Digital Cinema Packages (DCPs) from video and audio'
141 print >>f,' files (such as those from DVDs or Blu-Rays) for presentation on DCI-compliant'
142 print >>f,' digital projectors.'
146 print >>f,'Package: dcpomatic-dbg'
148 print >>f,'Architecture: i386'
150 print >>f,'Architecture: amd64'
151 print >>f,'Section: debug'
152 print >>f,'Priority: extra'
153 packages('Depends', deb_depends[debian_version], f)
154 print >>f,'Description: debugging symbols for dcpomatic'
155 print >>f,' This package contains the debugging symbols for dcpomatic.'
158 def dependencies(target):
159 return (('ffmpeg-cdist', '2dffa11'),
163 def build(target, options):
164 cmd = './waf configure --prefix=%s' % target.directory
165 if target.platform == 'windows':
166 cmd += ' --target-windows'
167 elif target.platform == 'linux':
168 if target.distro == 'debian' or target.distro == 'ubuntu':
169 cmd += ' --target-debian'
170 if target.version == 'unstable':
171 cmd += ' --debian-unstable'
172 elif target.distro == 'centos':
173 if target.version == '6.5':
174 cmd += ' --target-centos-6 --disable-tests'
175 elif target.version == '7':
176 cmd += ' --target-centos-7'
179 target.command('./waf')
181 if target.platform == 'linux' or target.platform == 'osx':
182 target.command('./waf install')
184 def package_windows(target):
185 shutil.copyfile('build/platform/windows/installer.%s.nsi' % target.bits, 'build/platform/windows/installer2.%s.nsi' % target.bits)
186 target.command('sed -i "s~%%resources%%~%s/platform/windows~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits))
187 target.command('sed -i "s~%%static_deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.windows_prefix, target.bits))
188 target.command('sed -i "s~%%cdist_deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.directory, target.bits))
189 target.command('sed -i "s~%%binaries%%~%s/build~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits))
190 target.command('sed -i "s~%%bits%%~32~g" build/platform/windows/installer2.%s.nsi' % target.bits)
191 target.command('makensis build/platform/windows/installer2.%s.nsi' % target.bits)
192 return os.path.abspath(glob.glob('build/platform/windows/*%s*.exe' % target.bits)[0])
194 def package_debian(target, cpu, version):
195 make_control(target.version, target.bits, 'debian/control', target.debug)
196 target.command('./waf dist')
197 f = open('debian/files', 'w')
198 print >>f,'dcpomatic_%s-1_%s.deb video extra' % (version, cpu)
199 shutil.rmtree('build/deb', ignore_errors=True)
201 os.makedirs('build/deb')
202 os.chdir('build/deb')
203 shutil.move('../../dcpomatic-%s.tar.bz2' % version, 'dcpomatic_%s.orig.tar.bz2' % version)
204 target.command('tar xjf dcpomatic_%s.orig.tar.bz2' % version)
205 os.chdir('dcpomatic-%s' % version)
206 target.command('dch -b -v %s-1 "New upstream release."' % version)
207 target.set('CDIST_LINKFLAGS', target.get('LINKFLAGS'))
208 target.set('CDIST_CXXFLAGS', target.get('CXXFLAGS'))
209 target.set('CDIST_PKG_CONFIG_PATH', target.get('PKG_CONFIG_PATH'))
210 if target.version == 'unstable':
211 target.set('CDIST_EXTRA_CONFIGURE', '--debian-unstable')
212 target.command('dpkg-buildpackage -uc -us')
215 for p in glob.glob('../*.deb'):
216 debs.append(os.path.abspath(p))
220 def package_centos(target, cpu, version):
221 topdir = os.path.realpath('build/rpmbuild')
222 os.makedirs('%s/BUILD' % topdir)
223 os.makedirs('%s/RPMS' % topdir)
224 os.makedirs('%s/SOURCES' % topdir)
225 os.makedirs('%s/SPECS' % topdir)
226 os.makedirs('%s/SRPMS' % topdir)
228 target.command('./waf dist')
230 "%s/src/dcpomatic/dcpomatic-%s.tar.bz2" % (target.directory, version),
231 "%s/SOURCES/dcpomatic-%s.tar.bz2" % (topdir, version)
234 target.command('rpmbuild --define \'_topdir %s\' -bb build/platform/linux/dcpomatic2.spec' % topdir)
240 for p in glob.glob('%s/RPMS/%s/*.rpm' % (topdir, cpu)):
241 rpms.append(os.path.abspath(p))
245 def package(target, version):
246 if target.platform == 'windows':
247 return package_windows(target)
248 elif target.platform == 'linux':
249 if target.bits == 32:
254 if target.distro == 'debian' or target.distro == 'ubuntu':
255 return package_debian(target, cpu, version)
256 elif target.distro == 'centos':
257 return package_centos(target, cpu, version)
258 elif target.platform == 'osx':
259 target.command('bash platform/osx/make_dmg.sh %s' % target.directory)
260 return os.path.abspath(glob.glob('build/platform/osx/DCP-o-matic*.dmg')[0])
262 def make_pot(target):
263 target.command('./waf pot')
264 return [os.path.abspath('build/src/lib/libdcpomatic.pot'),
265 os.path.abspath('build/src/wx/libdcpomatic-wx.pot'),
266 os.path.abspath('build/src/tools/dcpomatic.pot')]
268 def make_manual(target):
269 os.chdir('doc/manual')
270 target.command('make')
271 target.command('pdflatex colour.tex')
272 return [os.path.abspath('pdf'), os.path.abspath('html'), os.path.abspath('colour.pdf')]
275 if target.platform != 'windows':
276 target.set('LC_ALL', 'C')
277 target.command('run/tests')