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.49.0': '1.49.0',
103 'libboost-thread1.49.0': '1.49.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.49.0': '1.49.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', '67dc770'),
160 ('libdcp', 'v0.95.0'))
162 def build(target, options):
163 cmd = './waf configure --prefix=%s' % target.work_dir_cscript()
164 if target.platform == 'windows':
165 cmd += ' --target-windows'
166 elif target.platform == 'linux':
167 if target.distro == 'debian' or target.distro == 'ubuntu':
168 cmd += ' --target-debian'
169 elif target.distro == 'centos':
170 cmd += ' --target-centos'
173 target.command('./waf')
175 if target.platform == 'linux' or target.platform == 'osx':
176 target.command('./waf install')
178 def package_windows(target):
179 shutil.copyfile('build/platform/windows/installer.%s.nsi' % target.bits, 'build/platform/windows/installer2.%s.nsi' % target.bits)
180 target.command('sed -i "s~%%resources%%~%s/platform/windows~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits))
181 target.command('sed -i "s~%%static_deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.windows_prefix, target.bits))
182 target.command('sed -i "s~%%cdist_deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.work_dir_cscript(), target.bits))
183 target.command('sed -i "s~%%binaries%%~%s/build~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits))
184 target.command('sed -i "s~%%bits%%~32~g" build/platform/windows/installer2.%s.nsi' % target.bits)
185 target.command('makensis build/platform/windows/installer2.%s.nsi' % target.bits)
186 return os.path.abspath(glob.glob('build/platform/windows/*%s*.exe' % target.bits)[0])
188 def package_debian(target, cpu, version):
189 make_control(target.version, target.bits, 'debian/control', target.debug)
190 target.command('./waf dist')
191 f = open('debian/files', 'w')
192 print >>f,'dcpomatic_%s-1_%s.deb video extra' % (version, cpu)
193 shutil.rmtree('build/deb', ignore_errors=True)
195 os.makedirs('build/deb')
196 os.chdir('build/deb')
197 shutil.move('../../dcpomatic-%s.tar.bz2' % version, 'dcpomatic_%s.orig.tar.bz2' % version)
198 target.command('tar xjf dcpomatic_%s.orig.tar.bz2' % version)
199 os.chdir('dcpomatic-%s' % version)
200 target.command('dch -b -v %s-1 "New upstream release."' % version)
201 target.set('CDIST_LINKFLAGS', target.get('LINKFLAGS'))
202 target.set('CDIST_CXXFLAGS', target.get('CXXFLAGS'))
203 target.set('CDIST_PKG_CONFIG_PATH', target.get('PKG_CONFIG_PATH'))
204 target.command('dpkg-buildpackage')
207 for p in glob.glob('../*.deb'):
208 debs.append(os.path.abspath(p))
212 def package_centos(target, cpu, version):
213 os.makedirs('%s/rpmbuild/BUILD' % target.work_dir_cdist())
214 os.makedirs('%s/rpmbuild/RPMS' % target.work_dir_cdist())
215 os.makedirs('%s/rpmbuild/SOURCES' % target.work_dir_cdist())
216 os.makedirs('%s/rpmbuild/SPECS' % target.work_dir_cdist())
217 os.makedirs('%s/rpmbuild/SRPMS' % target.work_dir_cdist())
219 f = open('%s/.rpmmacros' % target.dir_in_chroot, 'w')
220 print >>f,"%%_topdir %srpmbuild" % target.dir_in_chroot
223 target.command('./waf dist')
225 "%s/src/dcpomatic/dcpomatic-%s.tar.bz2" % (target.work_dir_cdist(), version),
226 "%s/rpmbuild/SOURCES/dcpomatic-%s.tar.bz2" % (target.work_dir_cdist(), version)
229 target.command('rpmbuild -bb build/platform/linux/dcpomatic.spec')
235 for p in glob.glob('%s/rpmbuild/RPMS/%s/*.rpm' % (target.work_dir_cdist(), cpu)):
236 rpms.append(os.path.abspath(p))
240 def package(target, version):
241 if target.platform == 'windows':
242 return package_windows(target)
243 elif target.platform == 'linux':
244 if target.bits == 32:
249 if target.distro == 'debian' or target.distro == 'ubuntu':
250 return package_debian(target, cpu, version)
251 elif target.distro == 'centos':
252 return package_centos(target, cpu, version)
253 elif target.platform == 'osx':
254 target.command('bash platform/osx/make_dmg.sh %s' % target.work_dir_cscript())
255 return os.path.abspath(glob.glob('build/platform/osx/DCP-o-matic*.dmg')[0])
257 def make_pot(target):
258 target.command('./waf pot')
259 return [os.path.abspath('build/src/lib/libdcpomatic.pot'),
260 os.path.abspath('build/src/wx/libdcpomatic-wx.pot'),
261 os.path.abspath('build/src/tools/dcpomatic.pot')]
263 def make_manual(target):
264 os.chdir('doc/manual')
265 target.command('make')
266 target.command('pdflatex colour.tex')
267 return [os.path.abspath('pdf'), os.path.abspath('html'), os.path.abspath('colour.pdf')]
270 if target.platform != 'windows':
271 target.set('LC_ALL', 'C')
272 target.command('run/tests')