build: use same container as Jenkins CI for local packaged builds on Linux

Make the docker-related logic for doing a local packaged build on Linux match
with the Jenkins CI build for Linux.

Also fix the problems with packaged builds for Linux (local or CI) where
gstreamer errors were displayed in the terminal shortly after app start/login
and there was no sound output.
This commit is contained in:
Michael Bradley, Jr 2021-04-21 15:13:21 -05:00 committed by Michael Bradley
parent f01bbcb926
commit 37c51cc25f
7 changed files with 33 additions and 34 deletions

5
AppRun
View File

@ -1,5 +1,10 @@
#!/bin/bash #!/bin/bash
APPDIR="$(dirname "$(readlink -f "${0}")")" APPDIR="$(dirname "$(readlink -f "${0}")")"
export GST_PLUGIN_SCANNER="${APPDIR}/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
export GST_PLUGIN_PATH="${APPDIR}/usr/lib/gstreamer-1.0"
export GST_PLUGIN_PATH_1_0="${APPDIR}/usr/lib/gstreamer-1.0"
export GST_PLUGIN_SYSTEM_PATH="${APPDIR}/usr/lib/gstreamer-1.0"
export GST_PLUGIN_SYSTEM_PATH_1_0="${APPDIR}/usr/lib/gstreamer-1.0"
export LD_LIBRARY_PATH="${APPDIR}/usr/lib/:${LD_LIBRARY_PATH}" export LD_LIBRARY_PATH="${APPDIR}/usr/lib/:${LD_LIBRARY_PATH}"
export QT_QPA_PLATFORM="xcb" export QT_QPA_PLATFORM="xcb"

View File

@ -247,7 +247,7 @@ $(APPIMAGE_TOOL):
mv $(_APPIMAGE_TOOL) tmp/linux/tools/ mv $(_APPIMAGE_TOOL) tmp/linux/tools/
chmod +x $(APPIMAGE_TOOL) chmod +x $(APPIMAGE_TOOL)
STATUS_CLIENT_APPIMAGE ?= pkg/NimStatusClient-x86_64.AppImage STATUS_CLIENT_APPIMAGE ?= pkg/Status.AppImage
$(STATUS_CLIENT_APPIMAGE): override RESOURCES_LAYOUT := -d:production $(STATUS_CLIENT_APPIMAGE): override RESOURCES_LAYOUT := -d:production
$(STATUS_CLIENT_APPIMAGE): nim_status_client $(APPIMAGE_TOOL) nim-status.desktop $(STATUS_CLIENT_APPIMAGE): nim_status_client $(APPIMAGE_TOOL) nim-status.desktop
@ -269,6 +269,9 @@ $(STATUS_CLIENT_APPIMAGE): nim_status_client $(APPIMAGE_TOOL) nim-status.desktop
# Libraries # Libraries
cp -r /usr/lib/x86_64-linux-gnu/nss tmp/linux/dist/usr/lib/ cp -r /usr/lib/x86_64-linux-gnu/nss tmp/linux/dist/usr/lib/
cp -P /usr/lib/x86_64-linux-gnu/libgst* tmp/linux/dist/usr/lib/
cp -r /usr/lib/x86_64-linux-gnu/gstreamer-1.0 tmp/linux/dist/usr/lib/
cp -r /usr/lib/x86_64-linux-gnu/gstreamer1.0 tmp/linux/dist/usr/lib/
cp vendor/status-go/build/bin/libstatus.so tmp/linux/dist/usr/lib/ cp vendor/status-go/build/bin/libstatus.so tmp/linux/dist/usr/lib/
echo -e $(BUILD_MSG) "AppImage" echo -e $(BUILD_MSG) "AppImage"

View File

@ -2,10 +2,16 @@
# This script assumes $PWD is the same dir in which this script is located # This script assumes $PWD is the same dir in which this script is located
docker run -it --rm --device /dev/fuse \ # Helps avoid permissions problems with `jenkins` user in docker container when
-v "${PWD}:/nim-status-client:Z" \ # making a local packaged build
-w /nim-status-client \ git clean -dfx
docker run -it --rm \
--cap-add SYS_ADMIN \ --cap-add SYS_ADMIN \
--privileged \ --security-opt apparmor:unconfined \
a12e/docker-qt:5.14-gcc_64 \ --device /dev/fuse \
-u jenkins:$(getent group $(whoami) | cut -d: -f3) \
-v "${PWD}:/status-desktop" \
-w /status-desktop \
statusteam/nim-status-client-build:1.0.2 \
./docker-linux-app-image.sh ./docker-linux-app-image.sh

View File

@ -4,8 +4,8 @@ FROM a12e/docker-qt:5.14-gcc_64
# $QT_PATH/$QT_VERSION/$QT_PLATFORM/bin is already prepended to $PATH # $QT_PATH/$QT_VERSION/$QT_PLATFORM/bin is already prepended to $PATH
# However $QT_VERSION is not exposed to environment so set it here # However $QT_VERSION is not exposed to environment so set it here
ENV QT_VERSION="5.14.0" ENV QT_VERSION="5.14.0"
ENV QTDIR="${QT_PATH}/${QT_VERSION}" ENV QTDIR="${QT_PATH}/${QT_VERSION}/${QT_PLATFORM}"
ENV LD_LIBRARY_PATH="${QTDIR}/${QT_PLATFORM}/lib:${LD_LIBRARY_PATH}" ENV LD_LIBRARY_PATH="${QTDIR}/lib:${LD_LIBRARY_PATH}"
# $OPENSSL_PREFIX is provided by the docker image # $OPENSSL_PREFIX is provided by the docker image
ENV LIBRARY_PATH="${OPENSSL_PREFIX}/lib:${LIBRARY_PATH}" ENV LIBRARY_PATH="${OPENSSL_PREFIX}/lib:${LIBRARY_PATH}"
@ -15,7 +15,7 @@ RUN export DEBIAN_FRONTEND=noninteractive \
&& sudo add-apt-repository -y ppa:git-core/ppa \ && sudo add-apt-repository -y ppa:git-core/ppa \
&& sudo apt update -yq \ && sudo apt update -yq \
&& sudo apt install -yq --fix-missing \ && sudo apt install -yq --fix-missing \
build-essential cmake git s3cmd libpcre3-dev libnss3 libxcomposite1 libxtst6 jq build-essential cmake git s3cmd libpcre3-dev libnss3 libxcomposite1 libxtst6 jq gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-alsa gstreamer1.0-pulseaudio
# Installing Golang # Installing Golang
RUN GOLANG_SHA256="aed845e4185a0b2a3c3d5e1d0a35491702c55889192bb9c30e67a3de6849c067" \ RUN GOLANG_SHA256="aed845e4185a0b2a3c3d5e1d0a35491702c55889192bb9c30e67a3de6849c067" \

View File

@ -4,7 +4,7 @@ pipeline {
agent { agent {
docker { docker {
label 'linux' label 'linux'
image 'statusteam/nim-status-client-build:1.0.1' image 'statusteam/nim-status-client-build:1.0.2'
/* allows jenkins use cat and mounts '/dev/fuse' for linuxdeployqt */ /* allows jenkins use cat and mounts '/dev/fuse' for linuxdeployqt */
args '--entrypoint="" --cap-add SYS_ADMIN --security-opt apparmor:unconfined --device /dev/fuse' args '--entrypoint="" --cap-add SYS_ADMIN --security-opt apparmor:unconfined --device /dev/fuse'
} }

View File

@ -1,27 +1,12 @@
#!/bin/bash #!/bin/bash
# Installing prerequisites # Workaround for permissions problems with `jenkins` user inside the container
# Probably should be part of a dockerfile cp -R . ~/status-desktop
sudo apt update cd ~/status-desktop
sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt update
sudo apt install -y --fix-missing build-essential cmake git libpcre3-dev jq
# Installing GO git clean -dfx && rm -rf vendor/* && make -j4 V=1 update
# Probably should be part of a dockerfile make V=1 pkg
wget https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.14.4.linux-amd64.tar.gz
rm ./go1.14.4.linux-amd64.tar.gz
export PATH="/usr/local/go/bin:${PATH}"
# $QT_PATH and $QT_PLATFORM are provided by the docker image # Make AppImage build accessible to the docker host
# $QT_PATH/$QT_VERSION/$QT_PLATFORM/bin is already prepended to $PATH cd - && cp -R ~/status-desktop/pkg .
# However $QT_VERSION is not exposed to environment so set it here chmod -R 775 ./pkg
export QT_VERSION=$(basename $(echo "${QT_PATH}/*"))
export QTDIR="${QT_PATH}/${QT_VERSION}/${QT_PLATFORM}"
# $OPENSSL_PREFIX is provided by the docker image
export LIBRARY_PATH="${OPENSSL_PREFIX}/lib:${LIBRARY_PATH}"
export LD_LIBRARY_PATH="${QTDIR}/lib:${LD_LIBRARY_PATH}"
make clean; git clean -dfx && rm -rf vendor/*
make pkg V=1

View File

@ -3,6 +3,6 @@ Type=Application
Name=Status Desktop Name=Status Desktop
Exec=nim_status_client Exec=nim_status_client
Icon=status Icon=status
Comment=Hello World Comment=Desktop client for the Status Network
Terminal=true Terminal=true
Categories=Network; Categories=Network;