def Install(auth, software, platform, platformData, mirrors, verbose): installPrefix = GetInstallPrefix(platformData) targetTriplet = GetTriplet(platformData["target"]) storeTemp = StoreTemp() storeTemp.ResolveEmptySubdirectory(software) tempPath = storeTemp.GetSubdirectoryPath(software) tarballUrl = GetTarballUrl() tarballShortFilename = tarballUrl.split("/")[-1] try: with WorkingDir(tempPath): RunCommand( ["wget", "-P", "./", "-O", tarballShortFilename, tarballUrl], verbose) RunCommand([ "tar", "--verbose", "--extract", "--gzip", "--file", tarballShortFilename ], verbose) extractedDir = os.path.join(tempPath, tarballShortFilename[0:-7]) with WorkingDir(extractedDir): RunCommand([ "./configure", "--host=" + targetTriplet, "--prefix=" + installPrefix, "--disable-sdltest", "CPPFLAGS=-I" + installPrefix + "/include", "LDFLAGS=-L" + installPrefix + "/lib" ], 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) version = GetVersion() tarballUrl = "http://www.ijg.org/files/jpegsrc.v" + version + ".tar.gz" tarballShortFilename = tarballUrl.split("/")[-1] try: with WorkingDir(tempPath): RunCommand( ["wget", "-P", "./", "-O", tarballShortFilename, tarballUrl], verbose) RunCommand( ["tar", "--verbose", "--extract", "--gzip", "--file", tarballShortFilename], verbose) extractedDir = os.path.join(tempPath, "jpeg-" + version) with WorkingDir(extractedDir): RunCommand( ["./configure", "--host=" + targetTriplet, "--prefix=" + installPrefix, "--disable-shared"], 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) sourceforgeMirrorsManager = mirrors["sourceforge"].CreateMirrorsManager( ["https", "http"]) filename = requests.get( "https://sourceforge.net/projects/pcre/best_release.json").json( )["release"]["filename"] arhiveShortFilename = filename.split("/")[-1] try: with WorkingDir(tempPath): SourceforgeDownloadTarballWhileErrorcodeFour( sourceforgeMirrorsManager, "pcre", filename, verbose) RunCommand(["unzip", arhiveShortFilename], verbose) extractedDir = os.path.join(tempPath, arhiveShortFilename[0:-4]) with WorkingDir(extractedDir): RunCommand([ "./configure", "--prefix=" + installPrefix, "--host=" + targetTriplet, "--enable-pcre2-16", "--enable-pcre2-32", "--enable-jit=auto", "--enable-newline-is-any" ], 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) try: with WorkingDir(tempPath): RunCommand( ["git", "clone", "https://github.com/criptych/physfs.git"], verbose) clonedDir = os.path.join(tempPath, "physfs") with WorkingDir(clonedDir): RunCommand(["mkdir", "build"], verbose) buildDir = os.path.join(clonedDir, "build") with WorkingDir(buildDir): RunCommand([ "cmake", "..", "-DCMAKE_TOOLCHAIN_FILE=" + configCmake.GetCrossFileName(), "-DCMAKE_INSTALL_PREFIX=" + installPrefix, "-DPHYSFS_BUILD_SHARED=FALSE", "-DPHYSFS_BUILD_TEST=FALSE", "-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) targetTriplet = GetTriplet(platformData["target"]) storeTemp = StoreTemp() storeTemp.ResolveEmptySubdirectory(software) tempPath = storeTemp.GetSubdirectoryPath(software) tarballUrl = requests.get( "https://sourceforge.net/projects/modplug-xmms/best_release.json" ).json()["release"]["url"] tarballShortFilename = tarballUrl.split("/")[-2] try: with WorkingDir(tempPath): RunCommand( ["wget", "-P", "./", "-O", tarballShortFilename, tarballUrl], verbose) RunCommand([ "tar", "--verbose", "--extract", "--gzip", "--file", tarballShortFilename ], verbose) extractedDir = os.path.join(tempPath, tarballShortFilename[0:-7]) with WorkingDir(extractedDir): RunCommand([ "./configure", "--host=" + targetTriplet, "--prefix=" + installPrefix, "--enable-static=yes", "--disable-shared" ], 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) tarballUrl = GetTarballUrl() tarballShortFilename = tarballUrl.split("/")[-1] 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): RunCommand([ "./configure", "--prefix=" + installPrefix, "--host=" + targetTriplet, "--enable-pcre16", "--enable-pcre32", "--enable-jit=auto", "--enable-newline-is-any", "--enable-utf", "--enable-unicode-properties" ], 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) xorgMirrorsManager = mirrors["xorg"].CreateMirrorsManager( ["https", "http"]) tarballUrl = GetTarballUrl(xorgMirrorsManager) tarballShortFilename = tarballUrl.split("/")[-1] 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): RunCommand( ["./configure", "--host=" + targetTriplet, "--prefix=" + installPrefix], 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"]) + " rcu" # cc = GetCc(platformData["target"]) triplet = GetTriplet(platformData["target"]) # 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", "BUILDMODE=static", "CROSS=" + triplet + "-", "TARGET_SYS=" + platformData["target"].GetOs().capitalize() ], verbose) RunCommand(["make", "install", "PREFIX=" + installPrefix], verbose) # 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")
def Install(auth, software, platform, platformData, mirrors, verbose): installPrefix = GetInstallPrefix(platformData) targetTriplet = GetTriplet(platformData["target"]) # 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/AltSysrq/libbsd-minimal.git" ], verbose) clonedDir = os.path.join(tempPath, "libbsd-minimal") with WorkingDir(clonedDir): RunCommand(["libtoolize"], verbose) RunCommand(["aclocal"], verbose) RunCommand(["autoheader"], verbose) # RunCommand(["automake"], verbose) RunCommand(["automake", "--add-missing"], verbose) RunCommand(["autoreconf"], verbose) RunCommand([ "./configure", "--host=" + targetTriplet, "--prefix=" + installPrefix, "--disable-shared", "CFLAGS=-D__THROW= -include features.h" ], verbose) RunCommand([ "sed", "-i", "s" "/#define __nonnull(x)\t__attribute__((__nonnull__(x)))" "/#define __nonnull(x) __attribute__((__nonnull__ x))" "/g", "include/bsd/sys/freebsd-cdefs.h" ], verbose) RunCommand(["make", "V=1"], verbose) RunCommand(["make", "install"], verbose) # 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")
def Install(auth, software, platform, platformData, mirrors, verbose): installPrefix = GetInstallPrefix(platformData) targetTriplet = GetTriplet(platformData["target"]) pkgConfig = GetPkgConfig(platformData["target"]) storeTemp = StoreTemp() storeTemp.ResolveEmptySubdirectory(software) tempPath = storeTemp.GetSubdirectoryPath(software) tarballUrl = GetTarballUrl() tarballShortFilename = tarballUrl.split("/")[-1] try: with WorkingDir(tempPath): RunCommand( ["wget", "-P", "./", "-O", tarballShortFilename, tarballUrl], verbose) RunCommand([ "tar", "--verbose", "--extract", "--gzip", "--file", tarballShortFilename ], verbose) extractedDir = os.path.join(tempPath, tarballShortFilename[0:-7]) with WorkingDir(extractedDir): #tiffLibs = GetCommandOutputUtf8( #[pkgConfig, "--libs", "--static", "libtiff-4"], verbose=False) #RunCommand( #["sed", "-i", #"-e", "s/" #"AC_CHECK_LIB(" #"[tiff], [TIFFClientOpen], [have_tif_lib=yes], [], [-lz]" #")/" #"AC_CHECK_LIB(" #"[tiff], [TIFFClientOpen], [have_tif_lib=yes], [], " #"[" + tiffLibs + "]" #")/g", #"./configure.in"], #verbose) #RunCommand(["./autogen.sh"], verbose) RunCommand([ "./configure", "--host=" + targetTriplet, "--prefix=" + installPrefix, "--disable-sdltest", "CPPFLAGS=-I" + installPrefix + "/include", "LDFLAGS=-L" + installPrefix + "/lib" ], 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/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): installPrefix = GetInstallPrefix(platformData) url = "https://raw.githubusercontent.com/mackron/dr_libs/master/dr_wav.h" try: if not os.path.exists(installPrefix + "/include"): RunCommand(["mkdir", "-p", installPrefix + "/include"], verbose) RunCommand(["wget", "-P", installPrefix + "/include", url], 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) tarballUrl = requests.get( "https://sourceforge.net/projects/mpg123/best_release.json").json( )["release"]["url"] tarballShortFilename = tarballUrl.split("/")[-2] if platformData["target"].GetArch() == "i386": cpu = "i386_fpu" elif platformData["target"].GetArch() == "i486": cpu = "i486" elif platformData["target"].GetArch() in ["i586", "i686"]: cpu = "i586_dither" elif platformData["target"].GetArch() == "x86_64": cpu = "x86-64" else: raise UnknownTargetArch("Unknown target architecture: " + platformData["target"].GetArch()) try: with WorkingDir(tempPath): RunCommand( ["wget", "-P", "./", "-O", tarballShortFilename, tarballUrl], verbose) RunCommand([ "tar", "--verbose", "--extract", "--bzip2", "--file", tarballShortFilename ], verbose) extractedDir = os.path.join(tempPath, tarballShortFilename[0:-8]) with WorkingDir(extractedDir): RunCommand([ "./configure", "--host=" + targetTriplet, "--prefix=" + installPrefix, "--enable-nagging=no", "--enable-ipv6=yes", "--enable-network=yes", "--with-cpu=" + cpu, "--with-audio=dummy", "--with-default-audio=dummy" ], 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 InstallStb(library, platformData, verbose): installPrefix = GetInstallPrefix(platformData) url = ("https://raw.githubusercontent.com/nothings/stb/master/" + library + ".h") try: if not os.path.exists(installPrefix + "/include"): RunCommand(["mkdir", "-p", installPrefix + "/include"], verbose) RunCommand(["wget", "-P", installPrefix + "/include", url], verbose) except CommandError: print("VGAZER: Unable to install", library) raise InstallError(library + " not installed") print("VGAZER:", library, "installed")
def InstallPip3(software, package, verbose): try: RunCommand(["pip3", "install", package, "--no-cache-dir"], verbose) except CommandError: print("VGAZER: Unable to install", software) raise InstallError(software + " not installed") print("VGAZER:", software, "installed")
def InstallApk(software, package, verbose): try: RunCommand(["apk", "add", "--no-cache", package], 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) 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")
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 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/robertvazan/crc32c-hw/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/ar rcs/$(AR) rcs/g", "Makefile"], verbose) RunCommand(["sed", "-i", "s/()/(void)/g", "crc32c/crc32c.h"], verbose) RunCommand(["make", "build", "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", "libcrc32c.a", installPrefix + "/lib"], verbose) RunCommand(["cp", "crc32c/crc32c.h", installPrefix + "/include"], 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) xorgMirrorsManager = mirrors["xorg"].CreateMirrorsManager( ["https", "http"]) tarballUrl = GetTarballUrl(xorgMirrorsManager, suburl="individual/lib/", projectName="xlib", linksMustHave=["libX11-", ".tar.gz"], linksMustNotHave=[".sig"]) tarballShortFilename = tarballUrl.split("/")[-1] 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): RunCommand( [ "./configure", "--host=" + targetTriplet, "--prefix=" + installPrefix, "CPPFLAGS=-I" + installPrefix + "/include", "PKG_CONFIG_PATH={installPrefix}/lib/pkgconfig:" "{installPrefix}/share/pkgconfig".format( installPrefix=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 InstallPackageFromBackport(software, package, hostPlatform, verbose): try: RunCommand([ "apt-get", "-t", hostPlatform.GetOsVersion() + "-backports", "install", "-y", package ], verbose) except CommandError: print("VGAZER: Unable to install", software) raise InstallError(software + " not installed")
def InstallPackage(software, package, hostPlatform, verbose): try: RunCommand(["apt-get", "install", "-y", package], verbose) except CommandError as e: if e.errorcode == 100 and hostPlatform.GetOs() == "debian": InstallPackageFromBackport(software, package, hostPlatform, verbose) else: print("VGAZER: Unable to install", software) raise InstallError(software + " not installed")
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 InstallLinuxHeaders(auth, platformData, verbose): installPrefix = GetInstallPrefix(platformData) kernelArch = platformData["target"].GetArch() storeTemp = StoreTemp() storeTemp.ResolveEmptySubdirectory("linux-headers-" + platformData["target"].GetArch()) tempPath = storeTemp.GetSubdirectoryPath("linux-headers-" + platformData["target"].GetArch()) if (GetFilesystemType(tempPath) == "overlay" and platformData["host"].GetOs() == "debian"): kernelTar = "bsdtar" else: kernelTar = "tar" kernelTarballUrl = GetLastKernelUrl(auth) kernelTarballShortFilename = kernelTarballUrl.split("/")[-1] kernelExtractedDir = kernelTarballShortFilename[0:-7] try: with WorkingDir(tempPath): RunCommand(["wget", "-P", "./", kernelTarballUrl], verbose) RunCommand([ kernelTar, "--verbose", "--extract", "--file", kernelTarballShortFilename ], verbose) linuxHeadersDir = os.path.join(tempPath, kernelExtractedDir) with WorkingDir(linuxHeadersDir): RunCommand([ "make", "ARCH=" + kernelArch, "INSTALL_HDR_PATH=" + installPrefix, "headers_install" ], verbose) except CommandError: print("VGAZER: Unable to install", "linux-headers-" + platformData["target"].GetArch()) raise InstallError("linux-headers-" + platformData["target"].GetArch() + " not installed") print("VGAZER:", "linux-headers-" + platformData["target"].GetArch(), "installed")
def Install(auth, software, platform, platformData, mirrors, verbose): configMeson = ConfigMeson(platformData) configMeson.GenerateCrossFile() installPrefix = GetInstallPrefix(platformData) storeTemp = StoreTemp() storeTemp.ResolveEmptySubdirectory(software) tempPath = storeTemp.GetSubdirectoryPath(software) tarballUrl = GetTarballUrl() tarballShortFilename = tarballUrl.split("/")[-1] try: with WorkingDir(tempPath): RunCommand( ["wget", "-P", "./", "-O", tarballShortFilename, tarballUrl], verbose) RunCommand([ "tar", "--verbose", "--extract", "--xz", "--file", tarballShortFilename ], verbose) SetEnvVar("PKG_CONFIG_PATH", installPrefix + "/lib/pkgconfig") extractedDir = os.path.join(tempPath, tarballShortFilename[0:-7]) with WorkingDir(extractedDir): RunCommand([ "meson", "_build", "-Dprefix=" + installPrefix, "--libdir=" + installPrefix + "/lib", "--cross-file", configMeson.GetCrossFileName(), "-Dbuildtype=release", "-Ddefault_library=shared", "-Doptimization=2", "-Dstrip=true", "-Dforce_posix_threads=true", "-Dinternal_pcre=false", "-Dgtk_doc=false", "-Dman=false", "-Db_coverage=false", "-Dlibmount=true", "-Dxattr=true" ], verbose) RunCommand(["ninja", "-C", "_build"], verbose) RunCommand(["ninja", "-C", "_build", "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 InstallApt(software, packages, postInstallCommands, hostPlatform, verbose): if isinstance(packages, list): for package in packages: InstallPackage(software, package, hostPlatform, verbose) else: InstallPackage(software, packages, hostPlatform, verbose) if postInstallCommands is not None: for command in postInstallCommands: RunCommand(command, verbose) 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) sourceforgeMirrorsManager = mirrors["sourceforge"].CreateMirrorsManager( ["https", "http"]) filename = requests.get( "https://sourceforge.net/projects/libpng/best_release.json").json( )["release"]["filename"] tarballShortFilename = filename.split("/")[-1] try: with WorkingDir(tempPath): SourceforgeDownloadTarballWhileErrorcodeFour( sourceforgeMirrorsManager, "libpng", filename, verbose) RunCommand([ "tar", "--verbose", "--extract", "--xz", "--file", tarballShortFilename ], verbose) extractedDir = os.path.join(tempPath, tarballShortFilename[0:-7]) with WorkingDir(extractedDir): RunCommand([ "./configure", "--host=" + targetTriplet, "--prefix=" + installPrefix, "--disable-shared", "--enable-hardware-optimizations=yes", "CPPFLAGS=-I" + installPrefix + "/include", "LDFLAGS=-L" + installPrefix + "/lib" ], 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["base"].GetJson( "https://gitlab.freedesktop.org/api/v4/projects/715/repository/tags") tarballUrl = ( "https://gitlab.freedesktop.org/api/v4/projects/715/repository/" "archive.tar.gz?sha=" + tags[0]["name"]) 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) 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")