diff --git a/snapcraft.yaml b/snapcraft.yaml index 1328ef42..6fccffa4 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -89,8 +89,6 @@ parts: override-stage: | set -eux craftctl default - rm $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/lib[mc].a || : - rm $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/lib[mc].so || : LIBTOOLIZE=usr/bin/libtoolize sed -i 's#pkgauxdir="#pkgauxdir="$CRAFT_STAGE#' $LIBTOOLIZE sed -i 's#pkgltdldir="#pkgltdldir="$CRAFT_STAGE#' $LIBTOOLIZE @@ -1405,9 +1403,13 @@ parts: - libbrotli-dev - libbz2-1.0 - libbz2-dev + - libc6 + - libc6-dev - libcairo2-dev - libcanberra-gtk3-dev + - libcrypt1 - libcrypt-dev + - libcom-err2 - libcurl4-openssl-dev - libdbus-1-3 - libdbus-1-dev @@ -1415,10 +1417,12 @@ parts: - libdrm2 - libdrm-dev - libegl1-mesa-dev + - libelf1t64 - libevdev2 - libevdev-dev - libexpat1 - libexpat1-dev + - libffi8 - libfontconfig1-dev - libfreetype6 - libfreetype-dev @@ -1440,6 +1444,7 @@ parts: - libgraphene-1.0-dev - libgraphviz-dev - libgspell-1-dev + - libgssapi-krb5-2 - libgstreamer-plugins-bad1.0-dev - libgstreamer-plugins-base1.0-dev - libgstreamer-plugins-good1.0-dev @@ -1450,6 +1455,8 @@ parts: - libidn2-0 - libidn2-dev - libjpeg-dev + - libk5crypto3 + - libkrb5support0 - libkrb5-3 - libkrb5-dev - liblcms2-dev @@ -1468,6 +1475,8 @@ parts: - libnsl-dev - libnss3-dev - libopenjp2-7-dev + - libpciaccess0 + - libpciaccess-dev - libpcre2-8-0 - libpcre2-dev - libpcre3 @@ -1499,6 +1508,7 @@ parts: - libtasn1-6-dev - libtdb-dev - libthai-dev + - libtirpc3t64 - libudev1 - libudev-dev - libunity-dev @@ -1552,19 +1562,18 @@ parts: override-build: | set -eux craftctl default + + # Drop all the duplicates *.so.* library files that have been pulled from + # deb files and that we're already shipping as part of source-compiled parts cd $CRAFT_STAGE/usr - find . -type f,l -exec rm -f $CRAFT_PART_INSTALL/usr/{} \; - find . -type f,l -name "*.so*" -exec bash -c "rm -f $CRAFT_PART_INSTALL/usr/{}*" \; + find . -type f,l -exec rm -fv $CRAFT_PART_INSTALL/usr/{} \; + find . -type f,l -name "*.so.*" -exec sh -c "rm -fv $CRAFT_PART_INSTALL/usr/{}*" \; cd $CRAFT_STAGE/usr/lib - find . -type f,l -exec rm -f $CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/{} \; - find . -type f,l -name "*.so*" -exec bash -c "rm -f $CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/{}*" \; + find . -type f,l -exec rm -fv $CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/{} \; + find . -type f,l -name "*.so.*" -exec sh -c "rm -fv $CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/{}*" \; cd $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR - find . -type f,l -exec rm -f $CRAFT_PART_INSTALL/usr/lib/{} \; - find . -type f,l -name "*.so*" -exec bash -c "rm -f $CRAFT_PART_INSTALL/usr/lib/{}*" \; - # FIXME, need to figure out why libayatana-appindicator install those - rm -f $CRAFT_PART_INSTALL/usr/lib/*/libatk-1.0.so* - rm -f $CRAFT_PART_INSTALL/usr/lib/*/libatk-bridge-2.0.so* - rm -f $CRAFT_PART_INSTALL/usr/lib/*/libatspi.so* + find . -type f,l -exec rm -fv $CRAFT_PART_INSTALL/usr/lib/{} \; + find . -type f,l -name "*.so.*" -exec sh -c "rm -fv $CRAFT_PART_INSTALL/usr/lib/{}*" \; conditioning: after: [ debs ] @@ -1637,10 +1646,19 @@ parts: ln -s gettext-0.19.8 usr/share/gettext-current ln -s gdk-pixbuf-2.0/2.10.0 usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gdk-pixbuf-current - # Fix dangling symlink by overwriting it - ln -sf lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libc_malloc_debug.so.0 usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libc_malloc_debug.so - # CHECK THIS When changing the core base, this line must be update - cp /snap/$CRAFT_EXT_CORE_LEVEL/current/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/libc_malloc_debug.so.0 lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/ + # Check dangling libraries symlinks + invalid_links=() + core_root_prefix=/snap/$CRAFT_EXT_CORE_LEVEL/current + for i in $(find "$CRAFT_PRIME"/{usr/,}lib -xtype l -name '*.so'); do + echo "$i: dangling symlink!" + invalid_links+=($i) + done + if [ ${#invalid_links[@]} -gt 0 ]; then + echo "Invalid symlinks found:" + echo "${invalid_links[@]}" + echo "Ensure full package set (runtime and dev files) is staged!" + exit 1; + fi # Necessary for armhf builds, triggers review warning if [ "$CRAFT_ARCH_TRIPLET_BUILD_FOR" = "arm-linux-gnueabihf" ]; then @@ -1684,11 +1702,6 @@ parts: rm -rf usr/share/locale-langpack/kab rm -f usr/share/unity/client-scopes.json - # Libm is a dangling symlink in armhf and riscv64, breaking builds. - # We don't need them anyway, the base image has them. - rm -f usr/lib/*/lib[mc].so || : - rm -f usr/lib/*/lib[mc].a || : - find . -type d -empty -delete PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin