Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 08ca836a rédigé par Kubat's avatar Kubat
Parcourir les fichiers

[build] A working appimage build

To generate the AppImage the libraries from the host system will
be used (if it worked on my machine it should works on your machine).

All libraries are copied into the AppImage, it should have a size of
something like 100Mio.

Trying to make the AppImage works on other computers, for now only
works on debian machines, it's facheux for an AppImage
parent 24367ef9
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!2Rework build process
......@@ -37,6 +37,7 @@
*.vsp
*.y4m
*.zip
*.DirIcon
*~
/bin
......@@ -67,6 +68,8 @@ packages/desktop/aegisub.desktop
packages/desktop/aegisub.desktop.template
packages/win_installer/vendor
src/aegisub
Aegisub/aegisub
Aegisub/usr/bin/aegisub
src/libresrc/bitmap.cpp
src/libresrc/bitmap.h
src/libresrc/default_config.cpp
......
[Desktop Entry]
Version=1.0
Type=Application
Name=Aegisub
Icon=aegisub-icon
GenericName=Subtitle Editor
Comment=Create and edit subtitles for film and videos.
Keywords=subtitles;video;audio;text
Terminal=false
Categories=AudioVideo;AudioVideoEditing;
MimeType=application/x-srt;text/plain;text/x-ass;text/x-microdvd;text/x-ssa;
StartupNotify=true
Exec=aegisub
#!/bin/sh
HERE=$(dirname $(readlink -f "$0"))
export LC_ALL="en_US.UTF-8"
export LD_LIBRARY_PATH="$HERE/usr/lib"
EXEC=$(grep -e '^Exec=.*' "$HERE"/*.desktop | head -n 1 | cut -d "=" -f 2 | cut -d " " -f 1)
ldd $(which $EXEC)
export PATH="$HERE/usr/bin"
exec $EXEC $@
Aegisub/aegisub-icon.png

4,91 ko

Fichier déplacé
ifneq (yes, $(INCLUDING_CHILD_MAKEFILES))
COMMANDS := all install clean distclean test depclean osx-bundle osx-dmg test-automation test-libaegisub style tags
COMMANDS := all install clean distclean test depclean osx-bundle osx-dmg test-automation test-libaegisub style tags appimage
.PHONY: $(COMMANDS)
.DEFAULT_GOAL := all
......@@ -95,6 +95,11 @@ style:
tags:
./tools/tags.bash
appimage: src/aegisub
cp $^ Aegisub/usr/bin/aegisub
./tools/copy-libs.lua Aegisub/usr/bin/aegisub Aegisub/usr/lib
./tools/appimagetool.AppImage Aegisub
# The actual build rules
.SUFFIXES:
......
......@@ -191,8 +191,9 @@ AC_ARG_ENABLE([appimage],
[AEGISUB_APPIMAGE_ENABLED=no])
AS_IF([test "x$AEGISUB_APPIMAGE_ENABLED" = "xyes"], [
AC_MSG_CHECKING([Downloading AppImage creation tool])
wget https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage \
wget https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-`arch`.AppImage \
-O tools/appimagetool.AppImage -o config.wget.log
chmod 00700 tools/appimagetool.AppImage
AS_IF([test $? -eq 0 ], [
AC_MSG_RESULT([done])
], [
......
......@@ -38,6 +38,10 @@ DISTCLEANFILES += \
$(TOP)autom4te.cache \
$(TOP)aclocal.m4 \
CLEANFILES += \
$(TOP)Aegisub/usr/bin/aegisub \
$(wildcard $(TOP)Aegisub/usr/lib/*)
define MKDIR_INSTALL
@$(BIN_MKDIR_P) $(dir $@)
$(BIN_INSTALL) -m644 $< $@
......
#!/usr/bin/env lua
-- Needs awk and a shell (usually bash / sh) and ldd, which is a Linux utility.
-- Thus run only this script on a Linux env or where the .so files can be found
-- with the ldd command.
if not arg or #arg ~= 2 then os.exit(1) end
io.stdout:write(string.format('Running for file %s\n', arg[1]))
io.stdout:write(string.format('Dest folder is %s\n', arg[2]))
-- Libs tables
LIBS_WRITE = {}
LIBS_READ = {}
-- Capture the output of a command
function os.capture(cmd)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
return s
end
-- Simple copy of a table, it doesn't work with metatables and recursive tables
function copy_simple(obj)
if type(obj) ~= 'table' then return obj end
local res = {}
for k, v in pairs(obj) do res[copy_simple(k)] = copy_simple(v) end
return res
end
-- Add the content of t2 in t1
function concatenate(t1, t2)
for name, file in pairs(t2) do
t1[name] = file
end
end
-- Get the number of elements in a table
function tablelength(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end
-- The ldd command line utility, but in lua
function ldd(file)
local libs = {}
local cmd = string.format('ldd %s | awk \'$2 = "=>" && $3 { print $1 " " $3 }\'', arg[1])
local out = os.capture(cmd)
for name, file in out:gmatch("([^\n ]*) ([^\n ]*)[\n]") do
libs[name] = file
end
return libs
end
-- Add NEEDS for each lib while there are some added. It's like a dataflow algorithme.
LIBS_WRITE = ldd(arg[1])
while tablelength(LIBS_READ) ~= tablelength(LIBS_WRITE) do
LIBS_READ = copy_simple(LIBS_WRITE)
for name, file in pairs(LIBS_READ) do
concatenate(LIBS_WRITE, ldd(file))
end
end
io.stdout:write(string.format("Cleaning %s", arg[2]))
os.execute(string.format("rm -f %s/*", arg[2]))
for name, file in pairs(LIBS_WRITE) do
local cmd = string.format('cp %s %s/%s && chmod 555 %s/%s',
file, arg[2], name, arg[2], name)
os.execute(cmd)
end
io.stdout:write(string.format("Copied %d libraries to %s\n", tablelength(LIBS_WRITE), arg[2]))
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter