23 lines
638 B
Python
23 lines
638 B
Python
#!/usr/bin/env python3
|
|
|
|
|
|
import os
|
|
import shutil
|
|
import subprocess
|
|
import tempfile
|
|
import sys
|
|
|
|
|
|
def getLibs(name, branch, arch):
|
|
buildDir = tempfile.gettempdir() + "/" + "".join(map(lambda x: hex(x)[2:], os.urandom(32)))
|
|
print("Build dir to get libs: " + buildDir)
|
|
try:
|
|
subprocess.check_call(["flatpak", "build-init", "--arch=" + arch, buildDir, "tmp.tmp.Tmp", name, name, branch])
|
|
subprocess.check_call(["sh", "-c", "flatpak build " + repr(buildDir) + " tar -caz /usr/lib > libs.tar.gz"])
|
|
finally:
|
|
shutil.rmtree(buildDir)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
getLibs(sys.argv[1], sys.argv[2], "i386")
|