target.command('./waf install')
def package_windows(target):
- shutil.copyfile('build/platform/windows/installer.%s.nsi' % target.bits, 'build/platform/windows/installer2.%s.nsi' % target.bits)
- target.command('sed -i "s~%%resources%%~%s/platform/windows~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits))
- target.command('sed -i "s~%%graphics%%~%s/graphics~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits))
- target.command('sed -i "s~%%static_deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.windows_prefix, target.bits))
- target.command('sed -i "s~%%cdist_deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.directory, target.bits))
- target.command('sed -i "s~%%mingw%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.mingw_path, target.bits))
- target.command('sed -i "s~%%binaries%%~%s/build~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), target.bits))
- target.command('sed -i "s~%%bits%%~32~g" build/platform/windows/installer2.%s.nsi' % target.bits)
- target.command('makensis build/platform/windows/installer2.%s.nsi' % target.bits)
+ identifier = ''
+ if target.version is not None:
+ identifier = '%s.' % target.version
+ identifier += '%d' % target.bits
+ shutil.copyfile('build/platform/windows/installer.%s.nsi' % identifier, 'build/platform/windows/installer2.%s.nsi' % identifier)
+ target.command('sed -i "s~%%resources%%~%s/platform/windows~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), identifier))
+ target.command('sed -i "s~%%graphics%%~%s/graphics~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), identifier))
+ target.command('sed -i "s~%%static_deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.windows_prefix, identifier))
+ target.command('sed -i "s~%%cdist_deps%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.directory, identifier))
+ target.command('sed -i "s~%%mingw%%~%s~g" build/platform/windows/installer2.%s.nsi' % (target.mingw_path, identifier))
+ target.command('sed -i "s~%%binaries%%~%s/build~g" build/platform/windows/installer2.%s.nsi' % (os.getcwd(), identifier))
+ target.command('sed -i "s~%%bits%%~32~g" build/platform/windows/installer2.%s.nsi' % identifier)
+ target.command('makensis build/platform/windows/installer2.%s.nsi' % identifier)
return os.path.abspath(glob.glob('build/platform/windows/*%s*.exe' % target.bits)[0])
def package_debian(target, cpu, version):
from __future__ import print_function
import os
-def write_installer(bits, version, debug):
+def write_installer(bits, windows_version, dcpomatic_version, debug):
try:
os.makedirs('build/platform/windows')
except:
pass
- f = open('build/platform/windows/installer.%d.nsi' % bits, 'w')
+ filename = 'build/platform/windows/installer.'
+ if windows_version is not None:
+ filename += 'xp.'
+ filename += '%d.nsi' % bits
+
+ f = open(filename, 'w')
print('!include "MUI2.nsh"', file=f)
if bits == 64:
print('!include "x64.nsh"', file=f)
print('RequestExecutionLevel admin', file=f)
+ outfile = 'DCP-o-matic '
if debug:
- print('outFile "DCP-o-matic Debug %s %d-bit Installer.exe"' % (version, bits), file=f)
- else:
- print('outFile "DCP-o-matic %s %d-bit Installer.exe"' % (version, bits), file=f)
+ outfile += 'Debug '
+ outfile += '%s %d-bit ' % (dcpomatic_version, bits)
+ if windows_version is 'xp':
+ outfile += 'XP '
+ outfile += 'Installer.exe'
+
+ print('outFile "%s"' % outfile, file=f)
print("""
!define MUI_ICON "%graphics%/dcpomatic2.ico"
File "%cdist_deps%/bin/postproc-54.dll"
File "%cdist_deps%/bin/swresample-2.dll"
File "%cdist_deps%/bin/dcp-1.0.dll"
-File "%cdist_deps%/bin/libopenjp2.dll"
File "%cdist_deps%/bin/swscale-4.dll"
File "%cdist_deps%/bin/cxml-0.dll"
File "%cdist_deps%/bin/sub-1.0.dll"
File "%cdist_deps%/bin/ffprobe.exe"
""", file=f)
+ if windows_version == 'xp':
+ print('File "%cdist_deps%/bin/libopenjpeg-1.dll"', file=f)
+ else:
+ print('File "%cdist_deps%/bin/libopenjp2.dll"', file=f)
+
if debug:
print('File "%resources%/gdb_script"', file=f)
print('File "%resources%/debug.bat"', file=f)
def build(bld):
- write_installer(32, bld.env.VERSION, bld.env.DEBUG)
- write_installer(64, bld.env.VERSION, bld.env.DEBUG)
+ write_installer(32, None, bld.env.VERSION, bld.env.DEBUG)
+ write_installer(64, None, bld.env.VERSION, bld.env.DEBUG)
+ write_installer(32, 'xp', bld.env.VERSION, bld.env.DEBUG)
+ write_installer(64, 'xp', bld.env.VERSION, bld.env.DEBUG)