Correzione percorsi, creazione altre cartelle necessarie.
This commit is contained in:
parent
29984163c3
commit
ef7202a7c6
19
build.py
19
build.py
|
@ -68,7 +68,7 @@ class Build(object):
|
||||||
#buildtarballs.extend([ x for x in self.__tarballs__ if ('helppack_'+ lang) in x ])
|
#buildtarballs.extend([ x for x in self.__tarballs__ if ('helppack_'+ lang) in x ])
|
||||||
|
|
||||||
# Creating a subfolder
|
# Creating a subfolder
|
||||||
os.makedirs(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppImage'), exist_ok = True)
|
os.makedirs(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppDir'), exist_ok = True)
|
||||||
# And then cd to the appname folder.
|
# And then cd to the appname folder.
|
||||||
os.chdir(os.path.join(self.__builddir__, self.__appname__))
|
os.chdir(os.path.join(self.__builddir__, self.__appname__))
|
||||||
|
|
||||||
|
@ -77,18 +77,19 @@ class Build(object):
|
||||||
subprocess.run("tar xzf ../%s" % archive, shell=True)
|
subprocess.run("tar xzf ../%s" % archive, shell=True)
|
||||||
|
|
||||||
# At this point, let's decompress the deb packages
|
# At this point, let's decompress the deb packages
|
||||||
os.chdir(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppImage'))
|
os.chdir(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppDir'))
|
||||||
subprocess.run("find .. -iname '*.deb' -exec dpkg -x {} . \;", shell=True)
|
subprocess.run("find .. -iname '*.deb' -exec dpkg -x {} . \;", shell=True)
|
||||||
# Changing desktop file
|
# Changing desktop file
|
||||||
subprocess.run("find . -iname startcenter.desktop -exec cp {} . \;", shell=True)
|
subprocess.run("find . -iname startcenter.desktop -exec cp {} . \;", shell=True)
|
||||||
subprocess.run("sed -i -e 's|Name=.*|Name=%s|g' startcenter.desktop" % self.__appname__, shell=True)
|
subprocess.run("sed -i -e 's|Name=.*|Name=%s|g' startcenter.desktop" % self.__appname__, shell=True)
|
||||||
subprocess.run("find . -name startcenter.png -path '*hicolor*48x48*' -exec cp {} \;", shell=True)
|
subprocess.run("find . -name startcenter.png -path '*hicolor*48x48*' -exec cp {} \;", shell=True)
|
||||||
|
|
||||||
binaryname = subprocess.check_output("awk 'BEGIN { FS = \"=\" } /^Exec/ { print $2; exit }' startcenter.desktop | awk '{ print $1 }'", shell=True).strip('\n')
|
binaryname = subprocess.check_output("awk 'BEGIN { FS = \"=\" } /^Exec/ { print $2; exit }' startcenter.desktop | awk '{ print $1 }'", shell=True).decode('utf-8').strip('\n')
|
||||||
subprocess.run("rm -f usr/bin/%s" % binaryname, shell=True)
|
os.makedirs(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppDir', 'usr', 'bin'))
|
||||||
os.chdir(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppImage', 'usr', 'bin'))
|
|
||||||
|
os.chdir(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppDir', 'usr', 'bin'))
|
||||||
subprocess.run("find ../../opt -name soffice -path '*programm*' -exec ln -s {} %si \;" % binaryname, shell=True)
|
subprocess.run("find ../../opt -name soffice -path '*programm*' -exec ln -s {} %si \;" % binaryname, shell=True)
|
||||||
os.chdir(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppImage'))
|
os.chdir(os.path.join(self.__builddir__, self.__appname__, self.__appname__ + '.AppDir'))
|
||||||
|
|
||||||
# Download AppRun from github
|
# Download AppRun from github
|
||||||
apprunurl = "https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-{arch}".format(arch = self.__arch__)
|
apprunurl = "https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-{arch}".format(arch = self.__arch__)
|
||||||
|
@ -109,11 +110,7 @@ class Build(object):
|
||||||
# Copying built image to final directory
|
# Copying built image to final directory
|
||||||
subprocess.run("find . -iname '*.AppImage' -exec cp {} %s \;" % outdir, shell = True)
|
subprocess.run("find . -iname '*.AppImage' -exec cp {} %s \;" % outdir, shell = True)
|
||||||
os.chdir('/tmp')
|
os.chdir('/tmp')
|
||||||
|
del self.__builddir__
|
||||||
def __del__(self):
|
|
||||||
"""Destructor for the class."""
|
|
||||||
# Cleanup
|
|
||||||
del self.__builddir__
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue