Closed dasgarner closed 2 years ago
For reference, this is the PR that added AppImage support originally: https://github.com/xibosignage/xibo-linux/pull/234/files
There are various build flags which could be reviewed and removed while removing AppImage. The git action for building AppImage could also be removed.
Hi I'm sorry, I'm not good at compiling snap applications, but I was able to customize the compilation for my purposes. I couldn't deal with the problem of a locally installed snap file (the x1 revision problem https://github.com/xibosignage/xibo-linux/issues/243#issuecomment-954041952), so I pushed the app to the snap repository to install it.
OS: Ubuntu 18.04.6 LTS snapcraft 6.0.2 multipass 1.8.0
base: core18
version: 1.8-R6
summary: Xibo Linux Player
description: Xibo for Linux Digital Signage Player
#grade: stable
grade: devel
#confinement: strict
confinement: devmode
architectures:
- build-on: amd64
#slots:
# dbus-daemon: # name this whatever you want
# interface: dbus
# bus: session
# name: org.gtkmm.xibo # adjust accordingly
apps:
xibo-player:
command: bin/snap_run.sh xibo-watchdog
plugs: [gsettings, network, home, audio-playback, screen-inhibit-control, framebuffer, opengl]
# slots: [dbus-daemon]
extensions: [gnome-3-28]
disabled-watchdog:
command: bin/snap_run.sh xibo-watchdog --disable-restart
plugs: [gsettings, network, home, audio-playback, screen-inhibit-control, framebuffer, opengl]
# slots: [dbus-daemon]
extensions: [gnome-3-28]
options:
command: bin/xibo-options
plugs: [gsettings, network, home]
# slots: [dbus-daemon]
extensions: [gnome-3-28]
parts:
base:
plugin: nil
build-packages:
- software-properties-common
- apt-transport-https
- ca-certificates
- gnupg
- curl
- wget
- unzip
- libgtkmm-3.0-dev
- libwebkitgtk-3.0-dev
- libxss-dev
- libglibmm-2.4-dev
- libssl-dev
g++-8: # Ubuntu 18.04 has outdated gcc so we have to install it from PPA
plugin: nil
override-pull: |
add-apt-repository ppa:ubuntu-toolchain-r/test
apt-get update
apt-get install -y g++-8
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 90
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 90
after: [base]
cmake:
plugin: nil
override-pull: |
wget -nv https://apt.kitware.com/keys/kitware-archive-latest.asc -O Release.key
apt-key add - < Release.key
apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main'
apt-get update
apt-get install -y cmake
after: [g++-8]
zmq: # Ubuntu 18.04 has outdated ZMQ so we are pulling it from official stable repo
plugin: nil
override-pull: |
sh -c "echo 'deb http://download.opensuse.org/repositories/network:/messaging:/zeromq:/release-stable/xUbuntu_18.04/ /' > /etc/apt/sources.list.d/network:messaging:zeromq:release-stable.list"
wget -nv https://download.opensuse.org/repositories/network:messaging:zeromq:release-stable/xUbuntu_18.04/Release.key -O Release.key
apt-key add - < Release.key
apt-get update
apt-get install -y libzmq3-dev
after: [cmake]
boost: # Ubuntu 18.04 has outdated boost so we have to install it from PPA
plugin: nil
override-pull: |
add-apt-repository ppa:mhier/libboost-latest
apt-get update
apt-get install -y libboost1.70-dev
after: [zmq]
spdlog:
source: https://github.com/gabime/spdlog/archive/v1.4.1.tar.gz
plugin: cmake
after: [cmake]
gtest:
source: https://codeload.github.com/google/googletest/tar.gz/release-1.8.1
source-type: tar
plugin: cmake
after: [cmake]
cryptopp:
plugin: nil
override-pull: |
curl -o cryptopp.tar.gz -SL https://github.com/weidai11/cryptopp/archive/CRYPTOPP_8_1_0.tar.gz && \
curl -o cryptopp_pem.zip -SL https://github.com/noloader/cryptopp-pem/archive/095f08ff2ef9bca7b81036a59f2395e4f08ce2e8.zip && \
tar -zxvf cryptopp.tar.gz && \
unzip -a cryptopp_pem.zip && \
cp -r cryptopp-pem-095f08ff2ef9bca7b81036a59f2395e4f08ce2e8/. cryptopp-CRYPTOPP_8_1_0 && \
cd cryptopp-CRYPTOPP_8_1_0 && \
make -j4 && \
make install
gstreamer:
# override-pull: |
# snapcraftctl pull
# git checkout 1.16.2
# source: https://github.com/GStreamer/gstreamer.git
source: https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-1.16.2.tar.xz
plugin: autotools
configflags: ['--prefix=/usr', '--disable-gtk-doc']
build-packages:
- bison
- flex
- gettext
- liborc-0.4-dev
- libpulse-dev
- libxv-dev
- libtag1-dev
- libwavpack-dev
- libgl1-mesa-dev
- libglu1-mesa-dev
- libglew-dev
stage-packages:
- liborc-0.4-dev
- libasound2-dev
- libjpeg-dev
- libvpx-dev
- libvorbis-dev
- libogg-dev
- libpulse-dev
- libpulse0
- libwavpack-dev
- libtag1v5
- libopus-dev
- libtheora-dev
- libxv-dev
- libxdamage-dev
- libcdparanoia-dev
- libgl1-mesa-glx
- libglu1-mesa
- libglew2.0
stage:
- -usr/lib/x86_64-linux-gnu/libLLVM-10.so.1
- -usr/share/doc/libllvm10/changelog.Debian.gz
- -usr/share/doc/gcc-11-base/changelog.Debian.gz
- -lib/x86_64-linux-gnu/libgcc_s.so.1
after: [g++-8]
gst-plugins-base:
# override-pull: |
# snapcraftctl pull
# git checkout 1.16.2
# source: https://github.com/GStreamer/gst-plugins-base.git
source: https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-1.16.2.tar.xz
plugin: autotools
configflags: ['--prefix=/usr', '--disable-gtk-doc']
build-packages:
- liborc-0.4-dev
- libfribidi-dev
- libpulse-dev
after: [gstreamer]
gst-libav:
# override-pull: |
# snapcraftctl pull
# git checkout 1.16.2
# source: https://github.com/GStreamer/gst-libav.git
source: https://gstreamer.freedesktop.org/src/gst-libav/gst-libav-1.16.2.tar.xz
plugin: autotools
configflags: ['--prefix=/usr', '--disable-gtk-doc']
build-packages:
- yasm
- liborc-0.4-dev
- libpulse-dev
- libva-dev
stage-packages:
- libpulse0
after: [gst-plugins-base]
gst-plugins-good:
# override-pull: |
# snapcraftctl pull
# git checkout 1.16.2
# source: https://github.com/GStreamer/gst-plugins-good.git
source: https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.16.2.tar.xz
plugin: autotools
configflags: ['--prefix=/usr', '--disable-gtk-doc']
build-packages:
- liborc-0.4-dev
- libpulse-dev
stage-packages:
- libpulse0
after: [gst-libav]
date-tz:
source: https://github.com/HowardHinnant/date/archive/v3.0.0.tar.gz
plugin: cmake
build-packages:
- libcurl4-gnutls-dev
configflags:
- -DBUILD_TZ_LIB=ON
- -DBUILD_SHARED_LIBS=ON
- -DUSE_SYSTEM_TZ_DB=ON
after: [cmake]
sqlite-orm:
source: https://github.com/fnc12/sqlite_orm/archive/refs/tags/1.6.tar.gz
plugin: cmake
build-packages:
- libsqlite3-dev
stage-packages:
- libsqlite3-0
configflags:
- -DBUILD_TESTING=OFF
after: [cmake]
player:
source: player
plugin: cmake
configflags:
- -DCMAKE_BUILD_TYPE=Release
- -DAPP_ENV=SNAP
disable-parallel: true
stage-packages:
- freeglut3
- libzmq5
- libboost1.70
- libgtkmm-3.0-1v5
- libcanberra-gtk3-module
- libwebkitgtk-3.0-0
- libgpm2 # gstreamer warning
- libslang2 # gstreamer warning
after: [zmq, boost, spdlog, gtest, gstreamer, date-tz, sqlite-orm] ```
It may also be more transparent if we build snap packages using a Github Action instead of via the snap store. We could use https://github.com/snapcore/action-build for this.
This would have the added benefit of creating a release when we tag and uploading a snap to that release which could be manually installed.
Closing this was premature as further testing reveals that even though we can build referencing gstreamer archives instead of git checkout - video doesn't actually play.
TypeError: expected string or bytes-like object
The above error is fixed by this PR: https://github.com/snapcore/snapcraft/pull/3628, which unfortunately did not quite make it into 6.1. I have tried a build with snapcraft from edge (which is version 7) and the build is successful. However with v7 I then can't login to snapcraft.
I think the solution will be to wait for the next release of snapcraft, which contains the fix we need.
It may be that this gets solved out by either of these two issues:
A final update (I hope).
The video issue seen when referencing the gstreamer archives in snap actually turned out to be a video issue under Wayland and a false lead.
Further testing with the snap built using the gstreamer archives (rev 238 in edge) shows that it is functional, video plays and all seems well.
With that I think this issue can be closed with a big thanks to @gamenfs for pointing us in the right direction.
The snap build currently fails with the following error: