##// END OF EJS Templates
packaging: split Inno installer building from Mercurial building...
Gregory Szorc -
r45255:5760936e default draft
parent child Browse files
Show More
@@ -61,8 +61,7 b' def build('
61
61
62 vc_x64 = r'\x64' in os.environ.get('LIB', '')
62 vc_x64 = r'\x64' in os.environ.get('LIB', '')
63 arch = 'x64' if vc_x64 else 'x86'
63 arch = 'x64' if vc_x64 else 'x86'
64 inno_source_dir = source_dir / 'contrib' / 'packaging' / 'inno'
64 inno_build_dir = build_dir / ('inno-py2exe-%s' % arch)
65 inno_build_dir = build_dir / ('inno-%s' % arch)
66 staging_dir = inno_build_dir / 'stage'
65 staging_dir = inno_build_dir / 'stage'
67
66
68 requirements_txt = (
67 requirements_txt = (
@@ -104,6 +103,31 b' def build('
104 print('copying %s to %s' % (f, dest_path))
103 print('copying %s to %s' % (f, dest_path))
105 shutil.copyfile(f, dest_path)
104 shutil.copyfile(f, dest_path)
106
105
106 build_installer(
107 source_dir,
108 inno_build_dir,
109 staging_dir,
110 iscc_exe,
111 version,
112 arch="x64" if vc_x64 else None,
113 )
114
115
116 def build_installer(
117 source_dir: pathlib.Path,
118 inno_build_dir: pathlib.Path,
119 staging_dir: pathlib.Path,
120 iscc_exe: pathlib.Path,
121 version,
122 arch=None,
123 ):
124 """Build an Inno installer from staged Mercurial files.
125
126 This function is agnostic about how to build Mercurial. It just
127 cares that Mercurial files are in ``staging_dir``.
128 """
129 inno_source_dir = source_dir / "contrib" / "packaging" / "inno"
130
107 # The final package layout is simply a mirror of the staging directory.
131 # The final package layout is simply a mirror of the staging directory.
108 package_files = []
132 package_files = []
109 for root, dirs, files in os.walk(staging_dir):
133 for root, dirs, files in os.walk(staging_dir):
@@ -158,8 +182,8 b' def build('
158
182
159 args = [str(iscc_exe)]
183 args = [str(iscc_exe)]
160
184
161 if vc_x64:
185 if arch:
162 args.append('/dARCH=x64')
186 args.append('/dARCH=%s' % arch)
163
187
164 if not version:
188 if not version:
165 version = read_version_py(source_dir)
189 version = read_version_py(source_dir)
General Comments 0
You need to be logged in to leave comments. Login now