linuxdcpp-team team mailing list archive
-
linuxdcpp-team team
-
Mailing list archive
-
Message #06786
[Branch ~dcplusplus-team/dcplusplus/trunk] Rev 3266: Distribute an x64 version
------------------------------------------------------------
revno: 3266
committer: poy <poy@xxxxxxxxxx>
branch nick: trunk
timestamp: Thu 2013-04-18 21:46:26 +0200
message:
Distribute an x64 version
modified:
build_util.py
changelog.txt
installer/DCPlusPlus.nsi
installer/SConscript
win32/SConscript
--
lp:dcplusplus
https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk
Your team Dcplusplus-team is subscribed to branch lp:dcplusplus.
To unsubscribe from this branch go to https://code.launchpad.net/~dcplusplus-team/dcplusplus/trunk/+edit-subscription
=== modified file 'build_util.py'
--- build_util.py 2013-01-31 19:24:01 +0000
+++ build_util.py 2013-04-18 19:46:26 +0000
@@ -281,12 +281,6 @@
if to_remove in array:
array.remove(to_remove)
-class scoped_cmd:
- def __init__(self, cmd):
- self.cmd = cmd
- def __del__(self):
- self.cmd()
-
def get_lcid(lang):
from locale import windows_locale
=== modified file 'changelog.txt'
--- changelog.txt 2013-04-16 16:11:50 +0000
+++ changelog.txt 2013-04-18 19:46:26 +0000
@@ -7,6 +7,7 @@
* Display HTTP downloads in the transfer list (poy)
* [L#190964] Handle more connection errors (poy)
* Support city-level GeoIP databases - new params such as %[city] (poy)
+* Distribute an x64 version
-- 0.811 2013-03-04 --
* Fix status bar parts when the window is too small (poy)
=== modified file 'installer/DCPlusPlus.nsi'
Binary files installer/DCPlusPlus.nsi 2011-12-29 13:31:38 +0000 and installer/DCPlusPlus.nsi 2013-04-18 19:46:26 +0000 differ
=== modified file 'installer/SConscript'
--- installer/SConscript 2012-10-21 13:56:27 +0000
+++ installer/SConscript 2013-04-18 19:46:26 +0000
@@ -21,8 +21,6 @@
raise Exception('makensis.exe not found in PATH - Unicode NSIS is required to build the distro')
if env.WhereIs('bzr') is None:
raise Exception('"bzr" is required to build the distro; this tree must be under bzr version control')
- if env.WhereIs(env['strip']) is None:
- raise Exception('"' + env['strip'] + '" is required to build the distro; it should be part of MinGW / binutils')
if env.WhereIs('zip') is None:
raise Exception('"zip" is required to build the distro; get the one from MSYS or Cygwin')
@@ -46,7 +44,7 @@
if nsis is None:
Return()
-from build_util import get_po_name, scoped_cmd
+from build_util import get_po_name
import bzrlib
import codecs
import os.path
@@ -54,16 +52,24 @@
# gather the files necessary to create the installer
sources = Glob('*.*')
+x64_rename = []
reg = re.compile('^\W*File.+"([^"]+)"')
f = codecs.open('DCPlusPlus.nsi', 'rb', 'utf_16_le')
for line in f:
match = reg.search(line)
if match:
match = match.group(1)
+ if match[:14] == 'DCPlusPlus.exe':
+ match = 'DCPlusPlus-stripped.exe' + match[14:]
if env.FindFile(match, '#'):
+ # copy from the root dir
match = '#/' + match
+ elif match[-4:] == '-x64':
+ # copy from the x64 build dir
+ match = dev.get_build_root()[:-1] + '-x64/bin/' + match[:-4]
+ x64_rename.append(env.File(match).abspath)
else:
- # file not found in the root; must be a built file
+ # copy from the build dir
match = dev.get_build_path('bin') + '/' + match
sources.append(match)
f.close()
@@ -76,7 +82,6 @@
build_dir = 'build/installer'
build_path = build_dir + '/'
env.Execute([Delete(build_dir), Mkdir(build_dir)])
- dir_cleaner = scoped_cmd(lambda: env.Execute(Delete(build_dir)))
# the file, included by the installer, that lists all available translations
f_i18n = codecs.open(build_path + 'i18n.nsh', 'wb', 'utf_16_le')
@@ -86,10 +91,7 @@
for node in source:
name = os.path.basename(node.path)
- if name == 'DCPlusPlus.exe':
- env.Execute(env['strip'] + ' "' + nixify(node.path) + '" -o "' + build_path + name + '"')
-
- elif name[-3:] == '.po' or name[-4:] == '.pot':
+ if name[-3:] == '.po' or name[-4:] == '.pot':
# find the corresponding name among the NSIS language files
name = get_po_name(node)
if name is None:
@@ -121,25 +123,36 @@
env.Execute(Delete(xml_file))
else:
- env.Execute(Copy(build_path + name, node))
+ suffix = ''
+ if node.abspath in x64_rename:
+ suffix = '-x64'
+
+ if name == 'DCPlusPlus-stripped.exe':
+ name = 'DCPlusPlus.exe'
+
+ env.Execute(Copy(build_path + name + suffix, node))
f_i18n.close()
# create the installer
- ret = env.Execute('makensis ' + build_path + 'DCPlusPlus.nsi')
+ ret = env.Execute('makensis ' + build_path + 'DCPlusPlus.nsi > ' + build_path + 'makensis.log')
if ret:
return ret
env.Execute(Move(target[0], build_path + os.path.basename(target[0].path)))
- # make the zip binary archive
- env.Execute('cd "' + build_dir + '" && zip -9 -r "' + nixify(str(target[1].abspath)) + '" . -x "dcppboot.nonlocal.xml" -x "\\*.ico" -x "\\*.nsh" -x "\\*.nsi" && cd "' + env.Dir('#').abspath + '"')
+ # make the zip binary archives
+ zip_cmd = lambda path: env.Execute('cd "' + build_dir + '" && zip -9 -r "' + nixify(path) + '" . -x "\\*-x64" -x "dcppboot.nonlocal.xml" -x "\\*.ico" -x "\\*.log" -x "\\*.nsh" -x "\\*.nsi" > zip.log && cd "' + env.Dir('#').abspath + '"')
+ zip_cmd(target[1].abspath)
+ env.Execute(Move(build_path + 'DCPlusPlus.exe', build_path + 'DCPlusPlus.exe-x64'))
+ env.Execute(Move(build_path + 'DCPlusPlus.pdb', build_path + 'DCPlusPlus.pdb-x64'))
+ zip_cmd(target[2].abspath)
# use "bzr export" to zip the source
- env.Execute('bzr export "' + nixify(str(target[2])) + '"')
+ env.Execute('bzr export "' + nixify(str(target[3])) + '"')
return ret
distro_path = '#/build/distro/'
-ret = env.Command([distro_path + 'DCPlusPlus-xxx.exe', distro_path + 'DCPlusPlus-xxx.zip', distro_path + 'DCPlusPlus-xxx-src.zip'], sources, Action(gen_installer, 'Creating final distro packages ($TARGETS)'))
+ret = env.Command([distro_path + 'DCPlusPlus-xxx.exe', distro_path + 'DCPlusPlus-xxx.zip', distro_path + 'DCPlusPlus-xxx-x64.zip', distro_path + 'DCPlusPlus-xxx-src.zip'], sources, Action(gen_installer, 'Creating final distro packages ($TARGETS)'))
Return('ret')
=== modified file 'win32/SConscript'
--- win32/SConscript 2012-03-03 15:04:23 +0000
+++ win32/SConscript 2013-04-18 19:46:26 +0000
@@ -53,5 +53,6 @@
if 'gcc' in env['TOOLS']:
# strip debug info to a separate PDB file
env.Command(target + '.pdb', target + '.exe', Action(env['strip'] + ' --only-keep-debug "$SOURCE" -o "$TARGET"', 'Extracting debugging symbols to $TARGET'))
+ env.Command(target + '-stripped.exe', target + '.exe', Action(env['strip'] + ' "$SOURCE" -o "$TARGET"', 'Creating $TARGET'))
Return('ret')