#if config.get('prefer_binary_dependencies', False): if False: # the python installer registers in windows and prevent further installations. This means this installation # would interfere with the rest of the system filename = "python-{0}{1}.msi".format( python_version, ".amd64" if config['architecture'] == "x86_64" else "") python = Project("Python") \ .depend(build.Run("msiexec /i {0} TARGETDIR={1} /qn ADDLOCAL=DefaultFeature,SharedCRT" .format(os.path.join(config['paths']['download'], filename), os.path.join(config['paths']['build'], "python-{}".format(python_version)) ) ) .depend(urldownload.URLDownload("{0}/{1}/{2}" .format(python_url, python_version, filename ) ) ) ) else: def install(context): path_segments = [context['build_path'], "PCbuild"] if config['architecture'] == "x86_64": path_segments.append("amd64") path_segments.append("*.lib") for f in glob(os.path.join(*path_segments)): shutil.copy(
# if config.get('prefer_binary_dependencies', False): if False: # the python installer registers in windows and prevent further installations. This means this installation # would interfere with the rest of the system filename = "python-{0}{1}.msi".format( python_version, ".amd64" if config['architecture'] == "x86_64" else "") python = Project("Python") \ .depend(build.Run("msiexec /i {0} TARGETDIR={1} /qn ADDLOCAL=DefaultFeature,SharedCRT" .format(os.path.join(config['paths']['download'], filename), os.path.join(config['paths']['build'], "python-{}".format(python_version)) ) ) .depend(urldownload.URLDownload("{0}/{1}/{2}" .format(python_url, python_version, filename ) ) ) ) else: def install(context): make_sure_path_exists(os.path.join(config["paths"]["install"], "libs")) path_segments = [context['build_path'], "PCbuild"] if config['architecture'] == "x86_64": path_segments.append("amd64") path_segments.append("*.lib") shutil.copy(
if config['architecture'] == "x86_64": path_segments.append("amd64") for f in glob(os.path.join(*path_segments,"*.lib")): shutil.copy(f, os.path.join(path_install, "libs")) for f in glob(os.path.join(*path_segments,"*.dll")): shutil.copy(f, os.path.join(path_install, "bin")) shutil.copy(os.path.join(path_install, "libs", "python{}.lib".format(python_version.replace(".", ""))), os.path.join(path_install, "libs", "python3.lib")) return True if config.get('Appveyor_Build', True): python = Project("Python") \ .depend(build.Execute(install) .depend(urldownload.URLDownload( config.get('prebuilt_url') + "python-prebuilt-{}.7z" .format(python_version + python_version_minor)). set_destination("python-{}".format(python_version + python_version_minor)))) else: python = Project("Python") \ .depend(build.Execute(install) .depend(build.Execute(python_prepare) .depend(msbuild.MSBuild("PCBuild/PCBuild.sln", "python,pyexpat", project_PlatformToolset=config['vc_platformtoolset']) .depend(build.Run(upgrade_args, name="upgrade python project") .depend(github.Source("python", "cpython", "v{}{}" .format(config['python_version'], config['python_version_minor']) , shallowclone=True) .set_destination("python-{}".format(python_version + python_version_minor)))))))
tl_repo = git.SuperRepository("modorganizer_super") # install compiled mo components """ doesn't build through msbuild but builds fine in IDE?? .depend(msbuild.MSBuild("../nmm/NexusClient.sln", "NexusClientCli", working_directory=lazy.Evaluate(lambda: os.path.join(ncc['build_path'], "..", "nmm"))) """ ncc = Project("NCC") \ .depend(build.Run(r"publish.bat" .format("-debug" if config['build_type'] == "Debug" else "-release", os.path.join(config['__build_base_path'], "install", "bin")), working_directory=lazy.Evaluate(lambda: ncc['build_path'])) .depend(msbuild.MSBuild("../nmm/NexusClient.sln", working_directory=lazy.Evaluate(lambda: os.path.join(ncc['build_path'], "..", "nmm"))) .depend(patch.Copy("NexusClient.sln", "../nmm") .depend(github.Source(config['Main_Author'], "modorganizer-NCC", "master") .set_destination(os.path.join("NCC", "NexusClientCli")) .depend(github.Source("Nexus-Mods", "Nexus-Mod-Manager", "master") .set_destination(os.path.join("NCC", "nmm")) ) ) ) ) ) Project("modorganizer-game_features") \ .depend(github.Source(config['Main_Author'], "modorganizer-game_features", "master", super_repository=tl_repo) .set_destination("game_features")) def gen_userfile_content(project):
reltarget="Release", project_AdditionalParams=[ "/p:bz2Dir={}".format(os.path.join(build_path, "bzip2")), "/p:zlibDir={}".format(os.path.join(build_path, "zlib-{}".format(config['zlib_version']))), "/p:opensslIncludeDir={}".format(os.path.join(build_path, "openssl-{}".format(openssl_version), "include")), "/p:opensslOutDir={}".format(os.path.join(build_path, "openssl-{}".format(openssl_version))), "/p:libffiIncludeDir={}".format(os.path.join(build_path, "libffi", bitness(), "include")), "/p:libffiOutDir={}".format(os.path.join(build_path, "libffi", bitness())), ] ) .depend(build.Execute(patch_openssl_props) .depend(build.Run(upgrade_args, name="upgrade python project") .depend(github.Source("python", "cpython", "v{}{}" .format(config['python_version'], config['python_version_minor']) , shallowclone=True) .set_destination("python-{}".format(python_version + python_version_minor)) .depend(sourceforge.Release("bzip2","bzip2-{0}.tar.gz" .format(bzip2_version), tree_depth=1) .set_destination("bzip2") ) ) ) ) .depend("openssl") .depend("libffi") ) ) ) )
if "NexusClientCli" not in sln.projectsByName: newproj = sln.AddProject('NexusClientCli', ProjectType.CSHARP_PROJECT, ncc_csproj, guid=projguid) log.info('Adding project %s (%s) to NexusClient.sln', newproj.name, newproj.guid) changed = True else: newproj = sln.projectsByName['NexusClientCli'] log.info('Project %s (%s) already exists in NexusClient.sln', newproj.name, newproj.guid) if newproj.projectfile != ncc_csproj: log.info('Changing projectfile: %s -> %s', newproj.projectfile, ncc_csproj) newproj.projectfile = ncc_csproj changed = True if changed: log.info('Writing NexusClientCli.sln') sln.SaveToFile(os.path.relpath(os.path.join(build_path, "Nexus-Mod-Manager", 'NexusClientCli.sln'))) # So we dont get conflicts when pulling return True # https://github.com/Nexus-Mods/Nexus-Mod-Manager/commit/03448e0eb02e08f37d7b66507d0537ab67841321 broke fomod installation # until this is fixed we lock NMM to the latest nexus release. Project("ncc") \ .depend(build.Run(r"publish.bat".format("-debug" if config['build_type'] == "Debug" else "-release", os.path.join(config["paths"]["install"], "bin")), working_directory=lazy.Evaluate(lambda: os.path.join(build_path, "NexusClientCli"))) .depend(msbuild.MSBuild(os.path.join(build_path, "Nexus-Mod-Manager", 'NexusClientCli.sln'), working_directory=lazy.Evaluate(lambda: os.path.join(build_path, "Nexus-Mod-Manager")), project_platform="Any CPU") .depend(build.Execute(prepare_nmm, name="append NexusClientCli project to NMM") .depend(github.Source("Nexus-Mods", "Nexus-Mod-Manager", "0.63.15", None, False)) .depend(github.Source(config['Main_Author'], "modorganizer-NCC", "master") .set_destination("NexusClientCli")))))
stdout=sout, stderr=serr) proc.communicate() if proc.returncode != 0: logging.error("failed to run %s (returncode %s), see %s and %s", self.__command(), proc.returncode, soutpath, serrpath) return False return True @staticmethod def _expiration(): return config.get('repo_update_frequency', 60 * 60 * 24) # default: one day init_transifex_repo = build.Run("{} init --force --no-interactive" .format(transifex_client_binary), name="init transifex repository", environment=transifex_environment()) def install_qt_translations(context): full_install_path = os.path.join(install_path, "bin", "translations") qt_qm_path = os.path.join(config["paths"]["qt_binary_install"], "translations") translated_ts_path = os.path.join(build_path, "transifex-translations", "translations", "mod-organizer.organizer") for ts_file in glob(os.path.join(translated_ts_path, "*.ts")): language_code = os.path.splitext(os.path.basename(ts_file))[0] qt_qm = "qt_" + language_code + ".qm" if os.path.isfile(os.path.join(qt_qm_path, qt_qm)): shutil.copy(os.path.join(qt_qm_path, qt_qm), os.path.join(full_install_path, qt_qm)) qtbase_qm = "qtbase_" + language_code + ".qm" if os.path.isfile(os.path.join(qt_qm_path, qtbase_qm)): shutil.copy(os.path.join(qt_qm_path, qtbase_qm), os.path.join(full_install_path, qtbase_qm))
os.path.join(final_path, "bin", "libssl-1_1{}.pdb".format(bitness_suffix()))): shutil.copy( f, os.path.join(dest_pdb, "libssl-1_1{}.pdb".format(bitness_suffix()))) for f in glob(os.path.join(final_path, "lib", "libcrypto.lib")): shutil.copy(f, os.path.join(dest_lib, "libcrypto.lib")) for f in glob(os.path.join(final_path, "lib", "libssl.lib")): shutil.copy(f, os.path.join(dest_lib, "libssl.lib")) return True OpenSSL_Install = build.Run( "{} /D /J {} install_engines".format(config["paths"]["jom"], cpus), environment=openssl_environment(), name="Build & Install OpenSSL", working_directory=lambda: os.path.join(openssl_path), retries=5) Configure_openssl = build.Run( r"{} Configure --openssldir={} --prefix={} -FS VC-WIN{}A".format( config['paths']['perl'], os.path.join(openssl_path, "build"), os.path.join(openssl_path, "build"), bitness()), environment=openssl_environment(), name="Configure OpenSSL", working_directory=lambda: os.path.join(openssl_path)) if config['Appveyor_Build']: openssl = Project("openssl") \ .depend(build.Execute(openssl_stage) .depend(urldownload.URLDownload(config.get('prebuilt_url') + "openssl-prebuilt-{}.7z"
icu_version = "54" icu_version_minor = "1" # installation happens concurrently in separate process. We need to wait for all relevant files to exist, # and can determine failure only by timeout timeout = 15 # seconds def icu_environment(): result = config['__environment'].copy() result['Path'] += ";" + os.path.join(config['paths']['build'], "cygwin", "bin") return result build_icu = build.Run(r"make && make install", environment=icu_environment(), working_directory=lambda: os.path.join(config["paths"]["build"], "icu", "source")) class ConfigureIcu(build.Builder): def __init__(self): super(ConfigureIcu, self).__init__() @property def name(self): return "icu configure" def process(self, progress): from distutils.spawn import find_executable res = find_executable("cygpath", os.path.join(config['paths']['build'], "cygwin", "bin")) if res is not None:
#sevenzip_version = "16.04" #Need to revert till Modorganizer-Archive is either redone or fixed sevenzip_version = "9.20" Project("7zip") \ .depend(Patch.Copy(os.path.join(config['paths']['build'], "7zip", "CPP", "7zip", "Bundles", "Format7zF", "{}" .format("x86" if config['architecture'] == 'x86' else "AMD64"), "7z.dll"), os.path.join(config["paths"]["install"], "bin", "dlls")) .depend(build.Run(r"nmake CPU={} NEW_COMPILER=1 MY_STATIC_LINK=1 NO_BUFFEROVERFLOWU=1".format( "x86" if config['architecture'] == 'x86' else "AMD64"), working_directory=os.path.join(config['paths']['build'], "7zip", "CPP", "7zip","Bundles", "Format7zF")) .depend(Patch.Replace("CPP/Build.mak", "-WX", "") .depend(Patch.Replace("CPP/7zip/Bundles/Format7zF/Format7z.dsp", "-WX", "") .depend(urldownload.URLDownload( "http://www.7-zip.org/a/7z{}.tar.bz2".format(sevenzip_version.replace(".", ""))) .set_destination("7zip")))))) #7zip Code for 16.04 # sevenzip is not built here as we only use its source #Project("7zip") \ # .depend(Patch.Copy(os.path.join(config['paths']['build'], "7zip", "CPP", "7zip", "Bundles", "Format7zF", "{}" # .format("x86" if config['architecture'] == 'x86' else "AMD64"), "7z.dll"), # os.path.join(config["paths"]["install"], "bin", "dlls")) # .depend(build.Run(r"nmake CPU={} NEW_COMPILER=1 MY_STATIC_LINK=1 NO_BUFFEROVERFLOWU=1".format( # "x86" if config['architecture'] == 'x86' else "AMD64"),
for f in glob( os.path.join(build_path, openssl_path, "out32dll", "libeay32.pdb")): shutil.copy(f, os.path.join(dest_pdb)) for f in glob(os.path.join(build_path, openssl_path, "lib", "ssleay32.lib")): shutil.copy(f, os.path.join(dest_lib, "ssleay32.lib")) for f in glob(os.path.join(build_path, openssl_path, "lib", "libeay32.lib")): shutil.copy(f, os.path.join(dest_lib, "libeay32.lib")) return True OpenSSL_Install = build.Run( r"nmake -f ms\ntdll.mak install", environment=openssl_environment(), name="Install OpenSSL", working_directory=lambda: os.path.join(openssl_path)) OpenSSL_Build = build.Run(r"nmake -f ms\ntdll.mak", environment=openssl_environment(), name="Building OpenSSL", working_directory=lambda: os.path.join(openssl_path)) OpenSSL_Prep = build.Run(r"ms\do_win64a", environment=openssl_environment(), name="Prepping OpenSSL", working_directory=lambda: os.path.join(openssl_path)) Configure_openssl = build.Run( r"{} Configure --openssldir={} VC-WIN{}A".format(config['paths']['perl'],
boost_components = [ "date_time", "coroutine", "filesystem", "python", "thread", "log", "locale" ] config_template = ("using python\n" " : {0}\n" " : {1}/python.exe\n" " : {2}/Include\n" " : {1}\n" " : <address-model>{3}\n" " : <define>BOOST_ALL_NO_LIB=1\n" " ;") init_repo = build.Run("git submodule init && git submodule update", name="init boost repository" ,working_directory=lambda: os.path.join(config["paths"]["build"], "boost_git")) \ .set_fail_behaviour(Task.FailBehaviour.CONTINUE) \ .depend(git.Clone("https://github.com/boostorg/boost.git", "develop").set_destination("boost_git")) Project("boostgit") \ .depend(b2.B2(name="Shared").arguments(["address-model={}".format("64" if config['architecture'] == 'x86_64' else "32"), "-a", "--user-config={}".format(os.path.join(config['paths']['build'], "boost_git", "user-config.jam")), "-j {}".format(config['num_jobs']), "toolset=msvc-" + vc_version, "link=shared", "include={}".format(os.path.join(config['paths']['build'], "icu", "dist", "include", "unicode")), "-sICU_PATH={}".format(
os.path.join(build_path, "jom") ]) + ";" + result['Path'] result['INCLUDE'] = os.path.join(build_path, "icu", "dist", "include") + ";" + \ os.path.join(build_path, "Win{}OpenSSL-{}".format(bitnessQt(), openssl_version.replace(".", "_")), "include") + ";" + \ result['INCLUDE'] result['LIB'] = os.path.join(build_path, "icu", "dist", "lib") + ";" + \ os.path.join(build_path, "Win{}OpenSSL-{}".format(bitnessQt(), openssl_version.replace(".", "_")), "lib", "VC") + ";" + \ result['LIB'] result['LIBPATH'] = os.path.join(build_path, "icu", "dist", "lib") + ";" + result['LIBPATH'] return result init_repo = build.Run("perl init-repository", name="init qt repository") \ .set_fail_behaviour(Task.FailBehaviour.CONTINUE) \ .depend(git.Clone("http://code.qt.io/qt/qt5.git", qt_version)) # Internet proxy could refuse git protocol build_qt5 = build.Run(r"jom.exe -j {}".format(config['num_jobs']), environment=qt5_environment(), name="Build Qt5", working_directory=lambda: os.path.join(build_path)) install_qt5 = build.Run(r"nmake install", environment=qt5_environment(), name="Install Qt5", working_directory=lambda: os.path.join(build_path)) def copy_icu_libs(context): for f in glob( os.path.join(build_path, "icu", "dist", "lib",
os.path.join(final_path, "bin", "libssl-1_1{}.pdb".format(bitness_suffix()))): shutil.copy( f, os.path.join(dest_pdb, "libssl-1_1{}.pdb".format(bitness_suffix()))) for f in glob(os.path.join(final_path, "lib", "libcrypto.lib")): shutil.copy(f, os.path.join(dest_lib, "libcrypto.lib")) for f in glob(os.path.join(final_path, "lib", "libssl.lib")): shutil.copy(f, os.path.join(dest_lib, "libssl.lib")) return True OpenSSL_Install = build.Run( r"nmake install", environment=openssl_environment(), name="Install OpenSSL", working_directory=lambda: os.path.join(openssl_path)) OpenSSL_Build = build.Run(r"nmake", environment=openssl_environment(), name="Building OpenSSL", working_directory=lambda: os.path.join(openssl_path)) Configure_openssl = build.Run( r"{} Configure --openssldir={} --prefix={} VC-WIN{}A".format( config['paths']['perl'], os.path.join(openssl_path, "build"), os.path.join(openssl_path, "build"), bitness()), environment=openssl_environment(), name="Configure OpenSSL", working_directory=lambda: os.path.join(openssl_path))
# Mod Organizer is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Mod Organizer is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>. from unibuild import Project from unibuild.modules import urldownload, build, patch from config import config import os # newer versions are beta as of now. They have slightly (?) different api as well sevenzip_version = "16.04" # TODO build sevenzip, we require the dll in install/bin/dlls. # sevenzip is not built here as we only use its source Project("7zip") \ .depend(patch.Copy(os.path.join(config['paths']['build'], "7zip", "CPP", "7zip","Bundles","Format7zF","{}" .format("x86" if config['architecture'] == 'x86' else "AMD64"),"7z.dll"), os.path.join(config['__build_base_path'], "install", "bin","dlls")) .depend(build.Run(r"nmake CPU={} NEW_COMPILER=1 MY_STATIC_LINK=1 NO_BUFFEROVERFLOWU=1".format("x86" if config['architecture'] == 'x86' else "AMD64"), working_directory=os.path.join(config['paths']['build'], "7zip", "CPP", "7zip")) .depend(urldownload.URLDownload("http://www.7-zip.org/a/7z{}-src.7z".format(sevenzip_version.replace(".", ""))).set_destination("7zip"))))
proc = Popen([qt_lrelease_binary, i, "-qm", o], cwd=self._context["build_path"], shell=True, stdout=sout, stderr=serr) proc.communicate() if proc.returncode != 0: logging.error( "failed to run pyqt configure.py (returncode %s), see %s and %s", proc.returncode, soutpath, serrpath) return False return True init_transifex_repo = build.Run( "{} init --token={} --force --no-interactive".format( transifex_client_binary, transifex_api), name="init transifex repository") config_transifex_repo = build.Run( "{} config mapping-remote https://www.transifex.com/tannin/mod-organizer/". format(transifex_client_binary), name="config transifex repository") pull_transifex_repo = build.Run("{} pull -a -f --minimum-perc={}".format( transifex_client_binary, transifex_minimum_percentage), name="pull transifex repository") Project("translations") \ .depend(GenerateTranslations() .depend(pull_transifex_repo
depend( urldownload. URLDownload( "https://github.com/ModOrganizer2/modorganizer-umbrella/releases/download/1.1/lz4_prebuilt_{}.7z" .format(lz4_version_minor)).set_destination(lz_path)))) else: Project("lz4").depend( Patch.Copy( os.path.join(lz_path, "bin", "liblz4.pdb"), os.path.join(config["paths"]["install"], "pdb")).depend( Patch.Copy( os.path.join(lz_path, "bin", "liblz4.dll"), os.path.join( config["paths"]["install"], "bin", "dlls")).depend( build.Execute(copy_binaries).depend( msbuild.MSBuild( os.path.join(lz_path, "visual", "VS2017", 'lz4.sln'), project="liblz4-dll", working_directory=lazy.Evaluate( lambda: os.path.join(lz_path)), reltarget="Release").depend( build.Run( upgrade_args, name="upgrade lz4 project").depend( github.Source( "lz4", "lz4", lz4_version_minor). set_destination(lz_path)))))))
# if config.get('prefer_binary_dependencies', False): if False: # binary installation disabled because there is no support currently for headless installation filename = "qt-opensource-windows-x86-{variant}{arch}-{ver}.{ver_min}.exe".format( url=qt_download_url, ver=qt_version, ver_min=qt_version_minor, variant=qt_bin_variant, arch="_64" if config['architecture'] == 'x86_64' else "") qt5 = Project("Qt5") \ .depend(build.Run(filename, working_directory=config['paths']['download']) .depend(urldownload.URLDownload( "{url}/{ver}/{ver}.{ver_min}/{filename}" .format(url=qt_download_url, ver=qt_version, ver_min=qt_version_minor, filename=filename)))) else: skip_list = [ "qtactiveqt", "qtandroidextras", "qtenginio", "qtserialport", "qtsvg", "qtwebengine", "qtwayland", "qtdoc", "qtconnectivity", "qtwebkit-examples" ] nomake_list = ["tests", "examples"] configure_cmd = lambda: " ".join(["configure.bat", "-platform", platform, "-debug-and-release", "-force-debug-info",
if newproj.projectfile != ncc_csproj: log.info('Changing projectfile: %s -> %s', newproj.projectfile, ncc_csproj) newproj.projectfile = ncc_csproj changed = True if changed: log.info('Writing NexusClientCli.sln') try: sln.SaveToFile(os.path.relpath(os.path.join(build_path, "Nexus-Mod-Manager", 'NexusClientCli.sln'))) # So we dont get conflicts when pulling except ValueError: sln.SaveToFile(os.path.join(build_path, "Nexus-Mod-Manager", 'NexusClientCli.sln')) return True # https://github.com/Nexus-Mods/Nexus-Mod-Manager/commit/03448e0eb02e08f37d7b66507d0537ab67841321 broke fomod installation # until this is fixed we lock NMM to the latest nexus release. Project("ncc") \ .depend(build.Run(r"publish.bat {} {}".format("-debug" if config['build_type'] == "Debug" else "-release", os.path.join(config["paths"]["install"], "bin")), working_directory=lazy.Evaluate(lambda: os.path.join(build_path, "NexusClientCli"))) .depend(msbuild.MSBuild(os.path.join(build_path, "Nexus-Mod-Manager", 'NexusClientCli.sln'), working_directory=lazy.Evaluate(lambda: os.path.join(build_path, "Nexus-Mod-Manager")), project_platform="Any CPU") .depend(build.Run(r"nuget.exe restore {}".format(os.path.join(build_path, "Nexus-Mod-Manager", 'NexusClientCli.sln')), environment=ncc_environment(), working_directory=lazy.Evaluate(lambda: os.path.join(build_path, "Nexus-Mod-Manager"))) .depend(build.Execute(prepare_nmm, name="append NexusClientCli project to NMM") .depend(github.Source("Nexus-Mods", "Nexus-Mod-Manager", config["nmm_version"], None, None, False)) .depend(github.Source(config['Main_Author'], "modorganizer-NCC", config['Build_Branch'], feature_branch=config['Feature_Branch']) .set_destination("NexusClientCli")))))) \ .depend("nuget")
.depend(urldownload.URLDownload("https://www.gnu.org/licenses/lgpl-3.0.txt", 0)) .depend(urldownload.URLDownload("https://www.gnu.org/licenses/gpl-3.0.txt", 0)) .depend(urldownload.URLDownload("https://raw.githubusercontent.com/Microsoft/DirectXTex/master/LICENSE", 0).set_download_filename("DXTex.txt")) .depend(urldownload.URLDownload("https://creativecommons.org/licenses/by-sa/3.0/legalcode.txt", 0).set_download_filename("BY-SA-v3.0.txt")) .depend("sip") .depend("modorganizer")) def copy_explorerpp(context): target_path = Path(config["paths"]["install"]) / "bin" / "explorer++" build_path = Path(config["paths"]["build"]) / "explorer++" shutil.copytree(build_path, target_path, dirs_exist_ok = True) return True Project("explorerpp") \ .depend(build.Execute(copy_explorerpp) .depend(urldownload.URLDownload("https://explorerplusplus.com/software/explorer++_{}_x64.zip".format(config["explorer++_version"]), 0) .set_destination("explorer++"))) if config['Installer']: build_installer = build.Run(r'"{}" {}'.format(config["paths"]["InnoSetup"],"dist/MO2-Installer.iss"), name="Build MO2 Installer") installer = Project("Installer") \ .depend(build_installer .depend(github.Source(config['Main_Author'], "modorganizer-Installer", config['Build_Branch'], feature_branch=config['Feature_Branch'], super_repository=tl_repo) .set_destination("installer")) .depend("modorganizer").depend("usvfs").depend("usvfs_32").depend("translationsBuild").depend("modorganizer-fnistool"))
# if config.get('prefer_binary_dependencies', False): if False: # binary installation disabled because there is no support currently for headless installation filename = "qt-opensource-windows-x86-{variant}{arch}-{ver}.{ver_min}.exe".format( url=qt_download_url, ver=qt_version, ver_min=qt_version_minor, variant=qt_bin_variant, arch="_64" if config['architecture'] == 'x86_64' else "" ) qt5 = Project("Qt5") \ .depend(build.Run(filename, working_directory=config['paths']['download']) .depend(urldownload.URLDownload( "{url}/{ver}/{ver}.{ver_min}/{filename}" .format(url=qt_download_url, ver=qt_version, ver_min=qt_version_minor, filename=filename)))) else: skip_list = ["qtactiveqt", "qtandroidextras", "qtenginio", "qtserialport", "qtsvg", "qtwebkit", "qtwayland", "qtdoc", "qtconnectivity", "qtwebkit-examples"] nomake_list = ["tests", "examples"] configure_cmd = lambda: " ".join(["configure.bat", "-platform", platform, "-debug-and-release", "-force-debug-info", "-opensource", "-confirm-license", "-icu", "-mp", "-no-compile-examples",
#if config.get('prefer_binary_dependencies', False): if False: # the python installer registers in windows and prevent further installations. This means this installation # would interfere with the rest of the system filename = "python-{0}{1}.msi".format( python_version, ".amd64" if config['architecture'] == "x86_64" else "") python = Project("Python") \ .depend(build.Run("msiexec /i {0} TARGETDIR={1} /qn ADDLOCAL=DefaultFeature,SharedCRT" .format(os.path.join(config['paths']['download'], filename), os.path.join(config['paths']['build'], "python-{}".format(python_version)) ) ) .depend(urldownload.URLDownload("{0}/{1}/{2}" .format(python_url, python_version, filename ) ) ) ) else: def install(context): make_sure_path_exists( os.path.join(config["__build_base_path"], "install", "libs")) path_segments = [context['build_path'], "PCbuild"] if config['architecture'] == "x86_64": path_segments.append("amd64") path_segments.append("*.lib")
os.path.join(get_visual_studio_2017('15.0'), "..", "..", "..", "Common7", "IDE", "devenv.exe"), "PCBuild/pcbuild.sln", "/upgrade" ] def install(context): make_sure_path_exists(os.path.join(path_install, "libs")) path_segments = [context['build_path'], "PCbuild"] if config['architecture'] == "x86_64": path_segments.append("amd64") path_segments.append("*.lib") shutil.copy(os.path.join(python['build_path'], "PC", "pyconfig.h"), os.path.join(python['build_path'], "Include", "pyconfig.h")) for f in glob(os.path.join(*path_segments)): shutil.copy(f, os.path.join(path_install, "libs")) return True def download(context): return True python = Project("Python") \ .depend(build.Execute(install) .depend(msbuild.MSBuild("PCBuild/PCBuild.sln", "python,pyexpat", project_PlatformToolset=config['vc_platformtoolset']) .depend(build.Run(upgrade_args, name="upgrade python project") .depend(github.Source("LePresidente", "cpython-1", config.get('python_version', "2.7"), shallowclone=True) \ .set_destination("python-{}".format(python_version + python_version_minor))))))
s += x + ";" else: s = x + ";" else: if "cygwin" not in x: s +=os.path.join(config['paths']['build'], "cygwin", "bin") + ";" + x + ";" else: s += x + ";" result['PATH'] = s return result # Warning, build_run only works for me if cygwin is first after VS in the path (as requested in readme) # So I change my path before calling unimake.py build_icu = build.Run("make && make install".format(os.path.join(config['paths']['build'], "cygwin", "bin")), name="ICU Make", environment=icu_environment(), working_directory=lambda: os.path.join(config["paths"]["build"], "icu", "source")) # Warning this won't work if there are Embarcadero compiler definition in your path class ConfigureIcu(build.Builder): def __init__(self): super(ConfigureIcu, self).__init__() @property def name(self): return "icu configure" def process(self, progress): from distutils.spawn import find_executable res = find_executable("cygpath", os.path.join(config['paths']['build'], "cygwin", "bin"))
) tl_repo = git.SuperRepository("modorganizer_super") # install compiled mo components """ doesn't build through msbuild but builds fine in IDE?? .depend(msbuild.MSBuild("../nmm/NexusClient.sln", "NexusClientCli", working_directory=lazy.Evaluate(lambda: os.path.join(ncc['build_path'], "..", "nmm"))) """ ncc = Project("NCC") \ .depend(build.Run("powershell .\\publish.ps1 {0} -outputPath {1}" .format("-debug" if config['build_type'] == "Debug" else "-release", os.path.join(config['__build_base_path'], "install", "bin")), working_directory=lazy.Evaluate(lambda: ncc['build_path'])) .depend(patch.Copy("NexusClient.sln", "../nmm") .depend(github.Source("TanninOne", "modorganizer-NCC", "master") .set_destination(os.path.join("NCC", "NexusClientCli")) .depend(hg.Clone("http://hg.code.sf.net/p/nexusmodmanager/codehgdev45") .set_destination(os.path.join("NCC", "nmm")) ) ) ) ) # ) Project("modorganizer-game_features") \ .depend(github.Source("TanninOne", "modorganizer-game_features", "master", super_repository=tl_repo) .set_destination("game_features")) def gen_userfile_content(project): with open("CMakeLists.txt.user.template", 'r') as f: