diff --git a/project/bundles/appimage/04-build-appimage.sh b/project/bundles/appimage/04-build-appimage.sh index e17970608e..54da126942 100755 --- a/project/bundles/appimage/04-build-appimage.sh +++ b/project/bundles/appimage/04-build-appimage.sh @@ -1,552 +1,551 @@ #!/bin/bash # Script to bundle data using previously-built KF5 with digiKam installation # and create a Linux AppImage bundle file. # # Copyright (c) 2015-2020 by Gilles Caulier # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. # # Halt and catch errors set -eE trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR if [ "root" != "$USER" ]; then echo "This script must be run as root..." exit fi ################################################################################################# # Manage script traces to log file mkdir -p ./logs exec > >(tee ./logs/build-appimage.full.log) 2>&1 ################################################################################################# echo "04-build-appimage.sh : build digiKam AppImage bundle." echo "-----------------------------------------------------" ################################################################################################# # Pre-processing checks . ./config.sh . ./common.sh ChecksRunAsRoot StartScript ChecksCPUCores HostAdjustments RegisterRemoteServers if [[ "$(arch)" = "x86_64" ]] ; then LIBSUFFIX=lib64 else LIBSUFFIX=lib fi ################################################################################################# # Working directory ORIG_WD="`pwd`" DK_RELEASEID=`cat $ORIG_WD/data/RELEASEID.txt` ################################################################################################# echo -e "---------- Build icons-set ressource\n" cd $ORIG_WD/icon-rcc rm -f CMakeCache.txt > /dev/null cmake -DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_BUILD_TYPE=debug \ -DCMAKE_COLOR_MAKEFILE=ON \ -Wno-dev \ . make -j$CPU_CORES ################################################################################################# echo -e "---------- Prepare directories in bundle\n" # Make sure we build from the /, parts of this script depends on that. We also need to run as root... cd / # Prepare the install location rm -rf $APP_IMG_DIR/ || true mkdir -p $APP_IMG_DIR/usr/bin mkdir -p $APP_IMG_DIR/usr/etc mkdir -p $APP_IMG_DIR/usr/share mkdir -p $APP_IMG_DIR/usr/share/icons mkdir -p $APP_IMG_DIR/usr/share/metainfo mkdir -p $APP_IMG_DIR/usr/share/dbus-1/interfaces mkdir -p $APP_IMG_DIR/usr/share/dbus-1/services # make sure lib and lib64 are the same thing mkdir -p $APP_IMG_DIR/usr/lib mkdir -p $APP_IMG_DIR/usr/lib/libexec mkdir -p $APP_IMG_DIR/usr/lib/libgphoto2 mkdir -p $APP_IMG_DIR/usr/lib/libgphoto2_port cd $APP_IMG_DIR/usr ln -s lib lib64 ################################################################################################# echo -e "---------- Copy Files in bundle\n" cd $APP_IMG_DIR # FIXME: How to find out which subset of plugins is really needed? I used strace when running the binary cp -r /usr/plugins ./usr/ rm -fr ./usr/plugins/ktexteditor rm -fr ./usr/plugins/kf5/parts rm -fr ./usr/plugins/konsolepart.so # copy runtime data files cp -r /usr/share/digikam ./usr/share cp -r /usr/share/showfoto ./usr/share cp $ORIG_WD/icon-rcc/breeze.rcc ./usr/share/digikam cp $ORIG_WD/icon-rcc/breeze-dark.rcc ./usr/share/digikam cd $APP_IMG_DIR/usr/share/showfoto ln -s ../digikam/breeze.rcc breeze.rcc ln -s ../digikam/breeze-dark.rcc breeze-dark.rcc cd $APP_IMG_DIR cp $ORIG_WD/data/qt.conf ./usr/bin cp -r /usr/share/lensfun ./usr/share cp -r /usr/share/knotifications5 ./usr/share cp -r /usr/share/kservices5 ./usr/share cp -r /usr/share/kservicetypes5 ./usr/share cp -r /usr/share/kxmlgui5 ./usr/share cp -r /usr/share/kf5 ./usr/share cp -r /usr/share/solid ./usr/share cp -r /usr/share/OpenCV ./usr/share cp -r /usr/share/dbus-1/interfaces/kf5* ./usr/share/dbus-1/interfaces/ cp -r /usr/share/dbus-1/services/*kde* ./usr/share/dbus-1/services/ cp -r /usr/${LIBSUFFIX}/libexec/kf5 ./usr/lib/libexec/ # AppImage stream data file cp -r /usr/share/metainfo/org.kde.digikam.appdata.xml ./usr/share/metainfo/digikam.appdata.xml cp -r /usr/share/metainfo/org.kde.showfoto.appdata.xml ./usr/share/metainfo/showfoto.appdata.xml # QWebEngine bin data files. # NOTE: no ressources data are provided with QtWebKit if [[ $DK_QTWEBENGINE = 1 ]] ; then cp -r /usr/resources ./usr fi # copy libgphoto2 drivers find /usr/${LIBSUFFIX}/libgphoto2 -name "*.so" -type f -exec cp {} ./usr/lib/libgphoto2 \; 2>/dev/null find /usr/${LIBSUFFIX}/libgphoto2_port -name "*.so" -type f -exec cp {} ./usr/lib/libgphoto2_port \; 2>/dev/null # copy sane backends cp -r /usr/${LIBSUFFIX}/sane ./usr/lib cp -r /etc/sane.d ./usr/etc # copy i18n # Qt translations files if [[ -e /usr/translations ]]; then cp -r /usr/translations ./usr # optimizations rm -rf ./usr/translations/assistant* || true rm -rf ./usr/translations/designer* || true rm -rf ./usr/translations/linguist* || true rm -rf ./usr/translations/qmlviewer* || true rm -rf ./usr/translations/qtmultimedia* || true rm -rf ./usr/translations/qtscript* || true rm -rf ./usr/translations/qtquick* || true rm -rf ./usr/translations/qt_help* || true rm -rf ./usr/translations/qtserialport* || true rm -rf ./usr/translations/qtwebsockets* || true fi # KF5 translations files FILES=$(cat $ORIG_WD/logs/build-extralibs.full.log | grep /usr/share/locale | grep -e .qm -e .mo | cut -d' ' -f3) for FILE in $FILES ; do cp --parents $FILE ./ done # digiKam translations files FILES=$(cat $ORIG_WD/logs/build-digikam.full.log | grep /usr/share/locale | grep -e .qm -e .mo | cut -d' ' -f3) for FILE in $FILES ; do cp --parents $FILE ./ done # digiKam icons files FILES=$(cat $ORIG_WD/logs/build-digikam.full.log | grep /usr/share/icons/ | cut -d' ' -f3) for FILE in $FILES ; do cp --parents $FILE ./ done # Marble data and plugins files cp -r /usr/${LIBSUFFIX}/marble/plugins/ ./usr/bin/ cp -r /usr/share/marble/data ./usr/bin/ # otherwise segfaults!? cp $(ldconfig -p | grep /$LIBSUFFIX/libsasl2.so.3 | cut -d ">" -f 2 | xargs) ./usr/lib/ cp $(ldconfig -p | grep /${LIBSUFFIX}/libGL.so.1 | cut -d ">" -f 2 | xargs) ./usr/lib/ cp $(ldconfig -p | grep /${LIBSUFFIX}/libGLU.so.1 | cut -d ">" -f 2 | xargs) ./usr/lib/ # Fedora 23 seemed to be missing SOMETHING from the Centos 6.7. The only message was: # This application failed to start because it could not find or load the Qt platform plugin "xcb". # Setting export QT_DEBUG_PLUGINS=1 revealed the cause. # QLibraryPrivate::loadPlugin failed on "/usr/lib64/qt5/plugins/platforms/libqxcb.so" : # "Cannot load library /usr/lib64/qt5/plugins/platforms/libqxcb.so: (/lib64/libEGL.so.1: undefined symbol: drmGetNodeTypeFromFd)" # Which means that we have to copy libEGL.so.1 in too # Otherwise F23 cannot load the Qt platform plugin "xcb" cp $(ldconfig -p | grep /${LIBSUFFIX}/libEGL.so.1 | cut -d ">" -f 2 | xargs) ./usr/lib/ # let's not copy xcb itself, that breaks on dri3 systems https://bugs.kde.org/show_bug.cgi?id=360552 #cp $(ldconfig -p | grep libxcb.so.1 | cut -d ">" -f 2 | xargs) ./usr/lib/ # For Fedora 20 cp $(ldconfig -p | grep /${LIBSUFFIX}/libfreetype.so.6 | cut -d ">" -f 2 | xargs) ./usr/lib/ cp /usr/bin/digikam ./usr/bin cp /usr/bin/showfoto ./usr/bin cp /usr/bin/kbuildsycoca5 ./usr/bin cp /usr/bin/solid-hardware5 ./usr/bin if [[ $DK_QTWEBENGINE = 1 ]] ; then # QtWebEngine runtime process [[ -e /usr/libexec/QtWebEngineProcess ]] && cp /usr/libexec/QtWebEngineProcess ./usr/bin else # QtWebKit runtime process [[ -e /usr/libexec/QtWebNetworkProcess ]] && cp /usr/libexec/QtWebNetworkProcess ./usr/bin [[ -e /usr/libexec/QtWebProcess ]] && cp /usr/libexec/QtWebProcess ./usr/bin [[ -e /usr/libexec/QtWebStorageProcess ]] && cp /usr/libexec/QtWebStorageProcess ./usr/bin [[ -e /usr/libexec/QtWebPluginProcess ]] && cp /usr/libexec/QtWebPluginProcess ./usr/bin fi # For Solid action when camera is connected to computer cp /usr/bin/qdbus ./usr/share/digikam/utils sed -i "/Exec=/c\Exec=digikam-camera downloadFromUdi %i" ./usr/share/solid/actions/digikam-opencamera.desktop ################################################################################################# echo -e "---------- Scan dependencies recurssively\n" CopyReccursiveDependencies /usr/bin/digikam ./usr/lib CopyReccursiveDependencies /usr/bin/showfoto ./usr/lib CopyReccursiveDependencies /usr/plugins/platforms/libqxcb.so ./usr/lib FILES=$(ls /usr/${LIBSUFFIX}/libdigikam*.so) for FILE in $FILES ; do CopyReccursiveDependencies ${FILE} ./usr/lib done FILES=$(ls /usr/plugins/imageformats/*.so) for FILE in $FILES ; do CopyReccursiveDependencies ${FILE} ./usr/lib done # Copy in the indirect dependencies FILES=$(find . -type f -executable) for FILE in $FILES ; do CopyReccursiveDependencies ${FILE} ./usr/lib done ################################################################################################# echo -e "---------- Clean-up Bundle Directory Contents\n" # The following are assumed to be part of the base system # This list is taken from linuxdeplotqt # [https://github.com/probonopd/linuxdeployqt/blob/master/tools/linuxdeployqt/excludelist.h] # NOTE: libglapi is included explicity in Krita exclude list. EXCLUDE_FILES="\ ld-linux.so.2 \ ld-linux-x86-64.so.2 \ libanl.so.1 \ libasound.so.2 \ libBrokenLocale.so.1 \ libcidn.so.1 \ libcom_err.so.2 \ libcrypt.so.1 \ libc.so.6 \ libdl.so.2 \ libdrm.so.2 \ libexpat.so.1 \ libfontconfig.so.1 \ libfreetype.so.6 \ libgcc_s.so.1 \ libgdk_pixbuf-2.0.so.0 \ libgio-2.0.so.0 \ libglapi.so.0 \ libglib-2.0.so.0 \ libGL.so.1 \ libgobject-2.0.so.0 \ libgpg-error.so.0 \ libharfbuzz.so.0 \ libICE.so.6 \ libjack.so.0 \ libm.so.6 \ 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 \ libp11-kit.so.0 \ libpangocairo-1.0.so.0 \ libpthread.so.0 \ libresolv.so.2 \ librt.so.1 \ libSM.so.6 \ libstdc++.so.6 \ libthai.so.0 \ libthread_db.so.1 \ libusb-1.0.so.0 \ libutil.so.1 \ libuuid.so.1 \ libX11.so.6 \ libxcb.so.1 \ " for FILE in $EXCLUDE_FILES ; do if [[ -f usr/lib/${FILE} ]] ; then echo -e " ==> ${FILE} will be removed for the bundle" rm -f usr/lib/${FILE} fi done # This list is taken from older AppImage build script from krita # NOTE: libopenal => see bug 390162. # libdbus-1 => see Krita rules. EXTRA_EXCLUDE_FILES="\ libgssapi_krb5.so.2 \ libgssapi.so.3 \ libhcrypto.so.4 \ libheimbase.so.1 \ libheimntlm.so.0 \ libhx509.so.5 \ libidn.so.11 \ libk5crypto.so.3 \ libkrb5.so.26 \ libkrb5.so.3 \ libkrb5support.so.0 \ libpcre.so.3 \ libroken.so.18 \ libsasl2.so.2 \ libwind.so.0 \ libopenal.so.1 \ libdbus-1.so.3 \ " #liblber-2.4.so.2 # needed for Debian Wheezy #libldap_r-2.4.so.2 # needed for Debian Wheezy #libffi.so.6 # needed for Ubuntu 11.04 #libxcb-glx.so.0 # needed for Ubuntu 11.04 #libkeyutils.so.1 # Originally removed in linuxdeployqt, but needed for Gentoo (see https://bugs.kde.org/show_bug.cgi?id=406171#c2) #libz.so.1 # needed for Mint 18.1 (see http://digikam.1695700.n4.nabble.com/digikam-6-2-0-64-bit-appimage-error-td4708921.html) #libpango-1.0.so.0 #libpangoft2-1.0.so.0 for FILE in $EXCLUDE_FILES ; do if [[ -f usr/lib/${FILE} ]] ; then echo -e " ==> ${FILE} will be removed for the bundle" rm -f usr/lib/${FILE} fi done ln -s libssl.so.10 usr/lib/libssl.so || true # We don't bundle the developer stuff rm -rf usr/include || true rm -rf usr/lib/cmake3 || true rm -rf usr/lib/pkgconfig || true rm -rf usr/share/ECM/ || true rm -rf usr/share/gettext || true rm -rf usr/share/pkgconfig || true ################################################################################################# # See LFS instruction: http://www.linuxfromscratch.org/lfs/view/systemd/chapter05/stripping.html echo -e "---------- Strip Binaries Files \n" if [[ $DK_DEBUG = 1 ]] ; then FILES=$(find . -type f -executable | grep -Ev '(digikam|showfoto|exiv2)') else FILES=$(find . -type f -executable) fi for FILE in $FILES ; do echo -en "Strip symbols in: $FILE" - /usr/bin/strip --strip-debug ${FILE} - echo -e " ==> OK" + /usr/bin/strip --strip-debug ${FILE} || true done ################################################################################################# echo -e "---------- Strip Configuration Files \n" # Since we set $APP_IMG_DIR as the prefix, we need to patch it away too (FIXME) # Probably it would be better to use /app as a prefix because it has the same length for all apps cd usr/ ; find . -type f -exec sed -i -e 's|$APP_IMG_DIR/usr/|./././././././././|g' {} \; ; cd .. # On openSUSE Qt is picking up the wrong libqxcb.so # (the one from the system when in fact it should use the bundled one) - is this a Qt bug? # Also, Krita has a hardcoded /usr which we patch away cd usr/ ; find . -type f -exec sed -i -e 's|/usr|././|g' {} \; ; cd .. # We do not bundle this, so let's not search that inside the AppImage. # Fixes "Qt: Failed to create XKB context!" and lets us enter text sed -i -e 's|././/share/X11/|/usr/share/X11/|g' ./usr/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so sed -i -e 's|././/share/X11/|/usr/share/X11/|g' ./usr/lib/libQt5XcbQpa.so.5 ################################################################################################# cd / APP=digikam if [[ $DK_DEBUG = 1 ]] ; then DEBUG_SUF="-debug" fi if [[ "$ARCH" = "x86_64" ]] ; then APPIMAGE=$APP"-"$DK_RELEASEID$DK_EPOCH"-x86-64$DEBUG_SUF.appimage" elif [[ "$ARCH" = "i686" ]] ; then APPIMAGE=$APP"-"$DK_RELEASEID$DK_EPOCH"-i386$DEBUG_SUF.appimage" fi echo -e "---------- Create Bundle with AppImage SDK stage1\n" # Source functions if [[ ! -s ./functions.sh ]] ; then wget -q https://github.com/probonopd/AppImages/raw/master/functions.sh -O ./functions.sh fi # Install desktopintegration in usr/bin/digikam.wrapper cd $APP_IMG_DIR # We will use a dedicated bash script to run inside the AppImage to be sure that XDG_* variable are set for Qt5 cp ${ORIG_WD}/data/AppRun ./ # desktop integration files cp /usr/share/applications/org.kde.digikam.desktop ./ cp /usr/share/icons/hicolor/256x256/apps/digikam.png ./digikam.png cp /usr/share/icons/hicolor/256x256/apps/digikam.png ./.DirIcon mkdir -p $APP_IMG_DIR/usr/share/icons/default/128x128/apps cp -r /usr/share/icons/hicolor/128x128/apps/digikam.png ./usr/share/icons/default/128x128/apps/digikam.png mkdir -p $APP_IMG_DIR/usr/share/icons/default/128x128/mimetypes cp -r /usr/share/icons/hicolor/128x128/apps/digikam.png ./usr/share/icons/default/128x128/mimetypes/application-vnd.digikam.png mkdir -p $ORIG_WD/bundle rm -f $ORIG_WD/bundle/* || true echo -e "---------- Create Bundle with AppImage SDK stage2\n" cd / # Get right version of Appimage toolkit. if [[ "$ARCH" = "x86_64" ]] ; then APPIMGBIN=AppImageTool-x86_64.AppImage elif [[ "$ARCH" = "i686" ]] ; then APPIMGBIN=AppImageTool-i686.AppImage fi if [[ ! -s ./$APPIMGBIN ]] ; then wget -q https://github.com/AppImage/AppImageKit/releases/download/continuous/$APPIMGBIN -O ./$APPIMGBIN fi chmod a+x ./$APPIMGBIN ./$APPIMGBIN $APP_IMG_DIR/ $ORIG_WD/bundle/$APPIMAGE chmod a+rwx $ORIG_WD/bundle/$APPIMAGE ################################################################################################# # Show resume information and future instructions to host installer file to remote server echo -e "\n---------- Compute package checksums for digiKam $DK_RELEASEID\n" > $ORIG_WD/bundle/$APPIMAGE.sum echo "File : $APPIMAGE" >> $ORIG_WD/bundle/$APPIMAGE.sum echo -n "Size : " >> $ORIG_WD/bundle/$APPIMAGE.sum du -h "$ORIG_WD/bundle/$APPIMAGE" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$APPIMAGE.sum echo -n "SHA256 sum : " >> $ORIG_WD/bundle/$APPIMAGE.sum sha256sum "$ORIG_WD/bundle/$APPIMAGE" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$APPIMAGE.sum # Checksums to post on Phabricator at release time. sha256sum "$ORIG_WD/bundle/$APPIMAGE" > $ORIG_WD/bundle/sha256_release.sum if [[ $DK_SIGN = 1 ]] ; then cat ~/.gnupg/dkorg-gpg-pwd.txt | gpg --batch --yes --passphrase-fd 0 -sabv "$ORIG_WD/bundle/$APPIMAGE" mv -f $ORIG_WD/bundle/$APPIMAGE.asc $ORIG_WD/bundle/$APPIMAGE.sig echo "File : $APPIMAGE.sig" >> $ORIG_WD/bundle/$APPIMAGE.sum echo -n "Size : " >> $ORIG_WD/bundle/$APPIMAGE.sum du -h "$ORIG_WD/bundle/$APPIMAGE.sig" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$APPIMAGE.sum echo -n "SHA256 sum : " >> $ORIG_WD/bundle/$APPIMAGE.sum sha256sum "$ORIG_WD/bundle/$APPIMAGE.sig" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$APPIMAGE.sum # Checksums to post on Phabricator at release time. sha256sum "$ORIG_WD/bundle/$APPIMAGE.sig" >> $ORIG_WD/bundle/sha256_release.sum fi cat $ORIG_WD/bundle/$APPIMAGE.sum if [[ $DK_UPLOAD = 1 ]] ; then echo -e "---------- Cleanup older bundle AppImage files from files.kde.org repository \n" if [[ "$ARCH" = "x86_64" ]] ; then - ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*$WEB_BROWSER-x86-64*.appimage* + ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*-x86-64$DEBUG_SUF.appimage* elif [[ "$ARCH" = "i686" ]] ; then - ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*$WEB_BROWSER-i386*.appimage* + ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*-i386$DEBUG_SUF.appimage* fi echo -e "---------- Upload new bundle AppImage files to files.kde.org repository \n" rsync -r -v --progress -e ssh $ORIG_WD/bundle/$APPIMAGE $DK_UPLOADURL:$DK_UPLOADDIR scp $ORIG_WD/bundle/$APPIMAGE.sum $DK_UPLOADURL:$DK_UPLOADDIR if [[ $DK_SIGN = 1 ]] ; then scp $ORIG_WD/bundle/$APPIMAGE.sig $DK_UPLOADURL:$DK_UPLOADDIR fi else echo -e "\n------------------------------------------------------------------" curl https://download.kde.org/README_UPLOAD echo -e "------------------------------------------------------------------\n" fi ################################################################################################# TerminateScript diff --git a/project/bundles/macports/04-build-installer.sh b/project/bundles/macports/04-build-installer.sh index 7e37fd49a6..ece72071bb 100755 --- a/project/bundles/macports/04-build-installer.sh +++ b/project/bundles/macports/04-build-installer.sh @@ -1,576 +1,576 @@ #! /bin/bash # Script to bundle data using previously-built digiKam installation. # and create a PKG file with Packages application (http://s.sudre.free.fr/Software/Packages/about.html) # This script must be run as sudo # # Copyright (c) 2015 by Shanti, # Copyright (c) 2015-2020 by Gilles Caulier # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. # # Ask to run as root (( EUID != 0 )) && exec sudo -- "$0" "$@" # Halt and catch errors set -eE trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR ################################################################################################# # Manage script traces to log file mkdir -p ./logs exec > >(tee ./logs/build-installer.full.log) 2>&1 ################################################################################################# echo "04-build-installer.sh : build digiKam bundle PKG." echo "-------------------------------------------------" ################################################################################################# # Pre-processing checks . ./config.sh . ./common.sh StartScript ChecksRunAsRoot ChecksXCodeCLI ChecksCPUCores OsxCodeName #RegisterRemoteServers ################################################################################################# # Pathes rules ORIG_PATH="$PATH" ORIG_WD="`pwd`" export PATH=$INSTALL_PREFIX/bin:/$INSTALL_PREFIX/sbin:$ORIG_PATH DKRELEASEID=`cat $ORIG_WD/data/RELEASEID.txt` ################################################################################################# # Build icons-set ressource echo -e "\n---------- Build icons-set ressource\n" cd $ORIG_WD/icon-rcc rm -f CMakeCache.txt > /dev/null cp -f $ORIG_WD/../../../bootstrap.macports . cmake -DCMAKE_INSTALL_PREFIX="$INSTALL_PREFIX" \ -DCMAKE_BUILD_TYPE=debug \ -DCMAKE_COLOR_MAKEFILE=ON \ -Wno-dev \ . make -j$CPU_CORES cd $ORIG_WD ################################################################################################# # Configurations # Directory where this script is located (default - current directory) BUILDDIR="$PWD" # Directory where Packages project files are located PROJECTDIR="$BUILDDIR/installer" # Staging area where files to be packaged will be copied TEMPROOT="$BUILDDIR/$INSTALL_PREFIX" # Applications to be launched directly by user (create launch scripts) KDE_MENU_APPS="\ digikam \ showfoto \ " # Paths to search for applications above KDE_APP_PATHS="\ Applications/KF5 \ " # Other apps - non-MacOS binaries & libraries to be included with required dylibs OTHER_APPS="\ Applications/KF5/digikam.app/Contents/MacOS/digikam \ Applications/KF5/showfoto.app/Contents/MacOS/showfoto \ lib/plugins/imageformats/*.so \ lib/plugins/digikam/bqm/*.so \ lib/plugins/digikam/generic/*.so \ lib/plugins/digikam/editor/*.so \ lib/plugins/digikam/dimg/*.so \ lib/mariadb/bin/mysql \ lib/mariadb/bin/mysqld \ lib/mariadb/bin/my_print_defaults \ lib/mariadb/bin/mysqladmin \ lib/mariadb/bin/mysqltest \ lib/mariadb/mysql/*.dylib \ lib/mariadb/plugin/*.so \ lib/ImageMagick*/modules-Q16/coders/*.so \ lib/ImageMagick*/modules-Q16/filters/*.so \ bin/kbuildsycoca5 \ libexec/qt5/plugins/imageformats/*.dylib \ libexec/qt5/plugins/sqldrivers/*.dylib \ libexec/qt5/plugins/printsupport/*.dylib \ libexec/qt5/plugins/platforms/*.dylib \ libexec/qt5/plugins/platformthemes/*.dylib \ libexec/qt5/plugins/iconengines/*.dylib \ libexec/qt5/plugins/generic/*.dylib \ libexec/qt5/plugins/styles/*.dylib \ libexec/qt5/plugins/bearer/*.dylib \ " #lib/sane/*.so \ binaries="$OTHER_APPS" # Additional Files/Directories - to be copied recursively but not checked for dependencies OTHER_DIRS="\ lib/plugins \ lib/libgphoto2 \ lib/libgphoto2_port \ lib/mariadb \ lib/ImageMagick* \ share/mariadb \ share/ImageMagick* \ etc/xdg \ etc/ImageMagick* \ " #etc/sane.d \ # Additional Data Directories - to be copied recursively OTHER_DATA="\ share/applications \ share/OpenCV \ share/k* \ share/lensfun \ share/mime \ Library/Application/ \ Marble.app/Contents/Resources/ \ Marble.app/Contents/MacOS/resources/ \ " # Packaging tool paths PACKAGESBUILD="/usr/local/bin/packagesbuild" RECURSIVE_LIBRARY_LISTER="$BUILDDIR/rll.py" echo "digiKam version: $DKRELEASEID" # ./installer sub-dir must be writable by root chmod 777 ${PROJECTDIR} ################################################################################################# # Check if Packages CLI tools are installed if [[ (! -f "$PACKAGESBUILD") ]] ; then echo "Packages CLI tool is not installed" echo "See http://s.sudre.free.fr/Software/Packages/about.html for details." exit 1 else echo "Check Packages CLI tool passed..." fi ################################################################################################# # Create temporary dir to build package contents if [ -d "$TEMPROOT" ] ; then echo "---------- Removing temporary packaging directory $TEMPROOT" rm -rf "$TEMPROOT" fi echo "Creating $TEMPROOT" mkdir -p "$TEMPROOT/Applications/digiKam" ################################################################################################# # Prepare applications for MacOS echo "---------- Preparing Applications for MacOS" for app in $KDE_MENU_APPS ; do echo " $app" # Look for application for searchpath in $KDE_APP_PATHS ; do # Copy the application if it is found (create directory if necessary) if [ -d "$INSTALL_PREFIX/$searchpath/$app.app" ] ; then echo " Found $app in $INSTALL_PATH/$searchpath" # Create destination directory if necessary and copy app if [ ! -d "$TEMPROOT/$searchpath" ] ; then echo " Creating $TEMPROOT/$searchpath" mkdir -p "$TEMPROOT/$searchpath" fi echo " Copying $app" cp -pr "$INSTALL_PREFIX/$searchpath/$app.app" "$TEMPROOT/$searchpath/" # Add executable to list of binaries for which we need to collect dependencies for binaries="$binaries $searchpath/$app.app/Contents/MacOS/$app" # If application is to be run by user, create Applescript launcher to # load kbuildsycoca5. Set DYLD_IMAGE_SUFFIX if built with debug variant if [[ $KDE_MENU_APPS == *"$app"* ]] ; then echo " Creating launcher script for $app" # Debug variant needs DYLD_IMAGE_SUFFIX="_debug set at runtime if [[ $DK_DEBUG = 1 ]] ; then DYLD_ENV_CMD="DYLD_IMAGE_SUFFIX=_debug " else DYLD_ENV_CMD="" fi # ------ Create application launcher script # Partially derived from https://discussions.apple.com/thread/3934912 and # http://stackoverflow.com/questions/16064957/how-to-check-in-applescript-if-an-app-is-running-without-launching-it-via-osa # and https://discussions.apple.com/thread/4059113 cat << EOF | osacompile -o "$TEMPROOT/Applications/digiKam/$app.app" #!/usr/bin/osascript log "Running $DYLD_ENV_CMD $INSTALL_PREFIX/bin/kbuildsycoca5" do shell script "$DYLD_ENV_CMD $INSTALL_PREFIX/bin/kbuildsycoca5" do shell script "$DYLD_ENV_CMD open $INSTALL_PREFIX/$searchpath/$app.app" EOF # ------ End application launcher script # Get application icon for launcher. If no icon file matches pattern app_SRCS.icns, grab the first icon if [ -f "$INSTALL_PREFIX/$searchpath/$app.app/Contents/Resources/${app}_SRCS.icns" ] ; then echo " Found icon for $app launcher" cp -p "$INSTALL_PREFIX/$searchpath/$app.app/Contents/Resources/${app}_SRCS.icns" "$TEMPROOT/Applications/digiKam/$app.app/Contents/Resources/applet.icns" else for icon in "$INSTALL_PREFIX/$searchpath/$app.app/"Contents/Resources/*.icns ; do echo " Using icon for $app launcher: $icon" cp -p "$icon" "$TEMPROOT/Applications/digiKam/$app.app/Contents/Resources/applet.icns" break done fi chmod 755 "$TEMPROOT/Applications/digiKam/$app.app" fi # Don't keep looking through search paths once we've found the app break fi done done ################################################################################################# # Collect dylib dependencies for all binaries, # then copy them to the staging area (creating directories as required) echo "---------- Collecting dependencies for applications, binaries, and libraries:" cd "$INSTALL_PREFIX" "$RECURSIVE_LIBRARY_LISTER" $binaries | sort -u | \ while read lib ; do lib="`echo $lib | sed "s:$INSTALL_PREFIX/::"`" if [ ! -e "$TEMPROOT/$lib" ] ; then dir="${lib%/*}" if [ ! -d "$TEMPROOT/$dir" ] ; then echo " Creating $TEMPROOT/$dir" mkdir -p "$TEMPROOT/$dir" fi echo " $lib" cp -aH "$INSTALL_PREFIX/$lib" "$TEMPROOT/$dir/" fi done ################################################################################################# # Copy non-binary files and directories, creating parent directories if needed echo "---------- Copying binary files..." for path in $OTHER_APPS ; do dir="${path%/*}" if [ ! -d "$TEMPROOT/$dir" ] ; then echo " Creating $TEMPROOT/$dir" mkdir -p "$TEMPROOT/$dir" fi echo " Copying $path" cp -a "$INSTALL_PREFIX/$path" "$TEMPROOT/$dir/" done echo "---------- Copying directory contents..." for path in $OTHER_DIRS ; do dir="${path%/*}" if [ ! -d "$TEMPROOT/$dir" ] ; then echo " Creating $TEMPROOT/$dir" mkdir -p "$TEMPROOT/$dir" fi echo " Copying $path" cp -a "$INSTALL_PREFIX/$path" "$TEMPROOT/$dir/" done echo "---------- Copying data files..." # Special case with data dirs. QStandardPaths::GenericDataLocation was patched everywhere # in source code by QStandardPaths::AppDataLocation for path in $OTHER_DATA ; do echo " Copying $path" cp -a "$INSTALL_PREFIX/$path" "$TEMPROOT/Applications/KF5/digikam.app/Contents/Resources/" done echo "---------- Copying Qt Web Backend files..." # QWebEngine bin data files. if [[ $DK_QTWEBENGINE = 1 ]] ; then # QtWebEngine runtime process [[ -e $INSTALL_PREFIX/libexec/qt5/libexec/QtWebEngineProcess ]] && cp -a "$INSTALL_PREFIX/libexec/qt5/libexec/QtWebEngineProcess" "$TEMPROOT/libexec/qt5/libexec/" else # QtWebKit runtime process [[ -e $INSTALL_PREFIX/libexec/qt5/libexec/QtWebNetworkProcess ]] && cp -a "$INSTALL_PREFIX/libexec/qt5/libexec/QtWebNetworkProcess" "$TEMPROOT/libexec/qt5/libexec/" [[ -e $INSTALL_PREFIX/libexec/qt5/libexec/QtWebProcess ]] && cp -a "$INSTALL_PREFIX/libexec/qt5/libexec/QtWebProcess" "$TEMPROOT/libexec/qt5/libexec/" [[ -e $INSTALL_PREFIX/libexec/qt5/libexec/QtWebStorageProcess ]] && cp -a "$INSTALL_PREFIX/libexec/qt5/libexec/QtWebStorageProcess" "$TEMPROOT/libexec/qt5/libexec/" fi echo "---------- Copying i18n..." i18nprefix=$INSTALL_PREFIX/share/ cd $i18nprefix FILES=$(cat $ORIG_WD/logs/build-extralibs.full.log | grep "$INSTALL_PREFIX/share/locale/" | cut -d' ' -f3 | awk '{sub("'"$i18nprefix"'","")}1') for FILE in $FILES ; do rsync -R "./$FILE" "$TEMPROOT/Applications/KF5/digikam.app/Contents/Resources/" done FILES=$(cat $ORIG_WD/logs/build-digikam.full.log | grep "$INSTALL_PREFIX/share/locale/" | cut -d' ' -f3 | awk '{sub("'"$i18nprefix"'","")}1') for FILE in $FILES ; do rsync -R "./$FILE" "$TEMPROOT/Applications/KF5/digikam.app/Contents/Resources/" done # Showfoto resources dir must be merged with digiKam. cp -a "$TEMPROOT/Applications/KF5/showfoto.app/Contents/Resources/" "$TEMPROOT/Applications/KF5/digikam.app/Contents/Resources/" rm -rf "$TEMPROOT/Applications/KF5/showfoto.app/Contents/Resources" # A symbolic link to install path where is installed digiKam resources will be used for Showfoto. ln -s "$INSTALL_PREFIX/Applications/KF5/digikam.app/Contents/Resources" "$TEMPROOT/Applications/KF5/showfoto.app/Contents/Resources" cd "$ORIG_WD" ################################################################################################# # Move digiKam and KF5 run-time plugins to the right place cp -a $TEMPROOT/lib/plugins $TEMPROOT/libexec/qt5/ rm -rf $TEMPROOT/lib/plugins ################################################################################################# # Create package pre-install script echo "---------- Create package pre-install script" # Delete /Applications entries, delete existing installation cat << EOF > "$PROJECTDIR/preinstall" #!/bin/bash if [ -d /Applications/digiKam ] ; then echo "Removing digikam from Applications folder" rm -r /Applications/digiKam fi if [ -d "$INSTALL_PREFIX" ] ; then echo "Removing $INSTALL_PREFIX" rm -rf "$INSTALL_PREFIX" fi EOF # Pre-install script need to be executable chmod 755 "$PROJECTDIR/preinstall" ################################################################################################# # Create package post-install script echo "---------- Create package post-install script" # Creates Applications menu icons cat << EOF > "$PROJECTDIR/postinstall" #!/bin/bash [[ ! -d /Applications/digiKam ]] && mkdir "/Applications/digiKam" for app in $INSTALL_PREFIX/Applications/digiKam/*.app ; do ln -s "\$app" /Applications/digiKam/\${app##*/} done EOF # Post-install script need to be executable chmod 755 "$PROJECTDIR/postinstall" ################################################################################################# # Copy icons-set resource files. cp $ORIG_WD/icon-rcc/breeze.rcc $TEMPROOT/Applications/KF5/digikam.app/Contents/Resources/ cp $ORIG_WD/icon-rcc/breeze-dark.rcc $TEMPROOT/Applications/KF5/digikam.app/Contents/Resources/ ################################################################################################# # Cleanup symbols in binary files to free space. echo -e "\n---------- Strip symbols in binary files\n" if [[ $DK_DEBUG = 1 ]] ; then find $TEMPROOT -name "*.so" | grep -Ev '(digikam|showfoto|exiv2)' | xargs strip -SXx find $TEMPROOT -name "*.dylib" | grep -Ev '(digikam|showfoto|exiv2)' | xargs strip -SXx else find $TEMPROOT -name "*.so" | xargs strip -SXx find $TEMPROOT -name "*.dylib" | xargs strip -SXx fi if [[ $DK_DEBUG = 1 ]] ; then DEBUG_SUF="-debug" fi ################################################################################################# # Relocate binary files # For details, see these urls: # https://stackoverflow.com/questions/9263256/can-you-please-help-me-understand-how-mach-o-libraries-work-in-mac-os-x # https://matthew-brett.github.io/docosx/mac_runtime_link.html # Not yet finalized ! if [ ]; then echo -e "\n---------- Relocate binary files" # relocate dynamic libraries with rpath DYLIBFILES=(`find $TEMPROOT/lib -name "*.dylib"`) RelocateBinaries DYLIBFILES[@] # relocate library executables and system objects files with rpath. # This include all binary files with extension as all Qt libraries. LIBEXECFILES=(`find $TEMPROOT/libexec -type f -perm +ugo+x`) RelocateBinaries LIBEXECFILES[@] # relocate main executable with rpath. MAINFILES="\ $TEMPROOT/Applications/KF5/digikam.app/Contents/MacOS/digikam \ $TEMPROOT/Applications/KF5/showfoto.app/Contents/MacOS/showfoto \ $TEMPROOT/bin/kbuildsycoca5 \ " RelocateBinaries MAINFILES[@] for APP in $MAINFILES ; do install_name_tool -add_rpath @executable_path/.. $APP install_name_tool -add_rpath @executable_path/../.. $APP install_name_tool -add_rpath @executable_path/../../.. $APP install_name_tool -add_rpath @executable_path/../../../.. $APP install_name_tool -add_rpath @executable_path/../../../../.. $APP install_name_tool -add_rpath @executable_path/../../../../../.. $APP done fi ################################################################################################# # Build PKG file echo "---------- Create MacOS package for digiKam $DKRELEASEID" mkdir -p $ORIG_WD/bundle rm -f $ORIG_WD/bundle/* || true TARGET_INSTALLER=digiKam-$DKRELEASEID$DK_EPOCH-MacOS-x86-64$DEBUG_SUF.pkg TARGET_PKG_FILE=$BUILDDIR/bundle/$TARGET_INSTALLER echo -e "Target PKG file : $TARGET_PKG_FILE" $PACKAGESBUILD -v "$PROJECTDIR/digikam.pkgproj" --package-version "$DKRELEASEID" mv "$PROJECTDIR/build/digikam.pkg" "$TARGET_PKG_FILE" ################################################################################################# # Show resume information and future instructions to host PKG file to remote server echo -e "\n---------- Compute package checksums for digiKam $DKRELEASEID\n" > $TARGET_PKG_FILE.sum echo "File : $TARGET_PKG_FILE" >> $TARGET_PKG_FILE.sum echo -n "Size : " >> $TARGET_PKG_FILE.sum du -h "$TARGET_PKG_FILE" | { read first rest ; echo $first ; } >> $TARGET_PKG_FILE.sum echo -n "SHA256 sum : " >> $TARGET_PKG_FILE.sum shasum -a256 "$TARGET_PKG_FILE" | { read first rest ; echo $first ; } >> $TARGET_PKG_FILE.sum # Checksums to post on Phabricator at release time. shasum -a256 "$TARGET_PKG_FILE" > $BUILDDIR/bundle/sha256_release.sum if [[ $DK_SIGN = 1 ]] ; then cat ~/.gnupg/dkorg-gpg-pwd.txt | gpg --batch --yes --passphrase-fd 0 -sabv "$TARGET_PKG_FILE" mv -f $TARGET_PKG_FILE.asc $TARGET_PKG_FILE.sig echo "File : $TARGET_PKG_FILE.sig" >> $TARGET_PKG_FILE.sum echo -n "Size : " >> $TARGET_PKG_FILE.sum du -h "$TARGET_PKG_FILE.sig" | { read first rest ; echo $first ; } >> $TARGET_PKG_FILE.sum echo -n "SHA256 sum : " >> $TARGET_PKG_FILE.sum shasum -a256 "$TARGET_PKG_FILE.sig" | { read first rest ; echo $first ; } >> $TARGET_PKG_FILE.sum # Checksums to post on Phabricator at release time. shasum -a256 "$TARGET_PKG_FILE.sig" >> $BUILDDIR/bundle/sha256_release.sum fi cat $TARGET_PKG_FILE.sum if [[ $DK_UPLOAD = 1 ]] ; then echo -e "---------- Cleanup older bundle Package files from files.kde.org repository \n" - ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*-MacOS-x86-64*.pkg* + ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*-MacOS-x86-64$DEBUG_SUF.pkg* echo -e "---------- Upload new bundle Package files to files.kde.org repository \n" rsync -r -v --progress -e ssh $BUILDDIR/bundle/$TARGET_INSTALLER $DK_UPLOADURL:$DK_UPLOADDIR scp $BUILDDIR/bundle/$TARGET_INSTALLER.sum $DK_UPLOADURL:$DK_UPLOADDIR if [[ $DK_SIGN = 1 ]] ; then scp $BUILDDIR/bundle/$TARGET_INSTALLER.sig $DK_UPLOADURL:$DK_UPLOADDIR fi else echo -e "\n------------------------------------------------------------------" curl https://download.kde.org/README_UPLOAD echo -e "------------------------------------------------------------------\n" fi ################################################################################################# export PATH=$ORIG_PATH TerminateScript diff --git a/project/bundles/mxe/04-build-installer.sh b/project/bundles/mxe/04-build-installer.sh index 4ea43a25ea..c0b3383a76 100755 --- a/project/bundles/mxe/04-build-installer.sh +++ b/project/bundles/mxe/04-build-installer.sh @@ -1,326 +1,326 @@ #! /bin/bash # Script to bundle data using previously-built KDE and digiKam installation # and create a Windows installer file with NSIS application # Dependency : NSIS makensis program for Linux. # # Copyright (c) 2015-2020 by Gilles Caulier # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. # # Halt and catch errors set -eE trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR export LANG=C ################################################################################################# # Manage script traces to log file mkdir -p ./logs exec > >(tee ./logs/build-installer.full.log) 2>&1 ################################################################################################# echo "04-build-installer.sh : build digiKam Windows installer." echo "--------------------------------------------------------" ################################################################################################# # Pre-processing checks . ./config.sh . ./common.sh StartScript ChecksCPUCores RegisterRemoteServers ################################################################################################# # Check if NSIS CLI tools is installed if ! which makensis ; then echo "NSIS CLI tool is not installed" echo "See http://nsis.sourceforge.net/ for details." exit 1 else echo "Check NSIS CLI tools passed..." fi ################################################################################################# # Configurations # Directory where this script is located (default - current directory) BUILDDIR="$PWD" # Directory where bundle files are located BUNDLEDIR="$BUILDDIR/temp" ORIG_WD="`pwd`" DK_RELEASEID=`cat $ORIG_WD/data/RELEASEID.txt` ################################################################################################# # Build icons-set ressource echo -e "\n---------- Build icons-set ressource\n" cd $ORIG_WD/icon-rcc rm -f CMakeCache.txt > /dev/null cmake -DCMAKE_INSTALL_PREFIX="$MXE_INSTALL_PREFIX" \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_COLOR_MAKEFILE=ON \ -Wno-dev \ . make -j$CPU_CORES ################################################################################################# # Copy files echo -e "\n---------- Copy files in bundle directory\n" # Directories creation ----------------------------------------------------------------------- cd $ORIG_WD if [ -d "$BUNDLEDIR" ]; then rm -fr $BUNDLEDIR mkdir $BUNDLEDIR fi mkdir -p $BUNDLEDIR/data mkdir -p $BUNDLEDIR/etc mkdir -p $BUNDLEDIR/share mkdir -p $BUNDLEDIR/translations # Data files --------------------------------------------------------------------------------- echo -e "\n---------- Marble data" cp -r $MXE_INSTALL_PREFIX/data/* $BUNDLEDIR/data 2>/dev/null echo -e "\n---------- Generics data" cp -r $MXE_INSTALL_PREFIX/share/lensfun $BUNDLEDIR/data 2>/dev/null cp -r $MXE_INSTALL_PREFIX/bin/data/digikam $BUNDLEDIR/data 2>/dev/null cp -r $MXE_INSTALL_PREFIX/bin/data/showfoto $BUNDLEDIR/data 2>/dev/null cp -r $MXE_INSTALL_PREFIX/bin/data/solid $BUNDLEDIR/data 2>/dev/null cp -r $MXE_INSTALL_PREFIX/bin/data/k* $BUNDLEDIR/data 2>/dev/null echo -e "\n---------- Qt config" cp $BUILDDIR/data/qt.conf $BUNDLEDIR/ 2>/dev/null echo -e "\n---------- icons-set" cp $BUILDDIR/icon-rcc/breeze.rcc $BUNDLEDIR/ 2>/dev/null cp $BUILDDIR/icon-rcc/breeze-dark.rcc $BUNDLEDIR/ 2>/dev/null echo -e "\n---------- i18n" cp -r $MXE_INSTALL_PREFIX/qt5/translations/qt_* $BUNDLEDIR/translations 2>/dev/null cp -r $MXE_INSTALL_PREFIX/qt5/translations/qtbase* $BUNDLEDIR/translations 2>/dev/null cp -r $MXE_INSTALL_PREFIX/bin/data/locale $BUNDLEDIR/data 2>/dev/null echo -e "\n---------- Xdg" cp -r $MXE_INSTALL_PREFIX/etc/xdg $BUNDLEDIR/etc 2>/dev/null cp -r $MXE_INSTALL_PREFIX/bin/data/xdg $BUNDLEDIR/share 2>/dev/null # Plugins Shared libraries ------------------------------------------------------------------- echo -e "\n---------- Qt5 plugins" cp -r $MXE_INSTALL_PREFIX/qt5/plugins $BUNDLEDIR/ 2>/dev/null echo -e "\n---------- Marble plugins" cp -r $MXE_INSTALL_PREFIX/plugins/*.dll $BUNDLEDIR/plugins 2>/dev/null echo -e "\n---------- digiKam and KF5 plugins" cp -r $MXE_INSTALL_PREFIX/lib/plugins $BUNDLEDIR/ 2>/dev/null echo -e "\n---------- OpenAL for QtAV" cp -r $MXE_INSTALL_PREFIX/bin/OpenAL32.dll $BUNDLEDIR/ 2>/dev/null echo -e "\n---------- DrMinGw run-time" cp -r $MXE_INSTALL_PREFIX/bin/exchndl.dll $BUNDLEDIR/ 2>/dev/null cp -r $MXE_INSTALL_PREFIX/bin/mgwhelp.dll $BUNDLEDIR/ 2>/dev/null echo -e "\n---------- Copy executables with recursive dependencies in bundle directory\n" # Executables and plugins shared libraries dependencies scan --------------------------------- EXE_FILES="\ $MXE_INSTALL_PREFIX/bin/gdb.exe \ $MXE_INSTALL_PREFIX/bin/digikam.exe \ $MXE_INSTALL_PREFIX/bin/showfoto.exe \ $MXE_INSTALL_PREFIX/bin/kbuildsycoca5.exe \ $MXE_INSTALL_PREFIX/qt5/bin/QtWebNetworkProcess.exe \ $MXE_INSTALL_PREFIX/qt5/bin/QtWebProcess.exe \ $MXE_INSTALL_PREFIX/qt5/bin/QtWebStorageProcess.exe \ " for app in $EXE_FILES ; do cp $app $BUNDLEDIR/ $ORIG_WD/rll.py --copy --installprefix $MXE_INSTALL_PREFIX --odir $BUNDLEDIR --efile $app done DLL_FILES="\ `find $MXE_INSTALL_PREFIX/lib/plugins -name "*.dll" -type f | sed 's|$MXE_INSTALL_PREFIX/libs/plugins||'` \ `find $MXE_INSTALL_PREFIX/qt5/plugins -name "*.dll" -type f | sed 's|$MXE_INSTALL_PREFIX/qt5/plugins||'` \ `find $MXE_INSTALL_PREFIX/plugins -name "*.dll" -type f | sed 's|$MXE_INSTALL_PREFIX/plugins/||'` \ $MXE_INSTALL_PREFIX/bin/OpenAL32.dll \ $MXE_INSTALL_PREFIX/bin/exchndl.dll \ $MXE_INSTALL_PREFIX/bin/mgwhelp.dll \ " for app in $DLL_FILES ; do $ORIG_WD/rll.py --copy --installprefix $MXE_INSTALL_PREFIX --odir $BUNDLEDIR --efile $app done # Remove this dll as it require the Microsoft debug SDK. Even if this dll is redistributable we won't be be relevant of this stuff. # This will not breal DrMinGw as backtraces will generated in a text file from home directory instead into a crash-course dialog. rm -f $BUNDLEDIR/dbghelp.dll ################################################################################################# # Cleanup symbols in binary files to free space. echo -e "\n---------- Strip symbols in binary files\n" if [[ $DK_DEBUG = 1 ]] ; then find $BUNDLEDIR -name \*exe | grep -Ev '(digikam|showfoto|exiv2)' | xargs ${MXE_BUILDROOT}/usr/bin/${MXE_BUILD_TARGETS}-strip find $BUNDLEDIR -name \*dll | grep -Ev '(digikam|showfoto|exiv2)' | xargs ${MXE_BUILDROOT}/usr/bin/${MXE_BUILD_TARGETS}-strip else find $BUNDLEDIR -name \*exe | xargs ${MXE_BUILDROOT}/usr/bin/${MXE_BUILD_TARGETS}-strip find $BUNDLEDIR -name \*dll | xargs ${MXE_BUILDROOT}/usr/bin/${MXE_BUILD_TARGETS}-strip fi if [[ $DK_DEBUG = 1 ]] ; then DEBUG_SUF="-debug" fi ################################################################################################# # Build NSIS installer and Portable archive. echo -e "\n---------- Build NSIS installer and Portable archive\n" mkdir -p $ORIG_WD/bundle if [ $MXE_BUILD_TARGETS == "i686-w64-mingw32.shared" ]; then TARGET_INSTALLER=digiKam-$DK_RELEASEID$DK_EPOCH-Win32$DEBUG_SUF.exe PORTABLE_FILE=digiKam-$DK_RELEASEID$DK_EPOCH-Win32$DEBUG_SUF.tar.xz CHECKSUM_FILE=digiKam-$DK_RELEASEID$DK_EPOCH-Win32$DEBUG_SUF.sum rm -f $ORIG_WD/bundle/*Win32* || true else TARGET_INSTALLER=digiKam-$DK_RELEASEID$DK_EPOCH-Win64$DEBUG_SUF.exe PORTABLE_FILE=digiKam-$DK_RELEASEID$DK_EPOCH-Win64$DEBUG_SUF.tar.xz CHECKSUM_FILE=digiKam-$DK_RELEASEID$DK_EPOCH-Win64$DEBUG_SUF.sum rm -f $ORIG_WD/bundle/*Win64* || true fi cd $ORIG_WD/installer makensis -DVERSION=$DK_RELEASEID -DBUNDLEPATH=$BUNDLEDIR -DTARGETARCH=$MXE_ARCHBITS -DOUTPUT=$ORIG_WD/bundle/$TARGET_INSTALLER ./digikam.nsi tar cf - $BUNDLEDIR | xz -4e > $ORIG_WD/bundle/$PORTABLE_FILE ################################################################################################# # Show resume information and future instructions to host target files on remote server echo -e "\n---------- Compute installer checksums for digiKam $DK_RELEASEID\n" > $ORIG_WD/bundle/$TARGET_INSTALLER.sum echo "File : $TARGET_INSTALLER" >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum echo -n "Size : " >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum du -h "$ORIG_WD/bundle/$TARGET_INSTALLER" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum echo -n "MD5 sum : " >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum md5sum "$ORIG_WD/bundle/$TARGET_INSTALLER" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum echo -n "SHA1 sum : " >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum shasum -a1 "$ORIG_WD/bundle/$TARGET_INSTALLER" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum echo -n "SHA256 sum : " >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum shasum -a256 "$ORIG_WD/bundle/$TARGET_INSTALLER" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum # Checksums to post on Phabricator at release time. shasum -a256 "$ORIG_WD/bundle/$TARGET_INSTALLER" > $ORIG_WD/bundle/$CHECKSUM_FILE echo -e "\n---------- Compute Portable archive checksums for digiKam $DK_RELEASEID\n" > $ORIG_WD/bundle/$PORTABLE_FILE.sum echo "File : $PORTABLE_FILE" >> $ORIG_WD/bundle/$PORTABLE_FILE.sum echo -n "Size : " >> $ORIG_WD/bundle/$PORTABLE_FILE.sum du -h "$ORIG_WD/bundle/$PORTABLE_FILE" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$PORTABLE_FILE.sum echo -n "MD5 sum : " >> $ORIG_WD/bundle/$PORTABLE_FILE.sum md5sum "$ORIG_WD/bundle/$PORTABLE_FILE" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$PORTABLE_FILE.sum echo -n "SHA1 sum : " >> $ORIG_WD/bundle/$PORTABLE_FILE.sum shasum -a1 "$ORIG_WD/bundle/$PORTABLE_FILE" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$PORTABLE_FILE.sum echo -n "SHA256 sum : " >> $ORIG_WD/bundle/$PORTABLE_FILE.sum shasum -a256 "$ORIG_WD/bundle/$PORTABLE_FILE" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$PORTABLE_FILE.sum # Checksums to post on Phabricator at release time. shasum -a256 "$ORIG_WD/bundle/$PORTABLE_FILE" >> $ORIG_WD/bundle/$CHECKSUM_FILE if [[ $DK_SIGN = 1 ]] ; then echo -e "\n---------- Compute Signature checksums for digiKam installer $DK_RELEASEID\n" > $ORIG_WD/bundle/$TARGET_INSTALLER.sum cat ~/.gnupg/dkorg-gpg-pwd.txt | gpg --batch --yes --passphrase-fd 0 -sabv "$ORIG_WD/bundle/$TARGET_INSTALLER" mv -f $ORIG_WD/bundle/$TARGET_INSTALLER.asc $ORIG_WD/bundle/$TARGET_INSTALLER.sig echo "File : $TARGET_INSTALLER.sig" >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum echo -n "Size : " >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum du -h "$ORIG_WD/bundle/$TARGET_INSTALLER.sig" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum echo -n "SHA256 sum : " >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum shasum -a256 "$ORIG_WD/bundle/$TARGET_INSTALLER.sig" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$TARGET_INSTALLER.sum # Checksums to post on Phabricator at release time. shasum -a256 "$ORIG_WD/bundle/$TARGET_INSTALLER.sig" >> $ORIG_WD/bundle/$CHECKSUM_FILE echo -e "\n---------- Compute Signature checksums for digiKam Portable $DK_RELEASEID\n" > $ORIG_WD/bundle/$PORTABLE_FILE.sum cat ~/.gnupg/dkorg-gpg-pwd.txt | gpg --batch --yes --passphrase-fd 0 -sabv "$ORIG_WD/bundle/$PORTABLE_FILE" mv -f $ORIG_WD/bundle/$PORTABLE_FILE.asc $ORIG_WD/bundle/$PORTABLE_FILE.sig echo "File : $PORTABLE_FILE.sig" >> $ORIG_WD/bundle/$PORTABLE_FILE.sum - echo -n "Size : " >> $ORIG_WD/bundle/$PORTABLE_FILE.sum + echo -n "Size : " >> $ORIG_WD/bundle/$PORTABLE_FILE.sum du -h "$ORIG_WD/bundle/$PORTABLE_FILE.sig" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$PORTABLE_FILE.sum - echo -n "SHA256 sum : " >> $ORIG_WD/bundle/$PORTABLE_FILE.sum + echo -n "SHA256 sum : " >> $ORIG_WD/bundle/$PORTABLE_FILE.sum shasum -a256 "$ORIG_WD/bundle/$PORTABLE_FILE.sig" | { read first rest ; echo $first ; } >> $ORIG_WD/bundle/$PORTABLE_FILE.sum # Checksums to post on Phabricator at release time. shasum -a256 "$ORIG_WD/bundle/$PORTABLE_FILE.sig" >> $ORIG_WD/bundle/$CHECKSUM_FILE fi cat $ORIG_WD/bundle/$TARGET_INSTALLER.sum cat $ORIG_WD/bundle/$PORTABLE_FILE.sum if [[ $DK_UPLOAD = 1 ]] ; then echo -e "---------- Cleanup older Windows bundle files from files.kde.org repository \n" if [ $MXE_BUILD_TARGETS == "i686-w64-mingw32.shared" ]; then - ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*-Win32*.exe* - ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*-Win32*.tar.xz* + ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*-Win32$DEBUG_SUF.exe* + ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*-Win32$DEBUG_SUF.tar.xz* else - ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*-Win64*.exe* - ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*-Win64*.tar.xz* + ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*-Win64$DEBUG_SUF.exe* + ssh $DK_UPLOADURL rm -f $DK_UPLOADDIR*-Win64$DEBUG_SUF.tar.xz* fi echo -e "---------- Upload new Windows bundle files to files.kde.org repository \n" rsync -r -v --progress -e ssh $ORIG_WD/bundle/$TARGET_INSTALLER $DK_UPLOADURL:$DK_UPLOADDIR rsync -r -v --progress -e ssh $ORIG_WD/bundle/$PORTABLE_FILE $DK_UPLOADURL:$DK_UPLOADDIR scp $ORIG_WD/bundle/$TARGET_INSTALLER.sum $DK_UPLOADURL:$DK_UPLOADDIR scp $ORIG_WD/bundle/$PORTABLE_FILE.sum $DK_UPLOADURL:$DK_UPLOADDIR if [[ $DK_SIGN = 1 ]] ; then scp $ORIG_WD/bundle/$TARGET_INSTALLER.sig $DK_UPLOADURL:$DK_UPLOADDIR scp $ORIG_WD/bundle/$PORTABLE_FILE.sig $DK_UPLOADURL:$DK_UPLOADDIR fi else echo -e "\n------------------------------------------------------------------" curl https://download.kde.org/README_UPLOAD echo -e "------------------------------------------------------------------\n" fi ################################################################################################# TerminateScript