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")
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) 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) 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 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")
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")
def Install(auth, software, platform, platformData, mirrors, verbose): installPrefix = GetInstallPrefix(platformData) ar = GetAr(platformData["target"]) cxx = GetCxx(platformData["target"]) storeTemp = StoreTemp() storeTemp.ResolveEmptySubdirectory(software) tempPath = storeTemp.GetSubdirectoryPath(software) archiveUrl = GetArchiveUrl(auth) arhiveShortFilename = archiveUrl.split("/")[-1] try: with WorkingDir(tempPath): RunCommand(["mkdir", "build"], verbose) buildDir = os.path.join(tempPath, "build") with WorkingDir(buildDir): RunCommand(["wget", "-P", "./", archiveUrl], verbose) RunCommand(["unzip", arhiveShortFilename], verbose) sourcesDir = os.path.join(buildDir, "Sources") with WorkingDir(sourcesDir): RunCommand([ "sed", "-i", "-e", "s/g++/$(CXX)/g", "-e", "s/\\tar/\\t$(AR)/g", "./makefile" ], verbose) RunCommand(["mkdir", "-p", "./../Binaries"], verbose) RunCommand(["mkdir", "-p", "./../Binaries/Temp"], verbose) RunCommand( ["make", "./../Binaries/libP7.so", "CXX=" + cxx, "AR=" + ar], verbose) with WorkingDir(buildDir): 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 ./Headers/*.h " + installPrefix + "/include"], verbose) RunCommand(["cp", "./Binaries/libP7.so", 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) 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")
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))
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")
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")