Skip to content
Snippets Groups Projects
Commit 06759f5f authored by Sébastien Blin's avatar Sébastien Blin Committed by Amin Bandali
Browse files

snap: update to core22

+ core18 is nearly EOL
+ use core22
+ Fix blue video

jami-client-qt#758

Change-Id: I1576b6adee1a7171659f7927a39b8965a567d3ce
parent c001248a
No related branches found
No related tags found
No related merge requests found
...@@ -271,16 +271,6 @@ list-package-targets: ...@@ -271,16 +271,6 @@ list-package-targets:
@$(foreach p,$(PACKAGE-TARGETS),\ @$(foreach p,$(PACKAGE-TARGETS),\
echo $(p);) echo $(p);)
docker/Dockerfile_snap: patches/docker-snap-build-scripts.patch
if patch -p1 -fR --dry-run < $< >/dev/null 2>&1; then \
echo "Patching $@... skipped (already patched)"; \
else \
echo "Patching $@..."; \
patch -p1 -Ns < $< || { echo "Patching $@... failed" >&2 && exit 1; }; \
echo "Patching $@... done"; \
fi
.PHONY: docker/Dockerfile_snap
################### ###################
## Other targets ## ## Other targets ##
################### ###################
......
FROM ubuntu:xenial as builder FROM ubuntu:jammy as builder
# Grab dependencies # Grab dependencies.
RUN apt-get update RUN apt-get update
RUN apt-get dist-upgrade --yes RUN apt-get dist-upgrade --yes
RUN apt-get install --yes \ RUN apt-get install --yes \
...@@ -10,19 +10,30 @@ RUN apt-get install --yes \ ...@@ -10,19 +10,30 @@ RUN apt-get install --yes \
# Grab the core snap (for backwards compatibility) from the stable channel and # Grab the core snap (for backwards compatibility) from the stable channel and
# unpack it in the proper place. # unpack it in the proper place.
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core' | jq '.download_url' -r) --output core.snap RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' -H "X-Ubuntu-Architecture: amd64" 'https://api.snapcraft.io/api/v1/snaps/details/core' | jq '.download_url' -r) --output core.snap
RUN mkdir -p /snap/core RUN mkdir -p /snap/core
RUN unsquashfs -d /snap/core/current core.snap RUN unsquashfs -d /snap/core/current core.snap
# Grab the core18 snap (which snapcraft uses as a base) from the stable channel # Grab the core18 snap (which snapcraft uses as a base) from the stable channel
# and unpack it in the proper place. # and unpack it in the proper place.
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/core18' | jq '.download_url' -r) --output core18.snap RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' -H "X-Ubuntu-Architecture: amd64" 'https://api.snapcraft.io/api/v1/snaps/details/core18' | jq '.download_url' -r) --output core18.snap
RUN mkdir -p /snap/core18 RUN mkdir -p /snap/core18
RUN unsquashfs -d /snap/core18/current core18.snap RUN unsquashfs -d /snap/core18/current core18.snap
# Grab the snapcraft snap from the stable channel and unpack it in the proper # Grab the core22 snapfrom the stable channel
# and unpack it in the proper place.
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' -H "X-Ubuntu-Architecture: amd64" 'https://api.snapcraft.io/api/v1/snaps/details/core22' | jq '.download_url' -r) --output core22.snap
RUN mkdir -p /snap/core22
RUN unsquashfs -d /snap/core22/current core22.snap
# Grab the snapcraft snap from the targeted channel and unpack it in the proper
# place. # place.
RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/snapcraft?channel=stable' | jq '.download_url' -r) --output snapcraft.snap # RUN curl -L $(curl -H 'X-Ubuntu-Series: 16' 'https://api.snapcraft.io/api/v1/snaps/details/snapcraft?channel=stable' | jq '.download_url' -r) --output snapcraft.snap
# Current snapcraft snap is broken upstream again:
# https://forum.snapcraft.io/t/snapcraft-docker-images-broken-again/27942
# Temporary workaround: pin to an older, non-broken version for now.
# TODO: restore to the above once issue is fixed upstream.
RUN curl -L https://api.snapcraft.io/api/v1/snaps/download/vMTKRaLjnOJQetI78HjntT37VuoyssFE_6751.snap --output snapcraft.snap
RUN mkdir -p /snap/snapcraft RUN mkdir -p /snap/snapcraft
RUN unsquashfs -d /snap/snapcraft/current snapcraft.snap RUN unsquashfs -d /snap/snapcraft/current snapcraft.snap
...@@ -36,9 +47,10 @@ RUN chmod +x /snap/bin/snapcraft ...@@ -36,9 +47,10 @@ RUN chmod +x /snap/bin/snapcraft
# Multi-stage build, only need the snaps from the builder. Copy them one at a # Multi-stage build, only need the snaps from the builder. Copy them one at a
# time so they can be cached. # time so they can be cached.
FROM ubuntu:xenial FROM ubuntu:jammy
COPY --from=builder /snap/core /snap/core COPY --from=builder /snap/core /snap/core
COPY --from=builder /snap/core18 /snap/core18 COPY --from=builder /snap/core18 /snap/core18
COPY --from=builder /snap/core22 /snap/core22
COPY --from=builder /snap/snapcraft /snap/snapcraft COPY --from=builder /snap/snapcraft /snap/snapcraft
COPY --from=builder /snap/bin/snapcraft /snap/bin/snapcraft COPY --from=builder /snap/bin/snapcraft /snap/bin/snapcraft
...@@ -52,4 +64,8 @@ ENV LC_ALL="en_US.UTF-8" ...@@ -52,4 +64,8 @@ ENV LC_ALL="en_US.UTF-8"
ENV PATH="/snap/bin:$PATH" ENV PATH="/snap/bin:$PATH"
ENV SNAP="/snap/snapcraft/current" ENV SNAP="/snap/snapcraft/current"
ENV SNAP_NAME="snapcraft" ENV SNAP_NAME="snapcraft"
ENV SNAP_ARCH="amd64" ENV SNAP_ARCH="amd64"
ADD scripts/build-package-snap.sh /opt/build-package-snap.sh
CMD ["/opt/build-package-snap.sh"]
...@@ -28,9 +28,8 @@ TODO ...@@ -28,9 +28,8 @@ TODO
### Snap ### Snap
`Dockerfile_snap` is from [stable.Dockerfile](stable.Dockerfile) `Dockerfile_snap` is from snapcraft [Dockerfile](snapcraft-Dockerfile)
upstream, under GPLv3-only, and is not considered part of the project. upstream, under GPLv3-only, and is not considered part of the project.
It is patched with `../patches/docker-snap-build-scripts.patch` to It was modified to support `core22`.
add and invoke our build script.
[stable.Dockerfile]: https://raw.githubusercontent.com/snapcore/snapcraft/master/docker/stable.Dockerfile [stable.Dockerfile]: https://raw.githubusercontent.com/snapcore/snapcraft/main/docker/Dockerfile
...@@ -85,13 +85,13 @@ description: | ...@@ -85,13 +85,13 @@ description: |
confinement: strict confinement: strict
grade: stable grade: stable
base: core18 base: core22
plugs: plugs:
gnome-3-28-1804: gnome-42-2204:
interface: content interface: content
target: $SNAP/gnome-platform target: $SNAP/gnome-platform
default-provider: gnome-3-28-1804:gnome-3-28-1804 default-provider: gnome-42-2204:gnome-42-2204
gtk-3-themes: gtk-3-themes:
interface: content interface: content
target: $SNAP/data-dir/themes target: $SNAP/data-dir/themes
...@@ -125,6 +125,8 @@ layout: ...@@ -125,6 +125,8 @@ layout:
environment: environment:
XDG_CURRENT_DESKTOP: Unity XDG_CURRENT_DESKTOP: Unity
QT_BASE_DIR: "/usr/lib/libqt-jami"
LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$SNAP$QT_BASE_DIR/lib"
apps: apps:
jami: jami:
...@@ -166,7 +168,7 @@ package-repositories: ...@@ -166,7 +168,7 @@ package-repositories:
components: [main] components: [main]
suites: [jami] suites: [jami]
key-id: A295D773307D25A33AE72F2F64CD5FA175348F84 key-id: A295D773307D25A33AE72F2F64CD5FA175348F84
url: https://dl.jami.net/nightly/ubuntu_18.04/ url: https://dl.jami.net/nightly/ubuntu_22.04/
parts: parts:
desktop-launch: desktop-launch:
...@@ -174,8 +176,10 @@ parts: ...@@ -174,8 +176,10 @@ parts:
plugin: nil plugin: nil
build-packages: build-packages:
- dpkg-dev - dpkg-dev
- gcc-8 - gcc
- g++-8 - g++
- cmake
- cmake-data
- libqt-jami - libqt-jami
- devscripts - devscripts
- equivs - equivs
...@@ -246,7 +250,6 @@ parts: ...@@ -246,7 +250,6 @@ parts:
- PATH: "$QT_BASE_DIR/bin:$PATH" - PATH: "$QT_BASE_DIR/bin:$PATH"
- LD_LIBRARY_PATH: "$QT_BASE_DIR/lib:$LD_LIBRARY_PATH" - LD_LIBRARY_PATH: "$QT_BASE_DIR/lib:$LD_LIBRARY_PATH"
- PKG_CONFIG_PATH: "$QT_BASE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH" - PKG_CONFIG_PATH: "$QT_BASE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH"
- PATH: "/usr/bin/cmake/bin:${PATH}"
override-pull: | override-pull: |
snapcraftctl pull snapcraftctl pull
sed -i -E 's|(tmpName) << (PACKAGE_NAME << "_shm_")|\1 << "snap.jami." << \2|' daemon/src/media/video/sinkclient.cpp sed -i -E 's|(tmpName) << (PACKAGE_NAME << "_shm_")|\1 << "snap.jami." << \2|' daemon/src/media/video/sinkclient.cpp
...@@ -254,20 +257,6 @@ parts: ...@@ -254,20 +257,6 @@ parts:
sed -i -E 's|^Icon=.*|Icon=${SNAP}/usr/share/icons/hicolor/scalable/apps/jami.svg|' client-qt/$file sed -i -E 's|^Icon=.*|Icon=${SNAP}/usr/share/icons/hicolor/scalable/apps/jami.svg|' client-qt/$file
done done
override-build: | override-build: |
apt-get remove cmake cmake-data
# We need Cmake > 3.19, which is not in core20
wget https://github.com/Kitware/CMake/releases/download/v3.19.8/cmake-3.19.8-Linux-x86_64.sh \
-q -O /tmp/cmake-install.sh \
&& echo "aa5a0e0dd5594b7fd7c107a001a2bfb5f83d9b5d89cf4acabf423c5d977863ad /tmp/cmake-install.sh" | sha256sum --check \
&& chmod u+x /tmp/cmake-install.sh \
&& mkdir /usr/bin/cmake \
&& /tmp/cmake-install.sh --skip-license --prefix=/usr/bin/cmake \
&& rm /tmp/cmake-install.sh
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 20
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 20
cd $SNAPCRAFT_PART_BUILD/daemon/contrib cd $SNAPCRAFT_PART_BUILD/daemon/contrib
mkdir -p native mkdir -p native
cd native cd native
...@@ -297,74 +286,73 @@ parts: ...@@ -297,74 +286,73 @@ parts:
- autopoint - autopoint
- bzip2 - bzip2
- curl - curl
- gcc-8 - gcc
- g++-8 - g++
- gettext - gettext
- gzip - gzip
- libargon2-0-dev
- libasound2-dev
- libavcodec-dev
- libavdevice-dev
- libavformat-dev
- libboost-dev
- libdbus-1-dev
- libdbus-c++-dev
- libexpat1-dev
- libglu1-mesa-dev
- libgnutls28-dev
- libjack-jackd2-dev
- libjsoncpp-dev
- libnm-dev
- libfmt-dev
- libnotify-dev - libnotify-dev
- libopus-dev
- libpcre3-dev
- libpulse-dev
- libqrencode-dev - libqrencode-dev
- libsamplerate0-dev
- libsndfile1-dev - libsndfile1-dev
- libspeex-dev - libspeex-dev
- libspeexdsp-dev
- libsrtp0-dev
- libssl-dev
- libswscale-dev
- libtool
- libudev-dev
- libupnp-dev
- libva-dev
- libvdpau-dev
- libyaml-cpp-dev
- nasm # seems to be needed for building libvpx on an 18.04 base
- python3 - python3
- python3-dev
- uuid-dev - uuid-dev
- yasm - yasm
- wget - wget
- nasm # ffmpeg
- libavcodec-dev
- libavdevice-dev
- libavformat-dev
- libswscale-dev
- libva-dev
- libvdpau-dev
- libargon2-0-dev # opendht
- libexpat1-dev
- libjsoncpp-dev
- libnm-dev # connectivityChanged()
- libdbus-1-dev # dbus
- libdbus-c++-dev
- libpulse-dev # pulse
- libudev-dev
- libglu1-mesa-dev # Qt 6
- zlib1g-dev
- libgl-dev
- libvulkan-dev
- libgnutls28-dev # TLS
- gnutls-bin
- libssl-dev
stage-packages: stage-packages:
- libavcodec-extra
- libavcodec57
- libavdevice57
- libavformat57
- libdbus-1-3
- libdbus-c++-1-0v5
- libexpat1
- libglu1-mesa
- libgnutls30 - libgnutls30
- libjack-jackd2-0 - libavutil56
- libjsoncpp1 - libdouble-conversion3
- libnm-dev - libegl1
- libgbm1
- libgstreamer-gl1.0-0
- libgstreamer-plugins-base1.0-0
- libgstreamer1.0-0
- libgudev-1.0-0
- libjsoncpp25
- libllvm12
- libminizip1
- libnm0
- libnotify4
- libnspr4
- libnss3
- libopengl0
- libopus0 - libopus0
- libpcre3 - liborc-0.4-0
- libqrencode3 - libpcre2-16-0
- libsamplerate0 - libqrencode4
- libslang2
- libsndfile1
- libqt-jami - libqt-jami
- libsnappy1v5
- libspeex1 - libspeex1
- libspeexdsp1 - libproxy1v5
- libswscale4 - libwayland-server0
- libudev1 - libwebpdemux2
- libupnp6 - libwebpmux3
- libuuid1 - libxkbfile1
- libxtst6
- ocl-icd-libopencl1
- libva-drm2 - libva-drm2
- libva-glx2 - libva-glx2
- libva-wayland2 - libva-wayland2
......
Description: add and run our build script
Also, use bionic (18.04) as the base image, since xenial lacks
libayatana-appindicator3-dev.
Author: Amin Bandali <amin.bandali@savoirfairelinux.com>
--- ../docker/Dockerfile_snap.original 2020-11-23 15:51:17.211591055 -0500
+++ ../docker/Dockerfile_snap 2020-11-23 15:52:29.247759416 -0500
@@ -1,4 +1,4 @@
-FROM ubuntu:xenial as builder
+FROM ubuntu:bionic as builder
# Grab dependencies
RUN apt-get update
@@ -36,7 +36,7 @@
# Multi-stage build, only need the snaps from the builder. Copy them one at a
# time so they can be cached.
-FROM ubuntu:xenial
+FROM ubuntu:bionic
COPY --from=builder /snap/core /snap/core
COPY --from=builder /snap/core18 /snap/core18
COPY --from=builder /snap/snapcraft /snap/snapcraft
@@ -53,3 +53,7 @@
ENV SNAP="/snap/snapcraft/current"
ENV SNAP_NAME="snapcraft"
ENV SNAP_ARCH="amd64"
+
+ADD scripts/build-package-snap.sh /opt/build-package-snap.sh
+
+CMD ["/opt/build-package-snap.sh"]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment