diff --git a/project/bundles/macports/01-build-macports.sh b/project/bundles/macports/01-build-macports.sh index f2225c9543..b028f0b79c 100755 --- a/project/bundles/macports/01-build-macports.sh +++ b/project/bundles/macports/01-build-macports.sh @@ -1,311 +1,313 @@ #! /bin/bash # Script to build a bundle Macports installation with all digiKam dependencies in a dedicated directory # 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-macports.full.log) 2>&1 ################################################################################################# echo "01-build-macports.sh : build a bundle Macports install with digiKam dependencies." 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:/$INSTALL_PREFIX/libexec/qt5/bin:$ORIG_PATH ################################################################################################# # Check if /opt exists and standard Macports install path if [ -d "/opt" ] ; then if [ -d "/opt/local" ] ; then echo "---------- A standard Macports install exists on /opt/local." echo " To prevent wrong links from this bundle to this repository" echo " this one must be disabled (moving to /opt/local.back for ex)." echo "---------- Aborting..." exit; fi else echo "---------- /opt do not exist, creating" mkdir "/opt" if [ $? -ne 0 ] ; then echo "---------- Cannot create /opt directory." echo "---------- Aborting..." exit; fi fi ################################################################################################# # Check if a previous bundle already exist CONTINUE_INSTALL=0 if [ -d "$INSTALL_PREFIX" ] ; then read -p "$INSTALL_PREFIX already exist. Do you want to remove it or to continue an aborted previous installation ? [(r)emove/(c)ontinue/(s)top] " answer if echo "$answer" | grep -iq "^r" ;then echo "---------- Removing existing $INSTALL_PREFIX" mv $INSTALL_PREFIX $INSTALL_PREFIX.old rm -rf $INSTALL_PREFIX.old elif echo "$answer" | grep -iq "^c" ;then echo "---------- Continue aborted previous installation in $INSTALL_PREFIX" CONTINUE_INSTALL=1 else echo "---------- Aborting..." exit; fi fi if [[ $CONTINUE_INSTALL == 0 ]]; then ################################################################################################# # Target directory creation echo "---------- Creating $INSTALL_PREFIX" mkdir "$INSTALL_PREFIX" if [ $? -ne 0 ] ; then echo "---------- Cannot create target install directory $INSTALL_PREFIX" echo "---------- Aborting..." exit; fi ################################################################################################# # Check latest Macports version available if necessary if [ -z $MP_VERSION ] ; then MP_LASTEST_VER=$(curl $MP_URL | \ egrep -o 'href="MacPorts-[0-9]+\.[0-9]+\.[0-9]+' | \ sed 's/^href="MacPorts-//' | \ sort -t. -rn -k1,1 -k2,2 -k3,3 | head -1) if [ -z $MP_LASTEST_VER ] ; then echo "---------- Cannot check the lastest Macports verion from $MP_URL" echo "---------- Aborting..." exit; fi echo "---------- Detected lastest Macports version : $MP_LASTEST_VER" MP_VERSION=$MP_LASTEST_VER fi ################################################################################################# # Build Macports in temporary directory and installation if [ -d "$MP_BUILDTEMP" ] ; then echo "---------- Removing existing $MP_BUILDTEMP" rm -rf "$MP_BUILDTEMP" fi echo "---------- Creating $MP_BUILDTEMP" mkdir "$MP_BUILDTEMP" if [ $? -ne 0 ] ; then echo "---------- Cannot create temporary directory $MP_BUILDTEMP to compile Macports" echo "---------- Aborting..." exit; fi cd "$MP_BUILDTEMP" echo -e "\n\n" echo "---------- Downloading MacPorts $MP_VERSION" curl -o "MacPorts-$MP_VERSION.tar.bz2" "$MP_URL/MacPorts-$MP_VERSION.tar.bz2" tar jxvf MacPorts-$MP_VERSION.tar.bz2 cd MacPorts-$MP_VERSION echo -e "\n\n" echo "---------- Configuring MacPorts" ./configure --prefix="$INSTALL_PREFIX" \ --with-applications-dir="$INSTALL_PREFIX/Applications" \ --with-no-root-privileges \ --with-install-user="$(id -n -u)" \ --with-install-group="$(id -n -g)" echo -e "\n\n" echo "---------- Building MacPorts" make -j$CPU_CORES echo -e "\n\n" echo "---------- Installing MacPorts" echo -e "\n\n" make install && cd "$ORIG_WD" && rm -rf "$MP_BUILDTEMP" cat << EOF >> "$INSTALL_PREFIX/etc/macports/macports.conf" +no_root -startupitem startupitem_type none startupitem_install no macosx_deployment_target $OSX_MIN_TARGET EOF fi ################################################################################################# # Macports update echo -e "\n" echo "---------- Updating MacPorts" port -v selfupdate if [[ $CONTINUE_INSTALL == 0 ]]; then # port -v upgrade outdated echo -e "\n" #echo "---------- Modifying net-snmp portfile to install when not root" #sed -e "/install.asroot/ s|yes|no|" -i ".orig" "`port file net-snmp`" fi ################################################################################################# # Dependencies build and installation echo -e "\n" echo "---------- Building digiKam dependencies with Macports" # With OSX less than El Capitan, we need a more recent Clang compiler than one provided by XCode. if [[ $MAJOR_OSX_VERSION -lt 10 ]]; then echo "---------- Install more recent Clang compiler from Macports for specific ports" port install clang_select port install clang-3.4 port select --set clang mp-clang-3.4 fi echo -e "\n" port install \ ld64 +ld64_xcode \ cmake \ libpng \ jpeg \ tiff \ boost \ eigen3 \ gettext \ libusb \ libgphoto2 \ jasper \ lcms2 \ expat \ libxml2 \ libxslt \ libical \ lensfun \ bison \ x265 \ ffmpeg \ qt5-qtbase \ qt5-qtdeclarative \ qt5-qtmacextras \ qt5-qtquickcontrols \ qt5-qtxmlpatterns \ qt5-qtsvg \ qt5-qttools \ qt5-qttranslations \ qt5-qtimageformats \ qt5-sqlite-plugin \ qt5-mysql-plugin \ wget +ssl \ ImageMagick +if [[ $DK_QTWEBENGINE = 1 ]] ; then + port install qt5-qtwebengine +fi + # sane-backends echo -e "\n" echo -e "---------- Compilation logs of Macports packages with suspicious installation\n" find $INSTALL_PREFIX/var/macports/logs/ -name main.log echo -e "\n----------" echo -e "\n" ################################################################################################# # Create the build dir for the 3rdparty deps if [ ! -d $BUILDING_DIR ] ; then mkdir $BUILDING_DIR fi if [ ! -d $DOWNLOAD_DIR ] ; then mkdir $DOWNLOAD_DIR fi cd $BUILDING_DIR rm -rf $BUILDING_DIR/* || true cmake $ORIG_WD/../3rdparty \ -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX \ -DINSTALL_ROOT=$INSTALL_PREFIX \ -DEXTERNALS_DOWNLOAD_DIR=$DOWNLOAD_DIR \ + -DENABLE_QTWEBENGINE=$DK_QTWEBENGINE \ -Wno-dev -cmake --build . --config RelWithDebInfo --target ext_qtwebkit -- -j$CPU_CORES +if [[ $DK_QTWEBENGINE = 0 ]] ; then + cmake --build . --config RelWithDebInfo --target ext_qtwebkit -- -j$CPU_CORES +fi + cmake --build . --config RelWithDebInfo --target ext_opencv -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_exiv2 -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_qtav -- -j$CPU_CORES ################################################################################################# -#ln -s $INSTALL_PREFIX/lib/cmake/Qt5WebKitWidgets $INSTALL_PREFIX/libexec/qt5/lib/cmake/ -#ln -s $INSTALL_PREFIX/lib/QtWebKitWidgets.framework $INSTALL_PREFIX/libexec/qt5/lib/ -#ln -s $INSTALL_PREFIX/lib/QtWebKit.framework $INSTALL_PREFIX/libexec/qt5/lib/ -#ln -s $INSTALL_PREFIX/include/QtWebKitWidgets $INSTALL_PREFIX/libexec/qt5/include/ -#ln -s $INSTALL_PREFIX/include/QtWebKit $INSTALL_PREFIX/libexec/qt5/include/ - export PATH=$ORIG_PATH TerminateScript diff --git a/project/bundles/macports/02-build-extralibs.sh b/project/bundles/macports/02-build-extralibs.sh index a5d380cd81..9f5c284541 100755 --- a/project/bundles/macports/02-build-extralibs.sh +++ b/project/bundles/macports/02-build-extralibs.sh @@ -1,116 +1,117 @@ #! /bin/bash # Script to build extra libraries using MacPorts env. # This script must be run as sudo # # 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-extralibs.full.log) 2>&1 ################################################################################################# echo "02-build-extralibs.sh : build extra libraries using MacPorts." 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:/$INSTALL_PREFIX/libexec/qt5/bin:$ORIG_PATH ################################################################################################# # Create the build dir for the 3rdparty deps if [ ! -d $BUILDING_DIR ] ; then mkdir $BUILDING_DIR fi if [ ! -d $DOWNLOAD_DIR ] ; then mkdir $DOWNLOAD_DIR fi cd $BUILDING_DIR rm -rf $BUILDING_DIR/* || true cmake $ORIG_WD/../3rdparty \ -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX \ -DINSTALL_ROOT=$INSTALL_PREFIX \ -DEXTERNALS_DOWNLOAD_DIR=$DOWNLOAD_DIR \ + -DENABLE_QTWEBENGINE=$DK_QTWEBENGINE \ -Wno-dev # NOTE: The order to compile each component here is very important. # core KF5 frameworks dependencies cmake --build . --config RelWithDebInfo --target ext_extra-cmake-modules -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kconfig -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_breeze-icons -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kcoreaddons -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kwindowsystem -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_solid -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_threadweaver -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_karchive -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kdbusaddons -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_ki18n -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kcrash -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kcodecs -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kauth -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kguiaddons -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kwidgetsaddons -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kitemviews -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kcompletion -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kconfigwidgets -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kiconthemes -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kservice -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kglobalaccel -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kxmlgui -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kbookmarks -- -j$CPU_CORES cmake --build . --config RelWithDebInfo --target ext_kimageformats -- -j$CPU_CORES # libksane support #cmake --build . --config RelWithDebInfo --target ext_libksane -- -j$CPU_CORES # Geolocation support cmake --build . --config RelWithDebInfo --target ext_marble -- -j$CPU_CORES # Calendar support cmake --build . --config RelWithDebInfo --target ext_kcalcore -- -j$CPU_CORES # Marble install shared lib at wrong place. mv $INSTALL_PREFIX/Marble.app/Contents/MacOS/lib/libastro* $INSTALL_PREFIX/lib mv $INSTALL_PREFIX/Marble.app/Contents/MacOS/lib/libmarble* $INSTALL_PREFIX/lib ################################################################################################# export PATH=$ORIG_PATH TerminateScript diff --git a/project/bundles/macports/03-build-digikam.sh b/project/bundles/macports/03-build-digikam.sh index 830262b9f4..b6a6cbd42a 100755 --- a/project/bundles/macports/03-build-digikam.sh +++ b/project/bundles/macports/03-build-digikam.sh @@ -1,179 +1,188 @@ #! /bin/bash # Script to build digiKam using MacPorts # This script must be run as sudo # # 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-digikam.full.log) 2>&1 ################################################################################################# echo "03-build-digikam.sh : build digiKam using MacPorts." 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 ################################################################################################# # Install out-dated dependencies cd $BUILDING_DIR rm -rf $BUILDING_DIR/* || true cmake $ORIG_WD/../3rdparty \ -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX \ -DINSTALL_ROOT=$INSTALL_PREFIX \ -DEXTERNALS_DOWNLOAD_DIR=$DOWNLOAD_DIR \ + -DENABLE_QTWEBENGINE=$DK_QTWEBENGINE \ -Wno-dev cmake --build . --config RelWithDebInfo --target ext_lensfun -- -j$CPU_CORES ################################################################################################# # Build digiKam in temporary directory and installation if [ -d "$DK_BUILDTEMP/digikam-$DK_VERSION" ] ; then echo "---------- Updating existing $DK_BUILDTEMP" cd "$DK_BUILDTEMP" cd digikam-$DK_VERSION git reset --hard git pull mkdir -p build else echo "---------- Creating $DK_BUILDTEMP" mkdir -p "$DK_BUILDTEMP" if [ $? -ne 0 ] ; then echo "---------- Cannot create $DK_BUILDTEMP directory." echo "---------- Aborting..." exit; fi cd "$DK_BUILDTEMP" echo -e "\n\n" echo "---------- Downloading digiKam $DK_VERSION" git clone --progress --verbose $DK_GITURL digikam-$DK_VERSION cd digikam-$DK_VERSION if [ $? -ne 0 ] ; then echo "---------- Cannot clone repositories." echo "---------- Aborting..." exit; fi git checkout $DK_VERSION mkdir build fi echo -e "\n\n" echo "---------- Configure digiKam $DK_VERSION" sed -e "s/DIGIKAMSC_CHECKOUT_PO=OFF/DIGIKAMSC_CHECKOUT_PO=ON/g" ./bootstrap.macports > ./tmp.macports ; mv -f ./tmp.macports ./bootstrap.macports sed -e "s/DIGIKAMSC_COMPILE_PO=OFF/DIGIKAMSC_COMPILE_PO=ON/g" ./bootstrap.macports > ./tmp.macports ; mv -f ./tmp.macports ./bootstrap.macports sed -e "s/DBUILD_TESTING=ON/DBUILD_TESTING=OFF/g" ./bootstrap.macports > ./tmp.macports ; mv -f ./tmp.macports ./bootstrap.macports sed -e "s/DENABLE_DBUS=ON/DENABLE_DBUS=OFF/g" ./bootstrap.macports > ./tmp.macports ; mv -f ./tmp.macports ./bootstrap.macports + +if [[ $DK_QTWEBENGINE = 1 ]] ; then + + sed -e "s/DENABLE_QWEBENGINE=OFF/DENABLE_QWEBENGINE=ON/g" ./bootstrap.macports > ./tmp.macports ; mv -f ./tmp.macports ./bootstrap.macports + +fi + chmod +x ./bootstrap.macports cp -f $ORIG_WD/fixbundledatapath.sh $DK_BUILDTEMP/digikam-$DK_VERSION ./fixbundledatapath.sh ./bootstrap.macports "$INSTALL_PREFIX" "Debug" "x86_64" "-Wno-dev" if [ $? -ne 0 ]; then echo "---------- Cannot configure digiKam $DK_VERSION." echo "---------- Aborting..." exit; fi cat ./build/core/app/utils/digikam_version.h | grep "digikam_version\[\]" | awk '{print $6}' | tr -d '";' > $ORIG_WD/data/RELEASEID.txt echo -e "\n\n" echo "---------- Building digiKam $DK_VERSION" cd build make -j$CPU_CORES if [ $? -ne 0 ]; then echo "---------- Cannot compile digiKam $DK_VERSION." echo "---------- Aborting..." exit; fi echo -e "\n\n" echo "---------- Installing digiKam $DK_VERSION" echo -e "\n\n" make install/fast && cd "$ORIG_WD" && rm -rf "$DK_BUILDTEMP" if [ $? -ne 0 ]; then echo "---------- Cannot install digiKam $DK_VERSION." echo "---------- Aborting..." exit; fi ################################################################################################# # Install Extra Plugins cd $BUILDING_DIR rm -rf $BUILDING_DIR/* || true cmake $ORIG_WD/../3rdparty \ -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX \ -DINSTALL_ROOT=$INSTALL_PREFIX \ -DEXTERNALS_DOWNLOAD_DIR=$DOWNLOAD_DIR \ + -DENABLE_QTWEBENGINE=$DK_QTWEBENGINE \ -Wno-dev cmake --build . --config RelWithDebInfo --target ext_gmic_qt -- -j$CPU_CORES mv -f $INSTALL_PREFIX/libexec/qt5/plugins/digikam/editor/*.so $INSTALL_PREFIX/lib/plugins/digikam/editor/ ################################################################################################# export PATH=$ORIG_PATH TerminateScript diff --git a/project/bundles/macports/04-build-installer.sh b/project/bundles/macports/04-build-installer.sh index f7c57265ca..6cd259ff67 100755 --- a/project/bundles/macports/04-build-installer.sh +++ b/project/bundles/macports/04-build-installer.sh @@ -1,562 +1,586 @@ #! /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. +# NOTE: no ressources data are provided with QtWebKit +if [[ $DK_QTWEBENGINE = 1 ]] ; then + + cp -a "$INSTALL_PREFIX/ressources" "$TEMPROOT" + +fi + +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 ################################################################################################# # 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 "MD5 sum : " >> $TARGET_PKG_FILE.sum md5 -q "$TARGET_PKG_FILE" >> $TARGET_PKG_FILE.sum echo -n "SHA1 sum : " >> $TARGET_PKG_FILE.sum shasum -a1 "$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 "MD5 sum : " >> $TARGET_PKG_FILE.sum md5 -q "$TARGET_PKG_FILE.sig" >> $TARGET_PKG_FILE.sum echo -n "SHA1 sum : " >> $TARGET_PKG_FILE.sum shasum -a1 "$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* 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/macports/config.sh b/project/bundles/macports/config.sh index f2797a4fc1..40366a608d 100644 --- a/project/bundles/macports/config.sh +++ b/project/bundles/macports/config.sh @@ -1,84 +1,87 @@ #!/bin/bash # Copyright (c) 2013-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. ######################################################################## # Absolute path where are downloaded all tarballs to compile. DOWNLOAD_DIR="`pwd`/temp.dwnld" # Absolute path where are compiled all tarballs BUILDING_DIR="`pwd`/temp.build" ######################################################################## # Minimum MacOS target for backward binary compatibility # This require to install older MacOS SDKs with Xcode. # See this url to download a older SDK archive : # # https://github.com/phracker/MacOSX-SDKs/releases # # Uncompress the archive to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ # and adjust the property "MinimumSDKVersion" from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist # sudo /usr/libexec/PlistBuddy -c "Set MinimumSDKVersion 10.12" /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist # # Possible values: # 10.15 : Catalina : : Qt ????, ????, ???? # 10.14 : Mojave : tested : Qt 5.9, 5.10, 5.11, 5.12, 5.13 # 10.13 : High Sierra : tested : Qt 5.9, 5.10, 5.11, 5.12, 5.13 # 10.12 : Sierra : tested : Qt 5.8, 5.9, 5.10, 5.11, 5.12, 5.13 # 10.11 : El Capitan : tested : Qt 5.5, 5.6, 5.7, 5.8, 5.9, 5.10, 5.11 # 10.10 : Yosemite : tested : Qt 5.5, 5.6, 5.7, 5.8, 5.9 # 10.9 : Mavericks : tested : Qt 5.5, 5.6, 5.7, 5.8 # 10.8 : MountainLion : tested : Qt 5.5, 5.6, 5.7 # 10.7 : Lion : untested : Qt 5.5, 5.6 # 10.6 : SnowLeopard : untested : ??? # Older values cannot be set as it do no support x86_64. OSX_MIN_TARGET="10.12" # Directory where not relocable bundle will be built, and where it will be installed by packaging script INSTALL_PREFIX="/opt/digikam" # Macports configuration MP_URL="https://distfiles.macports.org/MacPorts/" MP_BUILDTEMP=~/mptemp # Uncomment this line to force a specific version of Macports to use, else lastest will be used. #MP_VERSION="2.3.3" ######################################################################## # URL to git repository to checkout digiKam source code DK_GITURL="git@invent.kde.org:kde/digikam.git" # digiKam tarball information DK_URL="http://download.kde.org/stable/digikam" # Location to build source code. DK_BUILDTEMP=~/dktemp # digiKam tag version from git. Official tarball do not include extra shared libraries. # The list of tags can be listed with this url: https://quickgit.kde.org/?p=digikam.git&a=tags # If you want to package current implementation from git, use "master" as tag. #DK_VERSION=v6.0.0 DK_VERSION=master #DK_VERSION=development/dplugins # Installer sub version to differentiates newer updates of the installer itself, even if the underlying application hasn’t changed. #DK_EPOCH="-01" # Epoch with time-stamp for pre-release bundle in ISO format DK_EPOCH="-`date "+%Y%m%dT%H%M%S"`" # Installer will include or not digiKam debug symbols DK_DEBUG=1 +# Option to use QtWebEngine instead QtWebkit +DK_QTWEBENGINE=0 + # Sign bundles with GPG. Passphrase must be hosted in ~/.gnupg/dkorg-gpg-pwd.txt DK_SIGN=0 # Upload automatically bundle to files.kde.org (pre-release only). DK_UPLOAD=1 DK_UPLOADURL="digikam@milonia.kde.org" DK_UPLOADDIR="/srv/archives/files/digikam/"