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
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 QT_QPA_PLATFORM="xcb"

View File

@ -247,7 +247,7 @@ $(APPIMAGE_TOOL):
mv $(_APPIMAGE_TOOL) tmp/linux/tools/
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): nim_status_client $(APPIMAGE_TOOL) nim-status.desktop
@ -269,6 +269,9 @@ $(STATUS_CLIENT_APPIMAGE): nim_status_client $(APPIMAGE_TOOL) nim-status.desktop
# Libraries
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/
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
docker run -it --rm --device /dev/fuse \
-v "${PWD}:/nim-status-client:Z" \
-w /nim-status-client \
# Helps avoid permissions problems with `jenkins` user in docker container when
# making a local packaged build
git clean -dfx
docker run -it --rm \
--cap-add SYS_ADMIN \
--privileged \
a12e/docker-qt:5.14-gcc_64 \
--security-opt apparmor:unconfined \
--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

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
# However $QT_VERSION is not exposed to environment so set it here
ENV QT_VERSION="5.14.0"
ENV QTDIR="${QT_PATH}/${QT_VERSION}"
ENV LD_LIBRARY_PATH="${QTDIR}/${QT_PLATFORM}/lib:${LD_LIBRARY_PATH}"
ENV QTDIR="${QT_PATH}/${QT_VERSION}/${QT_PLATFORM}"
ENV LD_LIBRARY_PATH="${QTDIR}/lib:${LD_LIBRARY_PATH}"
# $OPENSSL_PREFIX is provided by the docker image
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 apt update -yq \
&& 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
RUN GOLANG_SHA256="aed845e4185a0b2a3c3d5e1d0a35491702c55889192bb9c30e67a3de6849c067" \

View File

@ -4,7 +4,7 @@ pipeline {
agent {
docker {
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 */
args '--entrypoint="" --cap-add SYS_ADMIN --security-opt apparmor:unconfined --device /dev/fuse'
}

View File

@ -1,27 +1,12 @@
#!/bin/bash
# Installing prerequisites
# Probably should be part of a dockerfile
sudo apt update
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
# Workaround for permissions problems with `jenkins` user inside the container
cp -R . ~/status-desktop
cd ~/status-desktop
# Installing GO
# Probably should be part of a dockerfile
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}"
git clean -dfx && rm -rf vendor/* && make -j4 V=1 update
make V=1 pkg
# $QT_PATH and $QT_PLATFORM are provided by the docker image
# $QT_PATH/$QT_VERSION/$QT_PLATFORM/bin is already prepended to $PATH
# However $QT_VERSION is not exposed to environment so set it here
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
# Make AppImage build accessible to the docker host
cd - && cp -R ~/status-desktop/pkg .
chmod -R 775 ./pkg

View File

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