From: Uwe Hermann Date: Mon, 21 Aug 2017 14:58:12 +0000 (+0200) Subject: sigrok-native-appimage: Bump upstream files in contrib/. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8c7df9803dc795e641525b24f030281bd5a00198;p=sigrok-util.git sigrok-native-appimage: Bump upstream files in contrib/. --- diff --git a/cross-compile/appimage/contrib/excludelist b/cross-compile/appimage/contrib/excludelist index 7e03b0e..e8ee31b 100644 --- a/cross-compile/appimage/contrib/excludelist +++ b/cross-compile/appimage/contrib/excludelist @@ -2,35 +2,40 @@ # should NOT be bundled inside AppImages. This is a working document; expect it to change # over time. File format: one filename per line. Each entry should have a justification comment. +ld-linux.so.2 +ld-linux-x86-64.so.2 +libanl.so.1 +libBrokenLocale.so.1 +libcidn.so.1 +libcrypt.so.1 libc.so.6 -# Workaround for: -# relocation error: usr/lib/libc.so.6: symbol _dl_starting_up, version GLIBC_PRIVATE not defined in file ld-linux-x86-64.so.2 with link time reference - libdl.so.2 -# Workaround for: -# Segmentation fault - -libstdc++.so.6 -# Workaround for: -# usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found - libm.so.6 -# Workaround for: -# relocation error: usr/lib/libm.so.6: symbol __get_cpu_features, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference - +libmvec.so.1 +libnsl.so.1 +libnss_compat.so.2 +libnss_db.so.2 +libnss_dns.so.2 +libnss_files.so.2 +libnss_hesiod.so.2 +libnss_nisplus.so.2 +libnss_nis.so.2 libpthread.so.0 -# Workaround for: -# usr/bin/inkscape: relocation error: usr/lib/libpthread.so.0: symbol h_errno, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference - libresolv.so.2 +librt.so.1 +libthread_db.so.1 +libutil.so.1 +# These files are all part of the GNU C Library which should never be bundled. +# List was generated from a fresh build of glibc 2.25. + +libstdc++.so.6 # Workaround for: -# usr/lib/libresolv.so.2: symbol h_errno, version GLIBC_PRIVATE not defined in file libc.so.6 with link time reference +# usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.21' not found libGL.so.1 -# Workaround for: -# Different distributions put dri/ libraries in different places, which are not found if we supply a bundled libGL.so.1 -# /usr/lib/x86_64-linux-gnu/dri/swrast_dri.so -# /usr/lib64/dri/swrast_dri.so +# Part of the video driver (OpenGL); present on any regular +# desktop system, may also be provided by proprietary drivers. +# Known to cause issues if it's bundled. libdrm.so.2 # Workaround for: @@ -45,6 +50,9 @@ libxcb.so.1 # Fedora 23 # symbol lookup error: /lib64/libxcb-dri3.so.0: undefined symbol: xcb_send_fd # Uncertain if this is required to be bundled for some distributions - if so we need to write a version check script and use LD_PRELOAD to load the system version if it is newer +# Fedora 25: +# undefined symbol: xcb_send_request_with_fds +# https://github.com/probonopd/AppImages/issues/128 libX11.so.6 # Workaround for: @@ -56,9 +64,8 @@ libgio-2.0.so.0 # Workaround for: # On Ubuntu, "symbol lookup error: /usr/lib/x86_64-linux-gnu/gtk-2.0/modules/liboverlay-scrollbar.so: undefined symbol: g_settings_new" -libgdk-x11-2.0.so.0 -libgtk-x11-2.0.so.0 -# Simply to reduce size - not known to cause issues +# libgdk-x11-2.0.so.0 # Missing on openSUSE-Tumbleweed-KDE-Live-x86_64-Snapshot20170601-Media.iso +# libgtk-x11-2.0.so.0 # Missing on openSUSE-Tumbleweed-KDE-Live-x86_64-Snapshot20170601-Media.iso libasound.so.2 # Workaround for: @@ -85,41 +92,39 @@ libexpat.so.1 libgcc_s.so.1 libglib-2.0.so.0 libgpg-error.so.0 -libgssapi_krb5.so.2 +# libgssapi_krb5.so.2 # Disputed, seemingly needed by Arch Linux since Kerberos is named differently there # libgssapi.so.3 # Seemingly needed when running Ubuntu 14.04 binaries on Fedora 23 -libhcrypto.so.4 +# libhcrypto.so.4 # Missing on openSUSE LEAP 42.0 # libheimbase.so.1 # Seemingly needed when running Ubuntu 14.04 binaries on Fedora 23 # libheimntlm.so.0 # Seemingly needed when running Ubuntu 14.04 binaries on Fedora 23 -libhx509.so.5 +# libhx509.so.5 # Missing on openSUSE LEAP 42.0 libICE.so.6 libidn.so.11 libk5crypto.so.3 libkeyutils.so.1 -libkrb5.so.26 -libkrb5.so.3 -libkrb5support.so.0 -libm.so.6 +# libkrb5.so.26 # Disputed, seemingly needed by Arch Linux since Kerberos is named differently there. Missing on openSUSE LEAP 42.0 +# libkrb5.so.3 # Disputed, seemingly needed by Arch Linux since Kerberos is named differently there +# libkrb5support.so.0 # Disputed, seemingly needed by Arch Linux since Kerberos is named differently there libp11-kit.so.0 -# libpcre.so.3 # Missing on Fedora 24 and on SLED 12 SP1 -libpthread.so.0 -libresolv.so.2 -libroken.so.18 -librt.so.1 +# libpcre.so.3 # Missing on Fedora 24, SLED 12 SP1, and openSUSE Leap 42.2 +# libroken.so.18 # Mission on openSUSE LEAP 42.0 # libsasl2.so.2 # Seemingly needed when running Ubuntu 14.04 binaries on Fedora 23 libSM.so.6 libusb-1.0.so.0 libuuid.so.1 -libwind.so.0 +# libwind.so.0 # Missing on openSUSE LEAP 42.0 libz.so.1 -# Remove these libraries, we need to use the system versions; -# this means that Ubuntu 11.04 is not supported (making 12.04 is our baseline) -libGL.so.1 -libdrm.so.2 - # Potentially dangerous libraries libgobject-2.0.so.0 +# Workaround for: +# Rectangles instead of fonts +# https://github.com/probonopd/AppImages/issues/240 +libpangoft2-1.0.so.0 +libpangocairo-1.0.so.0 +libpango-1.0.so.0 + # Workaround for: # e.g., Spotify # relocation error: /lib/x86_64-linux-gnu/libgcrypt.so.20: @@ -137,12 +142,6 @@ libgpg-error.so.0 # and https://github.com/probonopd/AppImages/pull/114 # libnss3.so -# Workaround for: -# Fedora 25: -# undefined symbol: xcb_send_request_with_fds -# https://github.com/probonopd/AppImages/issues/128 -libxcb.so.1 - # The following cannot be excluded, see # https://github.com/probonopd/AppImages/commit/6c7473d8cdaaa2572248dcc53d7f617a577ade6b # http://stackoverflow.com/questions/32644157/forcing-a-binary-to-use-a-specific-newer-version-of-a-shared-library-so diff --git a/cross-compile/appimage/contrib/functions.sh b/cross-compile/appimage/contrib/functions.sh index 3306fda..a266cd9 100644 --- a/cross-compile/appimage/contrib/functions.sh +++ b/cross-compile/appimage/contrib/functions.sh @@ -1,7 +1,7 @@ # This file is supposed to be sourced by each Recipe # that wants to use the functions contained herein # like so: -# wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh +# wget -q https://github.com/AppImage/AppImages/raw/master/functions.sh -O ./functions.sh # . ./functions.sh # RECIPE=$(realpath "$0") @@ -22,6 +22,33 @@ OPTIONS="-o Debug::NoLocking=1 -o APT::Install-Suggests=0 " +# Detect system architecture to know which binaries of AppImage tools +# should be downloaded and used. +case "$(uname -i)" in + x86_64|amd64) +# echo "x86-64 system architecture" + SYSTEM_ARCH="x86_64";; + i?86) +# echo "x86 system architecture" + SYSTEM_ARCH="i686";; +# arm*) +# echo "ARM system architecture" +# SYSTEM_ARCH="";; + unknown) +# uname -i not answer on debian, then: + case "$(uname -m)" in + x86_64|amd64) +# echo "x86-64 system architecture" + SYSTEM_ARCH="x86_64";; + i?86) +# echo "x86 system architecture" + SYSTEM_ARCH="i686";; + esac ;; + *) + echo "Unsupported system architecture" + exit 1;; +esac + # Either get the file from remote or from a static place. # critical for builds without network access like in Open Build Service cat_file_from_url() @@ -48,8 +75,8 @@ patch_usr() # Download AppRun and make it executable get_apprun() { - # wget -c https://github.com/probonopd/AppImageKit/releases/download/5/AppRun -O ./AppRun # 64-bit - wget -c https://github.com/probonopd/AppImageKit/releases/download/6/AppRun_6-x86_64 -O AppRun # 64-bit + TARGET_ARCH=${ARCH:-$SYSTEM_ARCH} + wget -c https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-${TARGET_ARCH} -O AppRun chmod a+x AppRun } @@ -81,16 +108,15 @@ move_lib() # Delete blacklisted files delete_blacklisted() { - BLACKLISTED_FILES=$( cat_file_from_url https://github.com/probonopd/AppImages/raw/master/excludelist | sed '/^\s*$/d' | sed '/^#.*$/d') + BLACKLISTED_FILES=$(cat_file_from_url https://github.com/AppImage/AppImages/raw/master/excludelist | sed 's|#.*||g') echo $BLACKLISTED_FILES for FILE in $BLACKLISTED_FILES ; do - FOUND=$(find . -xtype f -name "${FILE}" 2>/dev/null) - if [ ! -z "$FOUND" ] ; then - echo "Deleting blacklisted ${FOUND}" - rm -f "${FOUND}" - fi + FILES="$(find . -name "${FILE}" -not -path "./usr/optional/*")" + for FOUND in $FILES ; do + rm -vf "$FOUND" "$(readlink -f "$FOUND")" + done done - + # Do not bundle developer stuff rm -rf usr/include || true rm -rf usr/lib/cmake || true @@ -108,7 +134,7 @@ glibc_needed() get_desktopintegration() { REALBIN=$(grep -o "^Exec=.*" *.desktop | sed -e 's|Exec=||g' | cut -d " " -f 1 | head -n 1) - cat_file_from_url https://raw.githubusercontent.com/probonopd/AppImageKit/master/desktopintegration > ./usr/bin/$REALBIN.wrapper + cat_file_from_url https://raw.githubusercontent.com/AppImage/AppImageKit/master/desktopintegration > ./usr/bin/$REALBIN.wrapper chmod a+x ./usr/bin/$REALBIN.wrapper sed -i -e "s|^Exec=$REALBIN|Exec=$REALBIN.wrapper|g" $1.desktop @@ -117,6 +143,11 @@ get_desktopintegration() # Generate AppImage; this expects $ARCH, $APP and $VERSION to be set generate_appimage() { + # Download AppImageAssistant + URL="https://github.com/AppImage/AppImageKit/releases/download/6/AppImageAssistant_6-${SYSTEM_ARCH}.AppImage" + wget -c "$URL" -O AppImageAssistant + chmod a+x ./AppImageAssistant + # if [[ "$RECIPE" == *ecipe ]] ; then # echo "#!/bin/bash -ex" > ./$APP.AppDir/Recipe # echo "# This recipe was used to generate this AppImage." >> ./$APP.AppDir/Recipe @@ -142,37 +173,39 @@ generate_appimage() exit 1 fi fi - wget -c "https://github.com/probonopd/AppImageKit/releases/download/6/AppImageAssistant_6-x86_64.AppImage" -O AppImageAssistant # (64-bit) - chmod a+x ./AppImageAssistant + mkdir -p ../out || true - rm ../out/$APP"-"$VERSION"-x86_64.AppImage" 2>/dev/null || true - ./AppImageAssistant ./$APP.AppDir/ ../out/$APP"-"$VERSION"-"$ARCH".AppImage" + rm ../out/$APP"-"$VERSION".glibc"$GLIBC_NEEDED"-"$ARCH".AppImage" 2>/dev/null || true + GLIBC_NEEDED=${GLIBC_NEEDED:=$(glibc_needed)} + ./AppImageAssistant ./$APP.AppDir/ ../out/$APP"-"$VERSION".glibc"$GLIBC_NEEDED"-"$ARCH".AppImage" } # Generate AppImage type 2 generate_type2_appimage() { # Get the ID of the last successful build on Travis CI - # ID=$(wget -q https://api.travis-ci.org/repos/probonopd/appimagetool/builds -O - | head -n 1 | sed -e 's|}|\n|g' | grep '"result":0' | head -n 1 | sed -e 's|,|\n|g' | grep '"id"' | cut -d ":" -f 2) + # ID=$(wget -q https://api.travis-ci.org/repos/AppImage/appimagetool/builds -O - | head -n 1 | sed -e 's|}|\n|g' | grep '"result":0' | head -n 1 | sed -e 's|,|\n|g' | grep '"id"' | cut -d ":" -f 2) # Get the transfer.sh URL from the logfile of the last successful build on Travis CI # Only Travis knows why build ID and job ID don't match and why the above doesn't give both... # URL=$(wget -q "https://s3.amazonaws.com/archive.travis-ci.org/jobs/$((ID+1))/log.txt" -O - | grep "https://transfer.sh/.*/appimagetool" | tail -n 1 | sed -e 's|\r||g') # if [ -z "$URL" ] ; then # URL=$(wget -q "https://s3.amazonaws.com/archive.travis-ci.org/jobs/$((ID+2))/log.txt" -O - | grep "https://transfer.sh/.*/appimagetool" | tail -n 1 | sed -e 's|\r||g') # fi - URL="https://github.com/probonopd/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" + URL="https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-${SYSTEM_ARCH}.AppImage" wget -c "$URL" -O appimagetool chmod a+x ./appimagetool set +x if ( [ ! -z "$KEY" ] ) && ( ! -z "$TRAVIS" ) ; then - wget https://github.com/probonopd/AppImageKit/files/584665/data.zip -O data.tar.gz.gpg + wget https://github.com/AppImage/AppImageKit/files/584665/data.zip -O data.tar.gz.gpg ( set +x ; echo $KEY | gpg2 --batch --passphrase-fd 0 --no-tty --skip-verify --output data.tar.gz --decrypt data.tar.gz.gpg ) tar xf data.tar.gz sudo chown -R $USER .gnu* mv $HOME/.gnu* $HOME/.gnu_old ; mv .gnu* $HOME/ - VERSION=$VERSION ./appimagetool -n -s --bintray-user $BINTRAY_USER --bintray-repo $BINTRAY_REPO -v ./$APP.AppDir/ + GLIBC_NEEDED=${GLIBC_NEEDED:=$(glibc_needed)} + VERSION=$VERSION.glibc$GLIBC_NEEDED ./appimagetool -n -s --bintray-user $BINTRAY_USER --bintray-repo $BINTRAY_REPO -v ./$APP.AppDir/ else - VERSION=$VERSION ./appimagetool -n --bintray-user $BINTRAY_USER --bintray-repo $BINTRAY_REPO -v ./$APP.AppDir/ + GLIBC_NEEDED=${GLIBC_NEEDED:=$(glibc_needed)} + VERSION=$VERSION.glibc$GLIBC_NEEDED ./appimagetool -n --bintray-user $BINTRAY_USER --bintray-repo $BINTRAY_REPO -v ./$APP.AppDir/ fi set -x mkdir -p ../out/ || true @@ -180,14 +213,14 @@ generate_type2_appimage() } # Generate status file for use by apt-get; assuming that the recipe uses no newer -# ingredients than what would require more recent dependencies than what we assume +# ingredients than what would require more recent dependencies than what we assume # to be part of the base system generate_status() { mkdir -p ./tmp/archives/ mkdir -p ./tmp/lists/partial touch tmp/pkgcache.bin tmp/srcpkgcache.bin - wget -q -c "https://github.com/probonopd/AppImages/raw/master/excludedeblist" + wget -q -c "https://github.com/AppImage/AppImages/raw/master/excludedeblist" rm status 2>/dev/null || true for PACKAGE in $(cat excludedeblist | cut -d "#" -f 1) ; do printf "Package: $PACKAGE\nStatus: install ok installed\nArchitecture: all\nVersion: 9:999.999.999\n\n" >> status @@ -200,6 +233,13 @@ get_desktop() find usr/share/applications -iname "*${LOWERAPP}.desktop" -exec cp {} . \; || true } +fix_desktop() { + # fix trailing semicolons + for key in Actions Categories Implements Keywords MimeType NotShowIn OnlyShowIn; do + sed -i '/'"$key"'.*[^;]$/s/$/;/' $1 + done +} + # Find the icon file and copy it to the AppDir get_icon() { @@ -218,24 +258,22 @@ get_version() if [ -z "$THEDEB" ] ; then echo "Version could not be determined from the .deb; you need to determine it manually" fi - VER1=$(echo $THEDEB | cut -d "~" -f 1 | cut -d "_" -f 2 | cut -d "-" -f 1 | sed -e 's|1%3a||g' | sed -e 's|+dfsg||g' ) - GLIBC_NEEDED=$(glibc_needed) - VERSION=$VER1.glibc$GLIBC_NEEDED + VERSION=$(echo $THEDEB | cut -d "~" -f 1 | cut -d "_" -f 2 | cut -d "-" -f 1 | sed -e 's|1%3a||g' | sed -e 's|+dfsg||g' ) echo $VERSION } # transfer.sh -transfer() { if [ $# -eq 0 ]; then echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi +transfer() { if [ $# -eq 0 ]; then echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; } # Patch binary files; fill with padding if replacement is shorter than original # http://everydaywithlinux.blogspot.de/2012/11/patch-strings-in-binary-files-with-sed.html # Example: patch_strings_in_file foo "/usr/local/lib/foo" "/usr/lib/foo" -function patch_strings_in_file() { +patch_strings_in_file() { local FILE="$1" local PATTERN="$2" local REPLACEMENT="$3" - # Find all unique strings in FILE that contain the pattern + # Find all unique strings in FILE that contain the pattern STRINGS=$(strings ${FILE} | grep ${PATTERN} | sort -u -r) if [ "${STRINGS}" != "" ] ; then echo "File '${FILE}' contain strings with '${PATTERN}' in them:" @@ -251,7 +289,7 @@ function patch_strings_in_file() { while [ ${#NEW_STRING_HEX} -lt ${#OLD_STRING_HEX} ] ; do NEW_STRING_HEX="${NEW_STRING_HEX}00" done - # Now, replace every occurrence of OLD_STRING with NEW_STRING + # Now, replace every occurrence of OLD_STRING with NEW_STRING echo -n "Replacing ${OLD_STRING} with ${NEW_STRING}... " hexdump -ve '1/1 "%.2X"' ${FILE} | \ sed "s/${OLD_STRING_HEX}/${NEW_STRING_HEX}/g" | \ diff --git a/cross-compile/appimage/sigrok-native-appimage b/cross-compile/appimage/sigrok-native-appimage index df14dfa..d4dc191 100755 --- a/cross-compile/appimage/sigrok-native-appimage +++ b/cross-compile/appimage/sigrok-native-appimage @@ -12,6 +12,7 @@ PREFIX=$HOME/sr APPIMAGEKIT_OUTDIR=$HOME/AppImageKit/out +# ARCH=i386 ARCH=x86_64 PYVER=3.4 @@ -112,9 +113,8 @@ rm -r ./home # Determine the version of the app; also include needed glibc version ######################################################################## -VER1="NIGHTLY" GLIBC_NEEDED=$(glibc_needed) -VERSION=$VER1.glibc$GLIBC_NEEDED +VERSION="NIGHTLY.glibc$GLIBC_NEEDED" echo $VERSION ########################################################################