Alien-SVN
view release on metacpan or search on metacpan
src/subversion/build/generator/gen_win.py view on Meta::CPAN
buf = buf.replace("@DBBINDLL@", self.dbbindll)
svnissrel = os.path.join("packages","win32-innosetup","svn.iss.release")
svnissdeb = os.path.join("packages","win32-innosetup","svn.iss.debug")
if self.write_file_if_changed(svnissrel, buf.replace("@CONFIG@", "Release")):
print('Wrote %s' % svnissrel)
if self.write_file_if_changed(svnissdeb, buf.replace("@CONFIG@", "Debug")):
print('Wrote %s' % svnissdeb)
#Make the project files directory if it doesn't exist
#TODO win32 might not be the best path as win64 stuff will go here too
self.projfilesdir=os.path.join("build","win32",subdir)
self.rootpath = self.find_rootpath()
if not os.path.exists(self.projfilesdir):
os.makedirs(self.projfilesdir)
# Generate the build_zlib.bat file
if self.zlib_path:
data = {'zlib_path': os.path.relpath(self.zlib_path, self.projfilesdir),
'zlib_version': self.zlib_version,
'use_ml': self.have_ml and 1 or None}
bat = os.path.join(self.projfilesdir, 'build_zlib.bat')
self.write_with_template(bat, 'templates/build_zlib.ezt', data)
# Generate the build_locale.bat file
pofiles = []
if self.enable_nls:
for po in os.listdir(os.path.join('subversion', 'po')):
if fnmatch.fnmatch(po, '*.po'):
pofiles.append(POFile(po[:-3]))
data = {'pofiles': pofiles}
self.write_with_template(os.path.join(self.projfilesdir,
'build_locale.bat'),
'templates/build_locale.ezt', data)
#Here we can add additional platforms to compile for
self.platforms = ['Win32']
# VC 2002 and VC 2003 only allow a single platform per project file
if subdir == 'vcnet-vcproj':
if self.vcproj_version != '7.00' and self.vcproj_version != '7.10':
self.platforms = ['Win32','x64']
#Here we can add additional modes to compile for
self.configs = ['Debug','Release']
if self.swig_libdir:
# Generate SWIG header wrappers and external runtime
for swig in (generator.swig.header_wrappers,
generator.swig.checkout_swig_header,
generator.swig.external_runtime):
swig.Generator(self.conf, self.swig_exe).write()
else:
print("%s not found; skipping SWIG file generation..." % self.swig_exe)
def find_rootpath(self):
"Gets the root path as understand by the project system"
return os.path.relpath('.', self.projfilesdir) + "\\"
def makeguid(self, data):
"Generate a windows style GUID"
### blah. this function can generate invalid GUIDs. leave it for now,
### but we need to fix it. we can wrap the apr UUID functions, or
### implement this from scratch using the algorithms described in
### http://www.webdav.org/specs/draft-leach-uuids-guids-01.txt
myhash = hashlib_md5(data).hexdigest()
guid = ("{%s-%s-%s-%s-%s}" % (myhash[0:8], myhash[8:12],
myhash[12:16], myhash[16:20],
myhash[20:32])).upper()
return guid
def path(self, *paths):
"""Convert build path to msvc path and prepend root"""
return self.rootpath + msvc_path_join(*list(map(msvc_path, paths)))
def apath(self, path, *paths):
"""Convert build path to msvc path and prepend root if not absolute"""
### On Unix, os.path.isabs won't do the right thing if "item"
### contains backslashes or drive letters
if os.path.isabs(path):
return msvc_path_join(msvc_path(path), *list(map(msvc_path, paths)))
else:
return self.rootpath + msvc_path_join(msvc_path(path),
*list(map(msvc_path, paths)))
def get_install_targets(self):
"Generate the list of targets"
# Get list of targets to generate project files for
install_targets = self.graph.get_all_sources(gen_base.DT_INSTALL) \
+ self.projects
# Don't create projects for scripts
install_targets = [x for x in install_targets if not isinstance(x, gen_base.TargetScript)]
# Drop the libsvn_fs_base target and tests if we don't have BDB
if not self.bdb_lib:
install_targets = [x for x in install_targets if x.name != 'libsvn_fs_base']
install_targets = [x for x in install_targets if not (isinstance(x, gen_base.TargetExe)
and x.install == 'bdb-test')]
# Don't build serf when we don't have it or for 1.3+
if not self.serf_lib or (self.serf_ver_maj, self.serf_ver_min) >= (1, 3):
install_targets = [x for x in install_targets if x.name != 'serf']
# Drop the serf target if we don't have both serf and openssl
if not self.serf_lib:
install_targets = [x for x in install_targets if x.name != 'libsvn_ra_serf']
# Don't build zlib if we have an already compiled serf
if self.serf_lib and (self.serf_ver_maj, self.serf_ver_min) >= (1, 3):
install_targets = [x for x in install_targets if x.name != 'zlib']
# Drop the swig targets if we don't have swig
if not self.swig_path and not self.swig_libdir:
install_targets = [x for x in install_targets
if not (isinstance(x, gen_base.TargetSWIG)
or isinstance(x, gen_base.TargetSWIGLib)
or isinstance(x, gen_base.TargetSWIGProject))]
( run in 0.560 second using v1.01-cache-2.11-cpan-39bf76dae61 )