コード例 #1
0
                     "--confirm-license",
                     "-b", bp,
                     "-d", os.path.join(bp, "Lib", "site-packages"),
                     "-v", os.path.join(bp, "sip", "PyQt5"),
                     "--sip-incdir", os.path.join(bp, "Include"),
                     "--spec=win32-msvc"],
                    env=pyqt5_env(),
                    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


Project("PyQt5") \
    .depend(build.Execute(copy_pyd)
            .depend(Patch.Copy([os.path.join(qt_inst_path(), "bin", "Qt5Core.dll"),
                                os.path.join(qt_inst_path(), "bin", "Qt5Xml.dll")],
                               doclambda(lambda: python.python['build_path'], "python path"))
                    .depend(build.Make(environment=lazy.Evaluate(pyqt5_env)).install()
                            .depend(PyQt5Configure()
                                    .depend("sip")
                                    .depend("Qt5")
                                    .depend(sourceforge.Release("pyqt", "PyQt5/PyQt-{0}/PyQt5_gpl-{0}.zip"
                                                                .format(pyqt_version), tree_depth=1))))))
コード例 #2
0
                logging.error(
                    "failed to install PyQt5.sip (returncode %s), see %s and %s",
                    proc.returncode, soutpath, serrpath)
                return False
    return True


if config.get('Appveyor_Build', True):
    Project("PyQt5") \
            .depend(build.Execute(copy_files)
                    .depend(Patch.Copy([os.path.join(qt_inst_path(), "bin", "Qt5Core.dll"),
                                        os.path.join(qt_inst_path(), "bin", "Qt5Xml.dll")],
                            doclambda(lambda: os.path.join(python.python["build_path"], "PCbuild", arch), "python path"))
                            .depend(
                                    urldownload.URLDownload(
                                        config.get('prebuilt_url') + "PyQt5_gpl-prebuilt-{0}.7z"
                                        .format(pyqt_version), name="PyQt5-prebuilt", clean=False
                                    )
                                    .set_destination("python-{}".format(python_version))
                                    .depend("sip")
                                    .depend("Qt5")
                                    )
                            )
                    )
else:
    if pyqt_dev:
        pyqt_source = urldownloadany.URLDownloadAny((
            urldownload.URLDownload(
                "https://www.riverbankcomputing.com/static/Downloads/PyQt5/{0}/PyQt5-{0}.zip"
                .format(pyqt_version),
                tree_depth=1),
            urldownload.URLDownload(
コード例 #3
0
from unibuild.projects import sevenzip, qt5, boost, zlib, python, sip, pyqt5, ncc, nasm, openssl
from unibuild.projects import googletest, lz4, WixToolkit


# TODO modorganizer-lootcli needs an overhaul as the api has changed alot
def bitness():
    return "x64" if config['architecture'] == "x86_64" else "Win32"


def bitnessLoot():
    return "64" if config['architecture'] == "x86_64" else "32"

Project("LootApi") \
    .depend(
    Patch.Copy("loot_api.dll", os.path.join(config["paths"]["install"], "bin", "loot"))
        .depend(github.Release("loot", "loot-api", loot_version,
                               "loot_api-{}-0-{}_update-deps-win{}".format(loot_version, commit_id, bitnessLoot()), "7z", tree_depth=1)
                .set_destination("lootapi"))

)

tl_repo = git.SuperRepository("modorganizer_super")


def gen_userfile_content(project):
    with open("CMakeLists.txt.user.template", 'r') as f:
        res = Formatter().vformat(
            f.read(), [],
            FormatDict({
                'build_dir': project['edit_path'],
                'environment_id': config['qt_environment_id'],
                'profile_name': config['qt_profile_name'],
コード例 #4
0
                                                                                    "usvfs", "githubpp",
                                                                                    "ncc", "openssl",
                                                                                    "paper-light-and-dark", "paper-automata", "paper-mono", "1809-dark-mode"], True),
]:
    cmake_param = cmake_parameters() + ["-DCMAKE_INSTALL_PREFIX:PATH={}".format(config["paths"]["install"])]
    # build_step = cmake.CMake().arguments(cmake_param).install()

    # for dep in dependencies:
    #     build_step.depend(dep)

    project = Project(git_path)

    if Build:
        #prepare build version override step
        patch_version_step = Patch.RegexReplace("src/version.rc",
                                                "#define VER_FILEVERSION_STR.*\n",
                                                "#define VER_FILEVERSION_STR \"{}\"\n"
                                                .format(config['override_build_version']))

        if config['Appveyor_Build']:
            appveyor_cmake_step = cmake.CMakeJOM().arguments(cmake_param).install()

            if git_path != "cmake_common":
                appveyor_cmake_step.depend("cmake_common")

            for dep in dependencies:
                appveyor_cmake_step.depend(dep)

            if os.getenv("APPVEYOR_PROJECT_NAME","") == git_path:
                source_retrieval_step = appveyor.SetProjectFolder(os.getenv("APPVEYOR_BUILD_FOLDER", ""))
            else:
                source_retrieval_step = github.Source(author, git_path, branch, feature_branch=config['Feature_Branch'], super_repository=tl_repo).set_destination(path)
コード例 #5
0
        return False


if config.get('binary_boost', True):
    boost_prepare = Project("boost_prepare")
    boost = Project("boost").depend(
        urldownload.URLDownload(
            "https://github.com/ModOrganizer2/modorganizer-umbrella/releases/download/1.1/boost_prebuilt_{}.7z"
            .format(boost_tag_version.replace(".", "_"))).set_destination(
                "boost_{}".format(boost_tag_version.replace(".", "_"))))
    if config['architecture'] == 'x86_64':
        boost_stage = Patch.Copy(
            os.path.join(
                "{}/lib{}-msvc-{}/lib/boost_python{}-vc{}-mt-{}-{}.dll".format(
                    boost_path,
                    "64" if config['architecture'] == 'x86_64' else "32",
                    vc_version, config["python_version"].replace(".", ""),
                    vc_version.replace(".", ""),
                    "x64" if config['architecture'] == "x86_64" else "x86",
                    "_".join(boost_version.split(".")[:-1]))),
            os.path.join(config["paths"]["install"], "bin"))
        boost.depend(boost_stage)

else:
    boost_prepare = Project("boost_prepare") \
        .depend(b2.Bootstrap()
                .depend(Patch.CreateFile(user_config_jam,
                                         lambda: config_template.format(
                                             python_version,
                                             os.path.join(
                                                python.python['build_path'], "PCBuild",
                                                "{}".format("" if config['architecture'] == 'x86' else "amd64"))
コード例 #6
0
# This file is part of Mod Organizer.
#
# 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/>.
import os.path

from config import config
from unibuild import Project
from unibuild.modules import github, Patch

lz4_version = config['lz4_version']
lz4_version_minor = ".".join(filter(None, [lz4_version, config['lz4_version_minor']]))
lz_path = os.path.join(config['paths']['build'], "lz4-{}".format(lz4_version))

Project("lz4") \
    .depend(Patch.Copy(os.path.join(lz_path, "dll", "liblz4.so.{0}.dll".format(lz4_version[1:])),
                       os.path.join(config["paths"]["install"], "bin", "dlls")).set_filename("liblz4.dll")
            .depend(github.Release("lz4", "lz4", lz4_version_minor, "lz4_{0}_win{1}".format(lz4_version.replace(".", "_"),
                               "64" if config['architecture'] == 'x86_64' else "32"), "zip")
                          .set_destination("lz4-{}".format(lz4_version))))
コード例 #7
0
ファイル: pyqt5.py プロジェクト: ozoak/modorganizer-umbrella
                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


Project("PyQt5") \
    .depend(build.Execute(copy_pyd)
            .depend(Patch.Copy([os.path.join(qt5.qt_inst_path, "bin", "Qt5Core.dll"),
                                os.path.join(qt5.qt_inst_path, "bin", "Qt5Xml.dll"),
                                os.path.join(config['paths']['build'], "icu" , "dist", "lib", "icudt{}.dll".format(icu_version)),
                                os.path.join(config['paths']['build'], "icu", "dist", "lib", "icuin{}.dll".format(icu_version)),
                                os.path.join(config['paths']['build'], "icu", "dist", "lib", "icuuc{}.dll".format(icu_version))],
                               doclambda(lambda: python.python['build_path'], "python path"))
                    .depend(build.Make(environment=lazy.Evaluate(pyqt5_env)).install()
                            .depend(PyQt5Configure()
                                    .depend("sip")
                                    .depend("Qt5")
                                    .depend(sourceforge.Release("pyqt",
                                                                "PyQt5/PyQt-{0}.{1}/PyQt5_gpl-{0}.{1}.zip"
                                                                .format(qt5.qt_version, qt5.qt_version_minor),
                                                                tree_depth=1))
                                    )
                            )
                    )
            )
コード例 #8
0
        .depend(b2.B2(name="Static").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=static",
                                                "runtime-link=shared",
                                                "include={}".format(os.path.join(config['paths']['build'], "icu", "dist", "include", "unicode")),
                                                "-sICU_PATH={}".format(os.path.join(config['paths']['build'], "icu", "dist")),
                                                "-sHAVE_ICU=1",
                                                ] + ["--with-{0}".format(component) for component in boost_components])
                    .depend(build.Run(r"bootstrap.bat",working_directory=lambda: os.path.join(config["paths"]["build"], "boost_git")))
                        .depend(Patch.CreateFile("user-config.jam",
                                                 lambda: config_template.format(
                                         python_version,
                                         os.path.join(python_path, "PCBuild",
                                                      "{}".format("" if config['architecture'] == 'x86' else "amd64")).replace("\\",'/'),
                                         python_path,
                                         "64" if config['architecture'] == "x86_64" else "32")
                                                 ))
                    .depend(init_repo)
        #            .depend(sourceforge.Release("boost",
        #                                        "boost/{0}/boost_{1}.tar.bz2".format(boost_version,
        #                                                                             boost_version.replace(".", "_")),
        #                                        tree_depth=1))
                    ).depend("icu").depend("Python")
                )
コード例 #9
0
 .depend(Patch.Copy(os.path.join("{}/boost_{}/stage/lib/boost_python-vc{}-mt-{}.dll"
                                 .format(config["paths"]["build"],
                                         config["boost_version"].replace(".", "_"),
                                         vc_version.replace(".", ""),
                                         "_".join(boost_version.split(".")[:-1])
                                         )),
                    os.path.join(config["paths"]["install"], "bin"))
         .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_{}".format(boost_version.
                                                                                          replace(".", "_")),
                                                                        "user-config.jam")),
                                 "-j {}".format(config['num_jobs']),
                                 "toolset=msvc-" + vc_version,
                                 "link=shared",
                                 ] + ["--with-{0}".format(component) for component in boost_components])
 .depend(
     b2.B2(name="Static").arguments(["address-model={}".format("64" if config['architecture'] == 'x86_64' else "32"),
                                     "-a",
                                     "--user-config={}".format(os.path.join(config['paths']['build'],
                                                                            "boost_{}".format(boost_version.
                                                                                              replace(".", "_")),
                                                                            "user-config.jam")),
                                     "-j {}".format(config['num_jobs']),
                                     "toolset=msvc-" + vc_version,
                                     "link=static",
                                     "runtime-link=shared",
                                     ] + ["--with-{0}".format(component) for component in boost_components])
     .depend(Patch.CreateFile("user-config.jam",
                              lambda: config_template.format(
                                  python_version,
                                  os.path.join(python.python['build_path'], "PCBuild",
                                               "{}".format(
                                                   "" if config['architecture'] == 'x86' else "amd64")).replace("\\",
                                                                                                                '/'),
                                  os.path.join(python.python['build_path']).replace("\\", '/'),
                                  "64" if config['architecture'] == "x86_64" else "32")
                              ).depend(build.Execute(patchboost)
                                       .depend(sourceforge.Release("boost",
                                                                   "boost/{0}/boost_{1}.tar.bz2".format(
                                                                       boost_version,
                                                                       boost_version.replace(".", "_")),
                                                                   tree_depth=1))
                                       ).depend("Python")
             )
     )
 )
コード例 #10
0
        shutil.rmtree(os.path.join(lz_path, "bin"))
    shutil.copytree(
        os.path.join(lz_path, "visual", "VS2017", "bin",
                     "{}_Release".format(bitness())),
        os.path.join(lz_path, "bin"))
    return True


if config.get('binary_lz4', True):
    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(
                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(
コード例 #11
0
ファイル: libloot.py プロジェクト: tfks/modorganizer-umbrella
# 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/>.
import os

from config import config
from unibuild import Project
from unibuild.modules import github, Patch

loot_version = config['loot_version']
loot_commit = config['loot_commit']
loot_branch = config['loot_branch']


def bitnessLoot():
    return "64" if config['architecture'] == "x86_64" else "32"


# TODO modorganizer-lootcli needs an overhaul as the api has changed alot
Project("libloot") \
    .depend(Patch.Copy("loot.dll", os.path.join(config["paths"]["install"], "bin", "loot"))
            .depend(github.Release("loot", "libloot", loot_version,
                               "libloot-{}-0-{}_{}-win{}".format(loot_version, loot_commit, loot_branch, bitnessLoot()), "7z", tree_depth=1)
                          .set_destination("libloot-{}-{}".format(loot_version, loot_commit))))
コード例 #12
0
# newer versions are beta as of now. They have slightly (?) different api as well
#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(
コード例 #13
0
                        proc.returncode, soutpath, serrpath)
                    return False

        return True


if config.get('Appveyor_Build', True):
    Project("PyQt5") \
            .depend(build.Execute(copy_pyd)
                    .depend(Patch.Copy([os.path.join(qt_inst_path(), "bin", "Qt5Core.dll"),
                                        os.path.join(qt_inst_path(), "bin", "Qt5Xml.dll")],
                            doclambda(lambda: python.python['build_path'], "python path"))
                            .depend(build.Execute(copy_init_patch)
                                    .depend(urldownload.URLDownload(
                                                config.get('prebuilt_url') + "PyQt5_gpl-prebuilt-{0}.7z"
                                                .format(pyqt_version), name="PyQt5-prebuilt", clean=False
                                            )
                                            .set_destination("python-{}".format(python_version))
                                            .depend("sip")
                                            .depend("Qt5")
                                            )
                                    )
                            )
                    )
else:
    pyqt_source = urldownloadany.URLDownloadAny((
        urldownload.URLDownload(
            "https://www.riverbankcomputing.com/static/Downloads/PyQt5/{0}/PyQt5_gpl-{0}.zip"
            .format(pyqt_version),
            tree_depth=1),
        urldownload.URLDownload(
コード例 #14
0
ファイル: lz4.py プロジェクト: ozoak/modorganizer-umbrella
#
# This file is part of Mod Organizer.
#
# 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 github, Patch
from config import config
import os

lz4_version = "v1.7.4"

Project("lz4") \
            .depend(Patch.Copy(os.path.join(config['paths']['build'], "lz4", "dll", "liblz4.dll"),
                               os.path.join(config["paths"]["install"], "bin", "dlls"))
                    .depend(github.Release("lz4", "lz4", lz4_version, "lz4_{0}_win{1}".format(lz4_version.replace(".","_"),"64" if config['architecture'] == 'x86_64' else "32"),"zip")
                    .set_destination("lz4")
                )
                    )
コード例 #15
0

def patchboost(context):
    try:
        return True
    except OSError:
        return False


boost_prepare = Project("boost_prepare") \
    .depend(b2.Bootstrap() \
        .depend(Patch.CreateFile(user_config_jam,
                                lambda: config_template.format(python_version,
                                os.path.join(python.python['build_path'], "PCBuild",
                                "{}".format("" if config['architecture'] == 'x86' else "amd64")).replace("\\",'/'),
                                    os.path.join(python.python['build_path']).replace("\\", '/'),
                                    "64" if config['architecture'] == "x86_64" else "32")) \
            .depend(build.Execute(patchboost)
                .depend(sourceforge.Release("boost", "boost/{0}/boost_{1}.tar.bz2"
                                    .format(boost_version, boost_version.replace(".", "_")),tree_depth=1)
                                    .set_destination("boost_{}".format(boost_version))))))

if config['architecture'] == 'x86_64':
    # This is a convient way to make each boost flavors we build have these dependencies:
    boost_prepare.depend("Python")

boost = Project("boost")

if config['architecture'] == 'x86_64':
    boost_stage = Patch.Copy(
        os.path.join("{}/stage/lib/boost_python-vc{}-mt-{}-{}.dll".format(
            boost_path, vc_version.replace(".", ""),
コード例 #16
0
                    proc = subprocess.Popen([res, "runConfigureICU", "Cygwin/MSVC", "--prefix"
                                            , "{}".format(current_dir_cygwin)],
                             env=icu_environment(),
                             cwd=os.path.join(self._context["build_path"], "source"),
                             shell=True,
                             stdout=sout, stderr=serr)
                proc.communicate()
                if proc.returncode != 0:
                    logging.error("failed to run icu runConfigureICU (returncode %s), see %s and %s",
                                  proc.returncode, soutpath, serrpath)
                    return False

            return True


Convert_icu = build.Run(r"dos2unix -f configure",
                        environment=icu_environment(),
                        working_directory=lambda: os.path.join(config["paths"]["build"], "icu", "source"))

icu = Project('icu') \
        .depend(build_icu
                .depend(ConfigureIcu()
                        .depend(Convert_icu
                                .depend(Patch.Replace("source/io/ufile.cpp",
                                                      "#if U_PLATFORM_USES_ONLY_WIN32_API",
                                                      "#if U_PLATFORM_USES_ONLY_WIN32_API && _MSC_VER < 1900")
                                        .depend(sourceforge.Release("icu","ICU4C/{0}.{1}/icu4c-{0}_{1}-src.tgz"
                                                                    .format(icu_version,icu_version_minor),tree_depth=1)
                                                                            .set_destination("icu"))))))\
        .depend("cygwin")
コード例 #17
0
    ssleay_path = os.path.join(context['build_path'], "lib", "VC", "static",
                               ssleay)
    wait_counter = timeout
    while wait_counter > 0:
        if os.path.isfile(libeay_path) and os.path.isfile(ssleay_path):
            break
        else:
            time.sleep(1.0)
            wait_counter -= 1
    # wait a bit longer because the installer may have been in the process of writing the file
    time.sleep(1.0)

    if wait_counter <= 0:
        logging.error("Unpacking of OpenSSL timed out")
        return False  #We timed out and nothing was installed

    return True


openssl = Project("openssl") \
    .depend(Patch.Copy([os.path.join(config['paths']['build'], "Win{0}OpenSSL-{1}"
                                     .format("32" if config['architecture'] == 'x86' else "64",
                                             openssl_version.replace(".","_")), "ssleay32.dll"),
                        os.path.join(config['paths']['build'], "Win{0}OpenSSL-{1}"
                                     .format("32" if config['architecture'] == 'x86' else "64",
                                             openssl_version.replace(".", "_")), "libeay32.dll"), ],
                       os.path.join(config["paths"]["install"], "bin","dlls"))
            .depend(build.Execute(build_func)
            .depend(urldownload.URLDownload(url))
            ))