Esempio n. 1
0
def Install(auth, software, platform, platformData, mirrors, verbose):
    installPrefix = GetInstallPrefix(platformData)
    ar = GetAr(platformData["target"])
    cc = GetCc(platformData["target"])

    storeTemp = StoreTemp()
    storeTemp.ResolveEmptySubdirectory(software)
    tempPath = storeTemp.GetSubdirectoryPath(software)

    try:
        with WorkingDir(tempPath):
            RunCommand(
                ["git", "clone", "https://github.com/mmalecki/saneopt.git"],
                verbose)
        clonedDir = os.path.join(tempPath, "saneopt")
        with WorkingDir(clonedDir):
            RunCommand(["make", "CC=" + cc, "AR=" + ar], verbose)
            if not os.path.exists(installPrefix + "/include"):
                RunCommand(["mkdir", "-p", installPrefix + "/include"],
                           verbose)
            if not os.path.exists(installPrefix + "/lib"):
                RunCommand(["mkdir", "-p", installPrefix + "/lib"], verbose)
            RunCommand(
                ["cp", "./include/saneopt.h", installPrefix + "/include"],
                verbose)
            RunCommand(["cp", "./libsaneopt.a", installPrefix + "/lib"],
                       verbose)
    except CommandError:
        print("VGAZER: Unable to install", software)
        raise InstallError(software + " not installed")

    print("VGAZER:", software, "installed")
Esempio n. 2
0
def Install(auth, software, platform, platformData, mirrors, verbose):
    installPrefix = GetInstallPrefix(platformData)

    cc = GetCc(platformData["target"])
    ar = GetAr(platformData["target"])

    storeTemp = StoreTemp()
    storeTemp.ResolveEmptySubdirectory(software)
    tempPath = storeTemp.GetSubdirectoryPath(software)

    try:
        with WorkingDir(tempPath):
            RunCommand(
             ["git", "clone", "https://github.com/haipome/utf8.git"],
             verbose)
        clonedDir = os.path.join(tempPath, "utf8")
        with WorkingDir(clonedDir):
            RunCommand(
             [cc, "-O2", "-Wall", "-c", "utf8.c", "-o", "utf8.o"],
             verbose)
            RunCommand([ar, "rcs", "libutf8.a", "utf8.o"], verbose)
            if not os.path.exists(installPrefix + "/include"):
                RunCommand(["mkdir", "-p", installPrefix + "/include"],
                 verbose)
            if not os.path.exists(installPrefix + "/lib"):
                RunCommand(["mkdir", "-p", installPrefix + "/lib"], verbose)
            RunCommand(["cp", "./utf8.h", installPrefix + "/include"], verbose)
            RunCommand(["cp", "./libutf8.a", installPrefix + "/lib"], verbose)
    except CommandError:
        print("VGAZER: Unable to install", software)
        raise InstallError(software + " not installed")

    print("VGAZER:", software, "installed")
Esempio n. 3
0
def Install(auth, software, platform, platformData, mirrors, verbose):
    installPrefix = GetInstallPrefix(platformData)
    ar = GetAr(platformData["target"])
    cc = GetCc(platformData["target"])

    storeTemp = StoreTemp()
    storeTemp.ResolveEmptySubdirectory(software)
    tempPath = storeTemp.GetSubdirectoryPath(software)

    releases = auth["github"].GetJson(
        "https://api.github.com/repos/benhoyt/inih/releases")

    if GithubCheckApiRateLimitExceeded(releases):
        raise GithubApiRateLimitExceeded(
            "Github API rate limit reached while searching last version of "
            "repo: benhoyt/inih")

    tarballUrl = releases[0]["tarball_url"]
    tarballShortFilename = tarballUrl.split("/")[-1]

    try:
        with WorkingDir(tempPath):
            RunCommand(["wget", "-P", "./", tarballUrl], verbose)
            RunCommand([
                "tar", "--verbose", "--extract", "--gzip", "--file",
                tarballShortFilename
            ], verbose)
            output = GetCommandOutputUtf8(
                ["tar", "--list", "--file", tarballShortFilename])
        extractedDir = os.path.join(tempPath,
                                    output.splitlines()[0].split("/")[0])
        with WorkingDir(extractedDir):
            RunCommand([
                cc, "-c", "ini.c", "-o", "ini.o", "-O2", "-Wall", "-fPIC",
                "-DINI_STOP_ON_FIRST_ERROR=1", "-DINI_HANDLER_LINENO=1",
                "-DINI_CALL_HANDLER_ON_NEW_SECTION=1", "-DINI_USE_STACK=0",
                "-DINI_ALLOW_REALLOC=1"
            ], verbose)
            RunCommand([ar, "rcs", "libinih.a", "ini.o"], verbose)
            if not os.path.exists(installPrefix + "/include"):
                RunCommand(["mkdir", "-p", installPrefix + "/include"],
                           verbose)
            if not os.path.exists(installPrefix + "/lib"):
                RunCommand(["mkdir", "-p", installPrefix + "/lib"], verbose)
            RunCommand(["cp", "./ini.h", installPrefix + "/include"], verbose)
            RunCommand(["cp", "./libinih.a", installPrefix + "/lib"], verbose)
    except CommandError:
        print("VGAZER: Unable to install", software)
        raise InstallError(software + " not installed")

    print("VGAZER:", software, "installed")
Esempio n. 4
0
def Install(auth, software, platform, platformData, mirrors, verbose):
    installPrefix = GetInstallPrefix(platformData)
    ar = GetAr(platformData["target"])
    cc = GetCc(platformData["target"])

    storeTemp = StoreTemp()
    storeTemp.ResolveEmptySubdirectory(software)
    tempPath = storeTemp.GetSubdirectoryPath(software)

    tags = auth["github"].GetJson(
        "https://api.github.com/repos/XadillaX/xmempool/tags")

    if GithubCheckApiRateLimitExceeded(tags):
        raise GithubApiRateLimitExceeded(
            "Github API rate limit reached while searching last version of "
            "repo: ryanlederman/libsir")
    tarballUrl = tags[0]["tarball_url"]
    tarballShortFilename = tarballUrl.split("/")[-1]

    try:
        with WorkingDir(tempPath):
            RunCommand(["wget", "-P", "./", tarballUrl], verbose)
            RunCommand([
                "tar", "--verbose", "--extract", "--gzip", "--file",
                tarballShortFilename
            ], verbose)
            output = GetCommandOutputUtf8(
                ["tar", "--list", "--file", tarballShortFilename])
        extractedDir = os.path.join(tempPath,
                                    output.splitlines()[0].split("/")[0])
        with WorkingDir(extractedDir):
            RunCommand([
                "sed", "-i", "s/(unsigned int)pool->start,/pool->start,/g; "
                "s/(unsigned int)pool->end);/pool->end);/g", "xmempool.c"
            ], verbose)
            RunCommand(["make", "static", "CC=" + cc, "AR=" + ar], verbose)
            if not os.path.exists(installPrefix + "/include"):
                RunCommand(["mkdir", "-p", installPrefix + "/include"],
                           verbose)
            if not os.path.exists(installPrefix + "/lib"):
                RunCommand(["mkdir", "-p", installPrefix + "/lib"], verbose)
            RunCommand(
                ["cp", "xmempool.a", installPrefix + "/lib/libxmempool.a"],
                verbose)
            RunCommand(["cp", "xmempool.h", installPrefix + "/include"],
                       verbose)
    except CommandError:
        print("VGAZER: Unable to install", software)
        raise InstallError(software + " not installed")

    print("VGAZER:", software, "installed")
Esempio n. 5
0
def Install(auth, software, platform, platformData, mirrors, verbose):
    installPrefix = GetInstallPrefix(platformData)
    ar = GetAr(platformData["target"]) + " rcu"
    cc = GetCc(platformData["target"]) + " -std=gnu99"
    ranlib = GetRanlib(platformData["target"])

    storeTemp = StoreTemp()
    storeTemp.ResolveEmptySubdirectory(software)
    tempPath = storeTemp.GetSubdirectoryPath(software)

    tarballUrl = GetTarballUrl()
    tarballShortFilename = tarballUrl.split("/")[-1]

    luaTarget = {
        "linux": "linux",
        "windows": "mingw",
    }[platformData["target"].GetOs()]

    try:
        with WorkingDir(tempPath):
            RunCommand(["wget", "-P", "./", tarballUrl], verbose)
            RunCommand([
                "tar", "--verbose", "--extract", "--gzip", "--file",
                tarballShortFilename
            ], verbose)
        extractedDir = os.path.join(tempPath, tarballShortFilename[0:-7])
        with WorkingDir(extractedDir):
            # We need not Lua commandline tools, because it depends on readline
            # library. We need not extra depends like it. We need unly lua
            # library. This arguments prevent building commandline tools:
            # TO_BIN=
            # LUA_T=
            # LUAC_T=
            # INSTALL_BIN=
            # INSTALL_EXEC=true
            RunCommand([
                "make", luaTarget, "CC=" + cc, "AR=" + ar, "RANLIB=" + ranlib,
                "TO_BIN=", "LUA_T=", "LUAC_T="
            ], verbose)
            RunCommand([
                "make", luaTarget, "install", "INSTALL_TOP=" + installPrefix,
                "TO_BIN=", "LUA_T=", "LUAC_T=", "INSTALL_BIN=",
                "INSTALL_EXEC=true"
            ], verbose)
    except CommandError:
        print("VGAZER: Unable to install", software)
        raise InstallError(software + " not installed")

    print("VGAZER:", software, "installed")
Esempio n. 6
0
def Install(auth, software, platform, platformData, mirrors, verbose):
    installPrefix = GetInstallPrefix(platformData)

    cc = GetCc(platformData["target"])
    ar = GetAr(platformData["target"])

    storeTemp = StoreTemp()
    storeTemp.ResolveEmptySubdirectory(software)
    tempPath = storeTemp.GetSubdirectoryPath(software)

    sourceforgeMirrorsManager = mirrors["sourceforge"].CreateMirrorsManager(
        ["https", "http"])

    filename = requests.get(
        "https://sourceforge.net/projects/tinyfiledialogs/best_release.json"
    ).json()["release"]["filename"]
    archiveShortFilename = filename.split("/")[-1]

    try:
        with WorkingDir(tempPath):
            SourceforgeDownloadTarballWhileErrorcodeFour(
                sourceforgeMirrorsManager, "tinyfiledialogs", filename,
                verbose)
            RunCommand(["unzip", archiveShortFilename], verbose)
        extractedDir = os.path.join(tempPath, archiveShortFilename[0:-4])
        with WorkingDir(extractedDir):
            RunCommand([
                cc, "-c", "tinyfiledialogs.c", "-o", "tinyfiledialogs.o",
                "-O2", "-Wall", "-fPIC"
            ], verbose)
            RunCommand(
                [ar, "rcs", "libtinyfiledialogs.a", "tinyfiledialogs.o"],
                verbose)
            if not os.path.exists(installPrefix + "/include"):
                RunCommand(["mkdir", "-p", installPrefix + "/include"],
                           verbose)
            if not os.path.exists(installPrefix + "/lib"):
                RunCommand(["mkdir", "-p", installPrefix + "/lib"], verbose)
            RunCommand(
                ["cp", "./tinyfiledialogs.h", installPrefix + "/include"],
                verbose)
            RunCommand(
                ["cp", "./libtinyfiledialogs.a", installPrefix + "/lib"],
                verbose)
    except CommandError:
        print("VGAZER: Unable to install", software)
        raise InstallError(software + " not installed")

    print("VGAZER:", software, "installed")
Esempio n. 7
0
def Install(auth, software, platform, platformData, mirrors, verbose):
    installPrefix = GetInstallPrefix(platformData)
    cc = GetCc(platformData["target"])
    cflags = "-Wall -Winline -O2 -g -D_FILE_OFFSED_BITS=64 -fPIC"
    ar = GetAr(platformData["target"])
    ranlib = GetRanlib(platformData["target"])

    storeTemp = StoreTemp()
    storeTemp.ResolveEmptySubdirectory(software)
    tempPath = storeTemp.GetSubdirectoryPath(software)

    sourceforgeMirrorsManager = mirrors["sourceforge"].CreateMirrorsManager(
        ["https", "http"])

    filename = requests.get(
        "https://sourceforge.net/projects/bzip2/best_release.json").json(
        )["release"]["filename"]
    tarballShortFilename = filename.split("/")[-1]

    try:
        with WorkingDir(tempPath):
            SourceforgeDownloadTarballWhileErrorcodeFour(
                sourceforgeMirrorsManager, "bzip2", filename, verbose)
            RunCommand([
                "tar", "--verbose", "--extract", "--gzip", "--file",
                tarballShortFilename
            ], verbose)
        extractedDir = os.path.join(tempPath, tarballShortFilename[0:-7])
        with WorkingDir(extractedDir):
            RunCommand([
                "make", "libbz2.a", "CC=" + cc, "AR=" + ar, "RANLIB=" + ranlib,
                "CFLAGS=" + cflags
            ], verbose)
            if not os.path.exists(installPrefix + "/include"):
                RunCommand(["mkdir", "-p", installPrefix + "/include"],
                           verbose)
            if not os.path.exists(installPrefix + "/lib"):
                RunCommand(["mkdir", "-p", installPrefix + "/lib"], verbose)
            RunCommand(["cp", "./bzlib.h", installPrefix + "/include"],
                       verbose)
            RunCommand(["cp", "./libbz2.a", installPrefix + "/lib"], verbose)
    except CommandError:
        print("VGAZER: Unable to install", software)
        raise InstallError(software + " not installed")

    print("VGAZER:", software, "installed")
Esempio n. 8
0
    def GenerateCrossFile(self):
        print("VGAZER: Generating Meson cross-build definition file...")
        ar = GetAr(self.platformData["target"])
        cc = GetCc(self.platformData["target"])
        cxx = GetCxx(self.platformData["target"])
        pkgConfig = GetPkgConfig(self.platformData["target"])
        strip = GetStrip(self.platformData["target"])
        llvmConfig = GetLlvmConfig(self.platformData["target"])
        genericOs = Platform.GetGenericOs(self.platformData["target"].GetOs())
        if self.platformData["target"].GetArch() in [
                "i386", "i486", "i586", "i686"
        ]:
            mesonCpuFamily = "x86"
            mesonCpu = self.platformData["target"].GetArch()
        elif self.platformData["target"].GetArch() == "x86_64":
            mesonCpuFamily = "x86_64"
            mesonCpu = "x86_64"
        else:
            raise UnknownTargetArch("Unknown target architecture: " +
                                    self.platformData["target"].GetArch())

        self.storeTemp.DirectoryWriteTextFile(
            "cross-file", "[binaries]\n"
            "c = '{cc}'\n"
            "cpp = '{cxx}'\n"
            "ar = '{ar}'\n"
            "strip = '{strip}'\n"
            "pkgconfig = '{pkgConfig}'\n"
            "llvm-config = '{llvmConfig}'\n"
            "\n"
            "[host_machine]\n"
            "system = '{genericOs}'\n"
            "cpu_family = '{mesonCpuFamily}'\n"
            "cpu = '{mesonCpu}'\n"
            "endian = 'little'".format(ar=ar,
                                       cc=cc,
                                       cxx=cxx,
                                       pkgConfig=pkgConfig,
                                       llvmConfig=llvmConfig,
                                       strip=strip,
                                       genericOs=genericOs,
                                       mesonCpuFamily=mesonCpuFamily,
                                       mesonCpu=mesonCpu))
Esempio n. 9
0
def Install(auth, software, platform, platformData, mirrors, verbose):
    installPrefix = GetInstallPrefix(platformData)
    cc = GetCc(platformData["target"])

    storeTemp = StoreTemp()
    storeTemp.ResolveEmptySubdirectory(software)
    tempPath = storeTemp.GetSubdirectoryPath(software)

    releases = auth["github"].GetJson(
        "https://api.github.com/repos/lm-sensors/lm-sensors/tags")

    if GithubCheckApiRateLimitExceeded(releases):
        raise GithubApiRateLimitExceeded(
            "Github API rate limit reached while searching last version of "
            "repo: lm-sensors/lm-sensors")

    tarballUrl = releases[1]["tarball_url"]
    tarballShortFilename = tarballUrl.split("/")[-1]

    try:
        with WorkingDir(tempPath):
            RunCommand(["wget", "-P", "./", tarballUrl], verbose)
            RunCommand([
                "tar", "--verbose", "--extract", "--gzip", "--file",
                tarballShortFilename
            ], verbose)
            output = GetCommandOutputUtf8(
                ["tar", "--list", "--file", tarballShortFilename])
        extractedDir = os.path.join(tempPath,
                                    output.splitlines()[0].split("/")[0])
        with WorkingDir(extractedDir):
            RunCommand(["make", "PREFIX=" + installPrefix, "CC=" + cc],
                       verbose)
            RunCommand(["make", "install"], verbose)
    except CommandError:
        print("VGAZER: Unable to install", software)
        raise InstallError(software + " not installed")

    print("VGAZER:", software, "installed")
Esempio n. 10
0
    def GenerateCrossFile(self):
        print("VGAZER: Generating CMake toolchain file...")
        cmakeOs = Platform.GetGenericOs(
            self.platformData["target"].GetOs()).capitalize()
        prefix = GetInstallPrefix(self.platformData)
        targetTriplet = GetTriplet(self.platformData["target"])

        cc = GetCc(self.platformData["target"])
        cxx = GetCxx(self.platformData["target"])

        if self.platformData["target"].PlatformsEqual(
                self.platformData["host"]):
            findMode = "BOTH"
        else:
            findMode = "ONLY"

        self.storeTemp.DirectoryWriteTextFile(
            "toolchain.cmake", "set(CMAKE_SYSTEM_NAME {cmakeOs})\n"
            "set(CMAKE_SYSTEM_PROCESSOR {cpu})\n"
            "set(CMAKE_C_COMPILER {cc})\n"
            "set(CMAKE_CXX_COMPILER {cxx})\n"
            "set(CMAKE_FIND_ROOT_PATH {prefix})\n"
            "SET("
            "ENV{{PKG_CONFIG_LIBDIR}} "
            "${{CMAKE_FIND_ROOT_PATH}}/lib/pkgconfig/:"
            "/usr/lib/{triplet}/pkgconfig"
            ")\n"
            "SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n"
            "SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY {findMode})\n"
            "SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE {findMode})".format(
                cmakeOs=cmakeOs,
                cpu=self.platformData["target"].GetArch(),
                cc=cc,
                cxx=cxx,
                prefix=prefix,
                triplet=targetTriplet,
                findMode=findMode))
Esempio n. 11
0
def Install(auth, software, platform, platformData, mirrors, verbose):
    installPrefix = GetInstallPrefix(platformData)
    targetTriplet = GetTriplet(platformData["target"])
    targetOs = platformData["target"].GetOs()

    cc = GetCc(platformData["target"])
    ar = GetAr(platformData["target"])
    strip = GetStrip(platformData["target"])

    storeTemp = StoreTemp()
    storeTemp.ResolveEmptySubdirectory(software)
    tempPath = storeTemp.GetSubdirectoryPath(software)

    sourceforgeMirrorsManager = mirrors["sourceforge"].CreateMirrorsManager(
        ["https", "http"])

    filename = requests.get(
        "https://sourceforge.net/projects/glew/best_release.json").json(
        )["release"]["filename"]
    tarballShortFilename = filename.split("/")[-1]

    try:
        with WorkingDir(tempPath):
            SourceforgeDownloadTarballWhileErrorcodeFour(
                sourceforgeMirrorsManager, "glew", filename, verbose)
            RunCommand([
                "tar", "--verbose", "--extract", "--gzip", "--file",
                tarballShortFilename
            ], verbose)
        extractedDir = os.path.join(tempPath, tarballShortFilename[0:-4])
        with WorkingDir(extractedDir):
            if targetOs == "windows":
                RunCommand([
                    "make", "glew.lib.static", "SYSTEM=linux-mingw64",
                    "HOST=" + targetTriplet, "AR=" + ar, "STRIP=" + strip,
                    "CFLAGS.EXTRA=-I" + installPrefix + "/include -fPIC",
                    "LDFLAGS.EXTRA=-L" + installPrefix + "/lib"
                ], verbose)
                RunCommand([
                    "make", "install.include", "SYSTEM=linux-mingw64",
                    "GLEW_PREFIX=" + installPrefix,
                    "GLEW_DEST=" + installPrefix
                ], verbose)
                if not os.path.exists(installPrefix + "/lib"):
                    RunCommand(["mkdir", "-p", installPrefix + "/lib"],
                               verbose)
                #if not os.path.exists(installPrefix + "/bin"):
                #RunCommand(["mkdir", "-p", installPrefix + "/bin"],
                #verbose)
                RunCommand(["cp", "lib/libglew32.a", installPrefix + "/lib"],
                           verbose)
                #RunCommand(["cp", "lib/glew32.dll", installPrefix + "/bin"],
                #verbose)
                RunCommand([
                    "make", "install.pkgconfig", "SYSTEM=linux-mingw64",
                    "GLEW_PREFIX=" + installPrefix,
                    "GLEW_DEST=" + installPrefix
                ], verbose)
            else:
                RunCommand([
                    "make", "glew.lib", "CC=" + cc, "LD=" + cc, "AR=" + ar,
                    "STRIP=" + strip,
                    "CFLAGS.EXTRA=-I" + installPrefix + "/include -fPIC",
                    "LDFLAGS.EXTRA=-L" + installPrefix + "/lib"
                ], verbose)
                RunCommand([
                    "make", "install", "GLEW_PREFIX=" + installPrefix,
                    "GLEW_DEST=" + installPrefix
                ], verbose)
    except CommandError:
        print("VGAZER: Unable to install", software)
        raise InstallError(software + " not installed")

    print("VGAZER:", software, "installed")
Esempio n. 12
0
def Install(auth, software, platform, platformData, mirrors, verbose):
    configCmake = ConfigCmake(platformData)
    configCmake.GenerateCrossFile()
    installPrefix = GetInstallPrefix(platformData)
    ar = GetArFullPath(platformData["target"])
    cc = GetCc(platformData["target"])
    os = platformData["target"].GetOs()
    soPrefix = GetSoPrefix(platformData)
    soFilename = GetSoFilename(platformData["target"], "SDL2_gpu")

    storeTemp = StoreTemp()
    storeTemp.ResolveEmptySubdirectory(software)
    tempPath = storeTemp.GetSubdirectoryPath(software)

    try:
        with WorkingDir(tempPath):
            RunCommand(
             ["git", "clone", "https://github.com/grimfang4/sdl-gpu.git",
              "sdl2-gpu"],
             verbose)
        clonedDir = os.path.join(tempPath, "sdl2-gpu")
        with WorkingDir(clonedDir):
            RunCommand(
             ["sed", "-i",
              "-e", '/\t\t\tlink_libraries (${GLEW_LIBRARIES})/i \t\t\tadd_definitions("-DGLEW_STATIC")',
              "./CMakeLists.txt"],
             verbose)
            RunCommand(["mkdir", "build"], verbose)
        sdlGpuHeader = os.path.join(clonedDir, "include/SDL_gpu.h")
        version = GetVersionFromSource(sdlGpuHeader)
        if os == "linux":
            soLibname = "libSDL2_gpu.so"
            installedLibPrefix = installPrefix + "/SDL_gpu-" + version + "/lib"
        elif os == "windows":
            soLibname = "libSDL2_gpu.dll"
            installedLibPrefix = installPrefix + "/SDL_gpu-MINGW-" + version + "/lib"
        buildDir = os.path.join(clonedDir, "build")
        with WorkingDir(buildDir):
            RunCommand(
             [cc, "-c", "../src/externals/stb_image/stb_image.c",
              "-o", "../src/externals/stb_image/stb_image.o", "-O2", "-Wall",
              "-mmmx", "-msse", "-msse2", "-mfpmath=sse", "-fPIC",
              "-I" + installPrefix + "/include"],
             verbose)
            RunCommand(
             [ar, "rcs", "../src/externals/stb_image/libstbi.a",
              "../src/externals/stb_image/stb_image.o"],
             verbose)
            RunCommand(
             [cc, "-c", "../src/externals/stb_image_write/stb_image_write.c",
              "-o", "../src/externals/stb_image_write/stb_image_write.o",
              "-O2", "-Wall", "-mmmx", "-msse", "-msse2", "-mfpmath=sse",
              "-fPIC", "-I" + installPrefix + "/include"],
             verbose)
            RunCommand(
             [ar, "rcs", "../src/externals/stb_image_write/libstbi_write.a",
              "../src/externals/stb_image_write/stb_image_write.o"],
             verbose)
            RunCommand(
             [
              "cmake", "..", "-G", "Unix Makefiles",
              "-DCMAKE_TOOLCHAIN_FILE=" + configCmake.GetCrossFileName(),
              "-DCMAKE_INSTALL_PREFIX=" + installPrefix,
              "-DSDL_gpu_INSTALL=ON", "-DSDL_gpu_BUILD_DEMOS=OFF",
              "-DSDL_gpu_USE_SYSTEM_GLEW=ON",
              "-DSTBI_INCLUDE_DIR=" + installPrefix + "/include",
              "-DSTBI_LIBRARY=" + buildDir
              + "/../src/externals/stb_image/libstbi.a",
              "-DSTBI_FOUND=TRUE",
              "-DSTBI_WRITE_INCLUDE_DIR=" + installPrefix + "/include",
              "-DSTBI_WRITE_LIBRARY=" + buildDir
              + "/../src/externals/stb_image_write/libstbi_write.a",
              "-DSTBI_WRITE_FOUND=TRUE",
              "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON", "-DCMAKE_AR=" + ar
             ],
             verbose)
            RunCommand(["make"], verbose)
            RunCommand(["make", "install"], verbose)
            RunCommand(
             ["mv", installedLibPrefix + "/" + soLibname,
              soPrefix + "/" + soFilename],
             verbose)
            RunCommand(
             ["mv", installedLibPrefix + "/libSDL2_gpu.a",
              installPrefix + "/lib/libSDL2_gpu.a"],
             verbose)
            RunCommand(
             ["rm", "-rf", installPrefix + "/SDL_gpu-" + version],
             verbose)
    except CommandError:
        print("VGAZER: Unable to install", software)
        raise InstallError(software + " not installed")

    print("VGAZER:", software, "installed")
Esempio n. 13
0
def Install(auth, software, platform, platformData, mirrors, verbose):
    isCrossbuild = not (platformData["target"].PlatformsEqual(
        platformData["host"]))
    hostBitness = GetBitness(platformData["host"])
    hostTriplet = GetTriplet(platformData["host"])
    hostCc = GetCc(platformData["host"])
    hostCxx = GetCxx(platformData["host"])
    hostOs = platformData["host"].GetOs()
    hostIcuPlatformName = GetIcuPlatformName(
        platformData["host"].GetGenericOs(hostOs))
    if isCrossbuild:
        hostInstallPrefix = "/usr/local"
        targetInstallPrefix = GetInstallPrefix(platformData)
        targetTriplet = GetTriplet(platformData["target"])
        targetCc = GetCc(platformData["target"])
        targetCxx = GetCxx(platformData["target"])
        targetOs = platformData["host"].GetOs()
        targetIcuPlatformName = GetIcuPlatformName(
            platformData["target"].GetGenericOs(targetOs))
    else:
        hostInstallPrefix = GetInstallPrefix(platformData)

    storeTemp = StoreTemp()
    storeTemp.ResolveEmptySubdirectory(software)
    tempPath = storeTemp.GetSubdirectoryPath(software)

    releases = auth["github"].GetJson(
        "https://api.github.com/repos/unicode-org/icu/releases")

    if GithubCheckApiRateLimitExceeded(releases):
        raise GithubApiRateLimitExceeded(
            "Github API rate limit reached while searching last version of "
            "repo: unicode-org/icu")

    tarballUrl = releases[0]["tarball_url"]
    tarballShortFilename = tarballUrl.split("/")[-1]

    try:
        with WorkingDir(tempPath):
            RunCommand(["wget", "-P", "./", tarballUrl], verbose)
            RunCommand([
                "tar", "--verbose", "--extract", "--gzip", "--file",
                tarballShortFilename
            ], verbose)
            output = GetCommandOutputUtf8(
                ["tar", "--list", "--file", tarballShortFilename])
        extractedDir = os.path.join(tempPath,
                                    output.splitlines()[0].split("/")[0])
        with WorkingDir(extractedDir):
            RunCommand(["mkdir", "icu4c/hostBuild"], verbose)
        hostBuildDir = os.path.join(extractedDir, "icu4c/hostBuild")
        with WorkingDir(hostBuildDir):
            RunCommand([
                "../source/runConfigureICU", hostIcuPlatformName,
                "--host=" + hostTriplet, "--prefix=" + hostInstallPrefix,
                "--disable-shared", "--enable-static=yes",
                "--enable-extras=no", "--enable-icuio=no",
                "--enable-layoutex=no", "--enable-tools", "--enable-tests=no",
                "--enable-samples=no", "--with-library-bits=" +
                str(hostBitness), "CC=" + hostCc, "CXX=" + hostCxx
            ], verbose)
            RunCommand(["make"], verbose)
            if not isCrossbuild:
                RunCommand(["make", "install"], verbose)
        if isCrossbuild:
            with WorkingDir(extractedDir):
                RunCommand(["mkdir", "icu4c/targetBuild"], verbose)
            targetBuildDir = os.path.join(extractedDir, "icu4c/targetBuild")
            with WorkingDir(targetBuildDir):
                RunCommand([
                    "../source/runConfigureICU", targetIcuPlatformName,
                    "--host=" + targetTriplet,
                    "--prefix=" + targetInstallPrefix,
                    "--with-cross-build=" + hostBuildDir, "--disable-shared",
                    "--enable-static=yes", "--enable-extras=no",
                    "--enable-icuio=no", "--enable-layoutex=no",
                    "--enable-tools", "--enable-tests=no",
                    "--enable-samples=no", "CC=" + targetCc, "CXX=" + targetCxx
                ], verbose)
                RunCommand(["make"], verbose)
                RunCommand(["make", "install"], verbose)
    except CommandError:
        print("VGAZER: Unable to install", software)
        raise InstallError(software + " not installed")

    print("VGAZER:", software, "installed")
Esempio n. 14
0
def Install(auth, software, platform, platformData, mirrors, verbose):
    installPrefix = GetInstallPrefix(platformData)

    cc = GetCc(platformData["target"])
    ar = GetAr(platformData["target"])

    storeTemp = StoreTemp()
    storeTemp.ResolveEmptySubdirectory(software)
    tempPath = storeTemp.GetSubdirectoryPath(software)

    releases = auth["github"].GetJson(
     "https://api.github.com/repos/svaarala/duktape/releases")

    if GithubCheckApiRateLimitExceeded(releases):
        raise GithubApiRateLimitExceeded(
         "Github API rate limit reached while searching last version of "
         "repo: svaarala/duktape"
        )

    tarballUrl = releases[0]["tarball_url"]
    tarballShortFilename = tarballUrl.split("/")[-1]

    try:
        with WorkingDir(tempPath):
            RunCommand(["wget", "-P", "./", tarballUrl], verbose)
            RunCommand(
             ["tar", "--verbose", "--extract", "--gzip", "--file",
              tarballShortFilename],
             verbose)
            output = GetCommandOutputUtf8(
             ["tar", "--list", "--file", tarballShortFilename]
            )
        extractedDir = os.path.join(tempPath,
         output.splitlines()[0].split("/")[0])
        with WorkingDir(extractedDir):
            RunCommand(["mkdir", "build"], verbose)
            RunCommand(
             ["python", "tools/configure.py", "--output-directory", "./build",
              "--rom-support", "--dll", "-DDUK_USE_FATAL_HANDLER"],
             verbose)
            RunCommand(
             [cc, "-Wall", "-mmmx", "-msse", "-msse2", "-mfpmath=sse", "-O2",
              "-fPIC", "-o", "./build/duktape.o", "-c", "./build/duktape.c"],
             verbose)
            RunCommand(
             [ar, "rcs", "./build/libduktape.a", "./build/duktape.o"],
             verbose)
            RunCommand(
             [cc, "-Wall", "-mmmx", "-msse", "-msse2", "-mfpmath=sse", "-O2",
              "-o", "./build/duk_module_node.o",
              "-c", "./extras/module-node/duk_module_node.c", "-I./build"],
             verbose)
            RunCommand(
             [ar, "rcs", "./build/libduk_module_node.a",
              "./build/duk_module_node.o"],
             verbose)
            if not os.path.exists(installPrefix + "/include"):
                RunCommand(["mkdir", "-p", installPrefix + "/include"],
                 verbose)
            if not os.path.exists(installPrefix + "/lib"):
                RunCommand(["mkdir", "-p", installPrefix + "/lib"], verbose)
            RunCommand(["sh", "-c",
             "cp ./build/*.h " + installPrefix + "/include"],
             verbose)
            RunCommand(
             ["cp", "./extras/module-node/duk_module_node.h",
              installPrefix + "/include"],
             verbose)
            RunCommand(["sh", "-c",
             "cp ./build/*.a " + installPrefix + "/lib"],
             verbose)
    except CommandError:
        print("VGAZER: Unable to install", software)
        raise InstallError(software + " not installed")

    print("VGAZER:", software, "installed")