def Install(auth, software, platform, platformData, mirrors, verbose): configCmake = ConfigCmake(platformData) configCmake.GenerateCrossFile() installPrefix = GetInstallPrefix(platformData) ar = GetArFullPath(platformData["target"]) storeTemp = StoreTemp() storeTemp.ResolveEmptySubdirectory(software) tempPath = storeTemp.GetSubdirectoryPath(software) releases = auth["github"].GetJson( "https://api.github.com/repos/jtanx/libclipboard/releases") if GithubCheckApiRateLimitExceeded(releases): raise GithubApiRateLimitExceeded( "Github API rate limit reached while searching last version of " "repo: jtanx/libclipboard") 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) buildDir = os.path.join(extractedDir, "build") with WorkingDir(buildDir): RunCommand([ "sed", "-i", "s" "# include/libclipboard-config.h" "# ${CMAKE_BINARY_DIR}/include/libclipboard-config.h" "#g", "../CMakeLists.txt" ], verbose) RunCommand([ "cmake", "..", "-DCMAKE_TOOLCHAIN_FILE=" + configCmake.GetCrossFileName(), "-DCMAKE_INSTALL_PREFIX=" + installPrefix, "-DCMAKE_C_FLAGS=-std=c99 -Wall -pedantic -g -I./include " "-I../include -D_POSIX_C_SOURCE=199309L", "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON", "-DCMAKE_AR=" + ar ], 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")
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")
def Install(auth, software, platform, platformData, mirrors, verbose): installPrefix = GetInstallPrefix(platformData) targetTriplet = GetTriplet(platformData["target"]) storeTemp = StoreTemp() storeTemp.ResolveEmptySubdirectory(software) tempPath = storeTemp.GetSubdirectoryPath(software) tags = auth["github"].GetJson( "https://api.github.com/repos/freedesktop/xorg-libpciaccess/tags") if GithubCheckApiRateLimitExceeded(tags): raise GithubApiRateLimitExceeded( "Github API rate limit reached while searching last version of " "repo: freedesktop/xorg-libpciaccess") tagNum = 0 for tag in tags: if tag["name"] in [ "xf86-video-xgi-0.9.1", ]: tagNum = tagNum + 1 else: break tarballUrl = tags[tagNum]["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([ "./autogen.sh", "--host=" + targetTriplet, "--prefix=" + installPrefix ], 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")
def Install(auth, software, platform, platformData, mirrors, verbose): configCmake = ConfigCmake(platformData) configCmake.GenerateCrossFile() installPrefix = GetInstallPrefix(platformData) storeTemp = StoreTemp() storeTemp.ResolveEmptySubdirectory(software) tempPath = storeTemp.GetSubdirectoryPath(software) releases = auth["github"].GetJson( "https://api.github.com/repos/harfbuzz/harfbuzz/releases") if GithubCheckApiRateLimitExceeded(releases): raise GithubApiRateLimitExceeded( "Github API rate limit reached while searching last version of " "repo: harfbuzz/harfbuzz") 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) buildDir = os.path.join(extractedDir, "build") with WorkingDir(buildDir): RunCommand([ "cmake", "..", "-DCMAKE_TOOLCHAIN_FILE=" + configCmake.GetCrossFileName(), "-DCMAKE_INSTALL_PREFIX=" + installPrefix, "-DHB_HAVE_FREETYPE=ON", "-DHB_HAVE_GRAPHITE2=ON", "-DHB_HAVE_GLIB=ON", "-DHB_HAVE_ICU=ON", "-DHB_BUILD_TESTS=OFF", "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON" ], 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")
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")
def CheckGithub(auth, user, repo, ignoreReleases, ignoredTags): if ignoreReleases: return CheckLastCommit(auth, user, repo) releases = auth.GetJson( "https://api.github.com/repos/" + user + "/" + repo + "/releases") if GithubCheckApiRateLimitExceeded(releases): raise GithubApiRateLimitExceeded( "Github API rate limit reached while searching last version of " "repo: " + user + "/" + repo ) if len(releases) != 0: return utils.GetVersionFromTag(releases[0]["tag_name"]) tags = auth.GetJson( "https://api.github.com/repos/" + user + "/" + repo + "/tags") if GithubCheckApiRateLimitExceeded(tags): raise GithubApiRateLimitExceeded( "Github API rate limit reached while searching last version of " "repo: " + user + "/" + repo ) tagNum = 0 for tag in tags: if tag["name"] in ignoredTags: tagNum = tagNum + 1 else: break if len(tags) != 0: return utils.GetVersionFromTag(tags[tagNum]["name"]) return CheckLastCommit(auth, user, repo)
def CheckLastCommit(auth, user, repo): commits = auth.GetJson( "https://api.github.com/repos/" + user + "/" + repo + "/commits") if GithubCheckApiRateLimitExceeded(commits): raise GithubApiRateLimitExceeded( "Github API rate limit reached while searching last commit info of " "repo: " + user + "/" + repo ) lastCommitDateTime = commits[0]["commit"]["author"]["date"] date = lastCommitDateTime.split("T")[0] time = lastCommitDateTime.split("T")[1].split("Z")[0] return "commit on " + date + " " + time
def Install(auth, software, platform, platformData, mirrors, verbose): installPrefix = GetInstallPrefix(platformData) targetTriplet = GetTriplet(platformData["target"]) storeTemp = StoreTemp() storeTemp.ResolveEmptySubdirectory(software) tempPath = storeTemp.GetSubdirectoryPath(software) releases = auth["github"].GetJson( "https://api.github.com/repos/intel/libva/releases") if GithubCheckApiRateLimitExceeded(releases): raise GithubApiRateLimitExceeded( "Github API rate limit reached while searching last version of " "repo: intel/libva" ) 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( ["./autogen.sh", "--host=" + targetTriplet, "--prefix=" + installPrefix, "PKG_CONFIG_PATH=" + installPrefix + "/lib/pkgconfig"], 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")
def CheckMuslCrossMake(auth): tags = auth.GetJson( "https://api.github.com/repos/richfelker/musl-cross-make/tags") if GithubCheckApiRateLimitExceeded(tags): raise GithubApiRateLimitExceeded( "Github API rate limit reached while searching last version of gcc in" "repo: richfelker/musl-cross-make") lastVersionCommitSha = tags[0]["commit"]["sha"] lastVersionCommitMakefileUrl = ( "https://raw.githubusercontent.com/richfelker/musl-cross-make/" + lastVersionCommitSha + "/Makefile") response = requests.get(lastVersionCommitMakefileUrl) html = response.content.decode("utf-8") lines = html.splitlines() for line in lines: if line.startswith("GCC_VER"): return line.split("=")[1][1:]
def Install(auth, software, platform, platformData, mirrors, verbose): storeTemp = StoreTemp() storeTemp.ResolveEmptySubdirectory(software) tempPath = storeTemp.GetSubdirectoryPath(software) tags = auth["github"].GetJson( "https://api.github.com/repos/freedesktop/xorg-macros/tags") if GithubCheckApiRateLimitExceeded(tags): raise GithubApiRateLimitExceeded( "Github API rate limit reached while searching last version of " "repo: freedesktop/xorg-macros" ) 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(["./autogen.sh"], verbose) RunCommand(["make", "install"], verbose) except CommandError: print("VGAZER: Unable to install", software) raise InstallError(software + " not installed") print("VGAZER:", software, "installed")
def Install(auth, software, platform, platformData, mirrors, verbose): targetOs = platformData["target"].GetOs() if targetOs == "linux": configCmake = ConfigCmake(platformData) configCmake.GenerateCrossFile() elif targetOs == "windows": targetTriplet = GetTriplet(platformData["target"]) pkgConfig = GetPkgConfig(platformData["target"]) else: raise UnknownOs("Unknown OS: " + targetOs) installPrefix = GetInstallPrefix(platformData) storeTemp = StoreTemp() storeTemp.ResolveEmptySubdirectory(software) tempPath = storeTemp.GetSubdirectoryPath(software) releases = auth["github"].GetJson( "https://api.github.com/repos/libts/tslib/releases") if GithubCheckApiRateLimitExceeded(releases): raise GithubApiRateLimitExceeded( "Github API rate limit reached while searching last version of " "repo: libts/tslib") 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) if targetOs == "windows": RunCommand(["./autogen.sh"], verbose) buildDir = os.path.join(extractedDir, "build") with WorkingDir(buildDir): if targetOs == "linux": RunCommand([ "cmake", "..", "-DCMAKE_TOOLCHAIN_FILE=" + configCmake.GetCrossFileName(), "-DCMAKE_INSTALL_PREFIX=" + installPrefix, "-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON", "-DENABLE_TOOLS=OFF" ], verbose) RunCommand(["cmake", "--build", "."], verbose) RunCommand(["cmake", "-P", "cmake_install.cmake"], verbose) elif targetOs == "windows": RunCommand([ "../configure", "--host=" + targetTriplet, "--prefix=" + installPrefix, "--disable-input", "--disable-touchkit", "--disable-waveshare", "PKG_CONFIG=" + pkgConfig ], 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")
def InstallMuslCrossMake(auth, software, languages, triplet, platformData, verbose): storeTemp = StoreTemp() storeTemp.ResolveEmptySubdirectory(software) tempPath = storeTemp.GetSubdirectoryPath(software) if (GetFilesystemType(tempPath) == "overlay" and platformData["host"].GetOs() == "debian"): useBsdTar = True else: useBsdTar = False tags = auth.GetJson( "https://api.github.com/repos/richfelker/musl-cross-make/tags") if GithubCheckApiRateLimitExceeded(tags): raise GithubApiRateLimitExceeded( "Github API rate limit reached while searching tarball url in repo: " "richfelker/musl-cross-make") tarballUrl = tags[0]["tarball_url"] tarballShortFilename = "musl-cross-make.tar.gz" try: with WorkingDir(tempPath): RunCommand( ["wget", "-P", "./", "-O", tarballShortFilename, 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( ["sh", "-c", "echo 'TARGET = " + triplet + "' > config.mak"], verbose) RunCommand( ["sh", "-c", "echo 'OUTPUT = /usr/local' >> config.mak"], verbose) RunCommand([ "sh", "-c", "echo 'COMMON_CONFIG += CFLAGS=\"-g0 -Os\" " "CXXFLAGS=\"-g0 -Os\" LDFLAGS=\"-s\"' >> config.mak" ], verbose) RunCommand([ "sh", "-c", "echo 'GCC_CONFIG += --enable-languages=" + languages + "' >> config.mak" ], verbose) RunCommand([ "sh", "-c", "echo 'GCC_CONFIG += --disable-multilib' >> config.mak" ], verbose) if useBsdTar: RunCommand([ "sed", "-i", "-e", r"s/\(tar z\|tar j\|tar J\)/bsdtar /g", "./Makefile" ], 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")
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")
def Install(auth, software, platform, platformData, mirrors, verbose): installPrefix = GetInstallPrefix(platformData) targetTriplet = GetTriplet(platformData["target"]) storeTemp = StoreTemp() storeTemp.ResolveEmptySubdirectory(software) tempPath = storeTemp.GetSubdirectoryPath(software) tags = auth["github"].GetJson( "https://api.github.com/repos/freedesktop/libXext/tags") if GithubCheckApiRateLimitExceeded(tags): raise GithubApiRateLimitExceeded( "Github API rate limit reached while searching last version of " "repo: freedesktop/libXext" ) tagNum = 0 for tag in tags: if tag["name"] in [ "xo-6_7_0", "xf86-012804-2330", "xf86-4_4_99_1", "xf86-4_4_0", "xf86-4_3_99_903", "xf86-4_3_99_903_special", "xf86-4_3_99_902", "xf86-4_3_99_901", "xf86-4_3_99_16", "xf86-4_3_0_1", "sco_port_update-base", "rel-0-6-1", "lg3d-rel-0-7-0", ]: tagNum = tagNum + 1 else: break tarballUrl = tags[tagNum]["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( ["./autogen.sh", "--host=" + targetTriplet, "--prefix=" + installPrefix, "PKG_CONFIG_PATH=" + installPrefix + "/lib/pkgconfig"], 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")
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")