From: Frank Stettner Date: Thu, 30 Mar 2023 19:25:01 +0000 (+0200) Subject: Add CI scripts for the AppImage build X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=1d9477f961fe89082c9fcb7ab65c772a039cdfd6;p=sigrok-build.git Add CI scripts for the AppImage build This fixes bug 1646 (https://sigrok.org/bugzilla/show_bug.cgi?id=1646) by appending SIGROK_FIRMWARE_PATH and SIGROKDECODE_PATH --- diff --git a/ci/appimage/sigrok-appimage-build-dependencies.sh b/ci/appimage/sigrok-appimage-build-dependencies.sh new file mode 100755 index 0000000..e6a800a --- /dev/null +++ b/ci/appimage/sigrok-appimage-build-dependencies.sh @@ -0,0 +1,81 @@ +#!/bin/sh +## +## This file is part of the sigrok-util project. +## +## Copyright (C) 2013-2018 Uwe Hermann +## Copyright (C) 2018-2023 Frank Stettner +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, see . +## + +set -e + +mkdir -p "$INSTALL_DIR" + +BUILD_DIR=./build +mkdir -p $BUILD_DIR +cd $BUILD_DIR + +# libserialport +$GIT_CLONE $LIBSERIALPORT_REPO libserialport +cd libserialport +./autogen.sh +./configure $C $L +make $PARALLEL $V +make install $V +cd .. + +# libsigrok +$GIT_CLONE -b ${LIBSIGROK_BRANCH:-master} $LIBSIGROK_REPO libsigrok +cd libsigrok +./autogen.sh +PKG_CONFIG_PATH=$P ./configure $C $L +make $PARALLEL $V +make install $V +cd .. + +# libsigrokdecode +$GIT_CLONE $LIBSIGROKDECODE_REPO libsigrokdecode +cd libsigrokdecode +./autogen.sh +PKG_CONFIG_PATH=$P ./configure $C $L +make $PARALLEL $V +make install $V +cd .. + +# sigrok-firmware +$GIT_CLONE $SIGROK_FIRMWARE_REPO sigrok-firmware +cd sigrok-firmware +./autogen.sh +# Nothing gets cross-compiled here, we just need 'make install' basically. +PKG_CONFIG_PATH=$P ./configure --prefix="$INSTALL_DIR" +make install $V +cd .. + +# sigrok-firmware-fx2lafw +$GIT_CLONE $SIGROK_FIRMWARE_FX2LAFW_REPO sigrok-firmware-fx2lafw +cd sigrok-firmware-fx2lafw +./autogen.sh +# We're building the fx2lafw firmware on the host, no need to cross-compile. +PKG_CONFIG_PATH=$P ./configure --prefix="$INSTALL_DIR" +make $PARALLEL $V +make install $V +cd .. + +# sigrok-dumps +$GIT_CLONE $SIGROK_DUMPS_REPO sigrok-dumps +cd sigrok-dumps +make install PREFIX="$INSTALL_DIR" $V +cd .. + diff --git a/ci/appimage/sigrok-appimage-create-appimage.sh b/ci/appimage/sigrok-appimage-create-appimage.sh new file mode 100755 index 0000000..6e1fca6 --- /dev/null +++ b/ci/appimage/sigrok-appimage-create-appimage.sh @@ -0,0 +1,67 @@ +#!/bin/sh +## +## This file is part of the sigrok-util project. +## +## Copyright (C) 2023 Frank Stettner +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, see . +## + +set -e + +# Generate AppRun.sh scrip +cat > "$INSTALL_DIR"/AppRun.sh << EOF +#! /bin/bash + +export PYTHONHOME="\$APPDIR"/usr/share/pyshared +export PYTHONPATH="\$APPDIR"/usr/share/pyshared +export SIGROK_FIRMWARE_PATH="\$SIGROK_FIRMWARE_PATH":"\$APPDIR"/usr/share/sigrok-firmware +export SIGROKDECODE_PATH="\$SIGROKDECODE_PATH":"\$APPDIR"/usr/share/libsigrokdecode/decoders + +exec "\$APPDIR"/usr/bin/$ARTIFACT_BIN_NAME "\$@" +EOF +chmod +x "$INSTALL_DIR"/AppRun.sh + +# Copy decoders stuff +cp -r "$INSTALL_DIR"/share/libsigrokdecode "$APP_DIR"/usr/share + +# Copy sigrok-firmware +cp -r "$INSTALL_DIR"/share/sigrok-firmware "$APP_DIR"/usr/share + +# Copy extra Python files +mkdir -p "$APP_DIR"/usr/share/pyshared +cp -r /usr/lib/python3.6/* "$APP_DIR"/usr/share/pyshared + +# AppImage build dir +mkdir -p appimage-build +cd appimage-build + +# Environment variables +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":"$INSTALL_DIR"/lib + +# Fetch linuxdeploy +wget -c https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-$ARCH.AppImage +chmod +x linuxdeploy-$ARCH.AppImage + +PLUGINS="" +if [ "$ARTIFACT_BIN_NAME" = "pulseview" ]; then + # Fetch qt plugin + wget -c https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-$ARCH.AppImage + chmod +x linuxdeploy-plugin-qt-$ARCH.AppImage + PLUGINS="--plugin qt" +fi + +export OUTPUT="$ARTIFACT_TITLE-$ARTIFACT_VERSION-$TARGET.AppImage" +./linuxdeploy-$ARCH.AppImage --appdir "$APP_DIR" --output appimage $PLUGINS --custom-apprun "$INSTALL_DIR"/AppRun.sh + diff --git a/ci/appimage/sigrok-appimage-init-toolchain.sh b/ci/appimage/sigrok-appimage-init-toolchain.sh new file mode 100755 index 0000000..1bf9f81 --- /dev/null +++ b/ci/appimage/sigrok-appimage-init-toolchain.sh @@ -0,0 +1,30 @@ +#!/bin/sh +## +## This file is part of the sigrok-util project. +## +## Copyright (C) 2013-2018 Uwe Hermann +## Copyright (C) 2018-2023 Frank Stettner +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 2 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program; if not, see . +## + +set -e + +export PARALLEL="-j$(nproc)" + +export P="$INSTALL_DIR/lib/pkgconfig" +export C="$C --prefix=$INSTALL_DIR" +export L="$L" +#export V="V=1 VERBOSE=1" +