Assorted tweaks to appimage scripts.

main
Ben Niemann 2021-12-23 01:01:25 +01:00
parent 7bd5a8624e
commit a6831d6569
5 changed files with 73 additions and 16 deletions

View File

@ -1,6 +1,7 @@
version: 1
script: |
rm -fr /srcrw
cp -aR /src /srcrw
cd /srcrw
python3 waf configure --out=/build --prefix=/usr --release --without-tests

View File

@ -92,6 +92,11 @@ if [ ! -x /usr/local/bin/appimagetool ]; then
cd /build
curl -o appimagetool-x86_64.AppImage -L https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod a+x appimagetool-x86_64.AppImage
# If something like AppImageLauncher on the host system registered a binfmt_misc hook for
# AppImages, then that (might) leak into the docker container, preventing us from starting the
# binary. An ugly workaround is to remove the magic bytes from the file.
# See https://github.com/TheAssassin/AppImageLauncher/issues/407
dd if=/dev/zero of=image bs=1 seek=8 count=3 conv=notrunc status=none
./appimagetool-x86_64.AppImage --appimage-extract
rm -fr /opt/appimagetool
mv squashfs-root /opt/appimagetool
@ -144,6 +149,7 @@ cat /src/appimg/appimage.yaml \
>appimage.yaml
appimage-builder --recipe appimage.yaml --skip-tests
chown $ORIG_UID.$ORIG_GID noisicaa*.AppImage
ls -lh noisicaa*.AppImage
cp -vf noisicaa*.AppImage /out
cp -avf noisicaa*.AppImage /out

View File

@ -15,13 +15,19 @@ if [ ! -x "${IMAGE}" ]; then
fi
cd /tmp
echo -n "Extracting..."
"${IMAGE}" --appimage-extract >/dev/null
echo -n "Extracting... "
# If something like AppImageLauncher on the host system registered a binfmt_misc hook for
# AppImages, then that (might) leak into the docker container, preventing us from starting the
# binary. An ugly workaround is to remove the magic bytes from the file.
# See https://github.com/TheAssassin/AppImageLauncher/issues/407
cp -f ${IMAGE} image
dd if=/dev/zero of=image bs=1 seek=8 count=3 conv=notrunc status=none
./image --appimage-extract >/dev/null
echo "Ok."
# Run the image with --help. This ensures that the app is at least able to start and load most
# python modules.
echo -n "Running smoketest..."
echo -n "Running smoketest... "
squashfs-root/AppRun --help >/dev/null
echo "Ok."

View File

@ -3,14 +3,53 @@
set -e
ROOT="$(realpath "$(dirname "$0")"/..)"
cd "${ROOT}"
mkdir -p build
exec &> >(tee build/build_appimg.log)
usage() {
cat 1>&2 <<EOF
Usage: $0 [options]
Options:
-i Get interactive shell in build container, instead of running the
build script.
EOF
exit 1
}
CMD=()
while getopts ":d:i" o; do
case "${o}" in
i)
CMD=(bash)
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
if [ $# -ne 0 ]; then
usage
fi
if [ ${#CMD[*]} -eq 0 ]; then
CMD=(bash /src/appimg/build.sh)
LOG="${ROOT}/build/build_appimg.log"
mkdir -p "$(dirname "${LOG}")"
exec &> >(tee "${LOG}")
trap "echo; echo \"Log were written to ${LOG}\"" EXIT
fi
cd "${ROOT}"
docker run \
--rm \
--mount type=bind,source="${ROOT}",target=/src,readonly \
--mount type=bind,source="${ROOT}/build",target=/out \
--env ORIG_UID=$UID \
--env ORIG_GID=${GROUPS[0]} \
-i -t \
debian:bullseye bash /src/appimg/build.sh
debian:bullseye \
"${CMD[@]}"

View File

@ -11,6 +11,7 @@ Usage: $0 [options] appimage
Options:
-d dist Select distribution image to test under
(default: debian:bullseye).
-a Run test under all supported distributions.
-i Get interactive shell in test container, instead of running the
testsuite.
EOF
@ -20,11 +21,14 @@ EOF
DIST=debian:bullseye
CMD=()
while getopts ":d:i" o; do
while getopts ":d:ia" o; do
case "${o}" in
d)
DIST=${OPTARG}
;;
a)
DIST=all
;;
i)
CMD=(bash)
;;
@ -44,10 +48,6 @@ if [ "${DIST}" = all -a ${#CMD[*]} -ne 0 ]; then
exit 1
fi
if [ ${#CMD[*]} -eq 0 ]; then
CMD=(bash -c 'bash /src/appimg/test.sh ${IMAGE}')
fi
IMAGE="$1"
if [ ! -f "${IMAGE}" ]; then
@ -57,9 +57,14 @@ fi
IMAGE="$(realpath "${IMAGE}")"
LOG="${ROOT}/build/test_appimg.log"
exec &> >(tee "${LOG}")
trap "echo; echo \"Log were written to ${LOG}\"" EXIT
if [ ${#CMD[*]} -eq 0 ]; then
CMD=(bash -c 'bash /src/appimg/test.sh ${IMAGE}')
LOG="${ROOT}/build/test_appimg.log"
mkdir -p "$(dirname "${LOG}")"
exec &> >(tee "${LOG}")
trap "echo; echo \"Log were written to ${LOG}\"" EXIT
fi
function runtest() {
echo "****************** $1 **********************"