diff --git a/Makefile b/Makefile index cf924827630502a755f69484408a905dab0ad535..c4679d74c994501d36097a7f06e49d6fc2eb0298 100644 --- a/Makefile +++ b/Makefile @@ -271,16 +271,6 @@ list-package-targets: @$(foreach p,$(PACKAGE-TARGETS),\ 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 ## ################### diff --git a/docker/Dockerfile_snap b/docker/Dockerfile_snap index 28371943e1131a43ef873304475778abe89e4b8d..eea2f5378cd70cbd7b8a4b91c2d55e55d9e4e2b2 100644 --- a/docker/Dockerfile_snap +++ b/docker/Dockerfile_snap @@ -1,6 +1,6 @@ -FROM ubuntu:xenial as builder +FROM ubuntu:jammy as builder -# Grab dependencies +# Grab dependencies. RUN apt-get update RUN apt-get dist-upgrade --yes 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 # 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 unsquashfs -d /snap/core/current core.snap # Grab the core18 snap (which snapcraft uses as a base) from the stable channel # 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 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. -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 unsquashfs -d /snap/snapcraft/current snapcraft.snap @@ -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 # time so they can be cached. -FROM ubuntu:xenial +FROM ubuntu:jammy COPY --from=builder /snap/core /snap/core 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/bin/snapcraft /snap/bin/snapcraft @@ -52,4 +64,8 @@ ENV LC_ALL="en_US.UTF-8" ENV PATH="/snap/bin:$PATH" 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"] diff --git a/docker/README.md b/docker/README.md index 7618fe4e18e5d521ff2ebaa459ae2f7d555af9af..c9889d04fc8aed056c2916e71cfa6b948e75dd07 100644 --- a/docker/README.md +++ b/docker/README.md @@ -28,9 +28,8 @@ TODO ### 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. -It is patched with `../patches/docker-snap-build-scripts.patch` to -add and invoke our build script. +It was modified to support `core22`. -[stable.Dockerfile]: https://raw.githubusercontent.com/snapcore/snapcraft/master/docker/stable.Dockerfile +[stable.Dockerfile]: https://raw.githubusercontent.com/snapcore/snapcraft/main/docker/Dockerfile diff --git a/packaging/rules/snap/jami/snapcraft.yaml b/packaging/rules/snap/jami/snapcraft.yaml index 7a5f7806a81f7245c0a3dcb562fdb63996e9cce0..f0ddf0511e87f9ce6438de096d5da13378c16acb 100644 --- a/packaging/rules/snap/jami/snapcraft.yaml +++ b/packaging/rules/snap/jami/snapcraft.yaml @@ -85,13 +85,13 @@ description: | confinement: strict grade: stable -base: core18 +base: core22 plugs: - gnome-3-28-1804: + gnome-42-2204: interface: content 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: interface: content target: $SNAP/data-dir/themes @@ -125,6 +125,8 @@ layout: environment: XDG_CURRENT_DESKTOP: Unity + QT_BASE_DIR: "/usr/lib/libqt-jami" + LD_LIBRARY_PATH: "$LD_LIBRARY_PATH:$SNAP$QT_BASE_DIR/lib" apps: jami: @@ -166,7 +168,7 @@ package-repositories: components: [main] suites: [jami] key-id: A295D773307D25A33AE72F2F64CD5FA175348F84 - url: https://dl.jami.net/nightly/ubuntu_18.04/ + url: https://dl.jami.net/nightly/ubuntu_22.04/ parts: desktop-launch: @@ -174,8 +176,10 @@ parts: plugin: nil build-packages: - dpkg-dev - - gcc-8 - - g++-8 + - gcc + - g++ + - cmake + - cmake-data - libqt-jami - devscripts - equivs @@ -246,7 +250,6 @@ parts: - PATH: "$QT_BASE_DIR/bin:$PATH" - LD_LIBRARY_PATH: "$QT_BASE_DIR/lib:$LD_LIBRARY_PATH" - PKG_CONFIG_PATH: "$QT_BASE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH" - - PATH: "/usr/bin/cmake/bin:${PATH}" override-pull: | snapcraftctl pull sed -i -E 's|(tmpName) << (PACKAGE_NAME << "_shm_")|\1 << "snap.jami." << \2|' daemon/src/media/video/sinkclient.cpp @@ -254,20 +257,6 @@ parts: sed -i -E 's|^Icon=.*|Icon=${SNAP}/usr/share/icons/hicolor/scalable/apps/jami.svg|' client-qt/$file done 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 mkdir -p native cd native @@ -297,74 +286,73 @@ parts: - autopoint - bzip2 - curl - - gcc-8 - - g++-8 + - gcc + - g++ - gettext - 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 - - libopus-dev - - libpcre3-dev - - libpulse-dev - libqrencode-dev - - libsamplerate0-dev - libsndfile1-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-dev - uuid-dev - yasm - 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: - - libavcodec-extra - - libavcodec57 - - libavdevice57 - - libavformat57 - - libdbus-1-3 - - libdbus-c++-1-0v5 - - libexpat1 - - libglu1-mesa - libgnutls30 - - libjack-jackd2-0 - - libjsoncpp1 - - libnm-dev + - libavutil56 + - libdouble-conversion3 + - 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 - - libpcre3 - - libqrencode3 - - libsamplerate0 - - libslang2 - - libsndfile1 + - liborc-0.4-0 + - libpcre2-16-0 + - libqrencode4 - libqt-jami + - libsnappy1v5 - libspeex1 - - libspeexdsp1 - - libswscale4 - - libudev1 - - libupnp6 - - libuuid1 + - libproxy1v5 + - libwayland-server0 + - libwebpdemux2 + - libwebpmux3 + - libxkbfile1 + - libxtst6 + - ocl-icd-libopencl1 - libva-drm2 - libva-glx2 - libva-wayland2 diff --git a/patches/docker-snap-build-scripts.patch b/patches/docker-snap-build-scripts.patch deleted file mode 100644 index 82838f15f9f97ea6426261943b3ef89ae49e8489..0000000000000000000000000000000000000000 --- a/patches/docker-snap-build-scripts.patch +++ /dev/null @@ -1,30 +0,0 @@ -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"]