summaryrefslogtreecommitdiffstats
path: root/packaging/macos
diff options
context:
space:
mode:
authorRené de Hesselle <dehesselle@web.de>2019-07-21 22:21:39 +0000
committerRené de Hesselle <dehesselle@web.de>2019-07-21 22:21:39 +0000
commit246379f1aa7af11d5cbf079314d6bdbfb8d09b95 (patch)
treea24e85810332ab8587d1b529a509832b504a1a7c /packaging/macos
parentMake menu icon preference apply to Layers and Objects dialogs (diff)
downloadinkscape-246379f1aa7af11d5cbf079314d6bdbfb8d09b95.tar.gz
inkscape-246379f1aa7af11d5cbf079314d6bdbfb8d09b95.zip
Update jhbuild
This is a massive internal update due to changes in JHBuild. Update Python to 3.7.4.
Diffstat (limited to 'packaging/macos')
-rw-r--r--packaging/macos/020-vars.sh47
-rw-r--r--packaging/macos/030-funcs.sh27
-rwxr-xr-xpackaging/macos/110-jhbuild-install.sh67
-rwxr-xr-xpackaging/macos/110-sysprep.sh41
-rwxr-xr-xpackaging/macos/120-jhbuild-bootstrap.sh30
-rwxr-xr-xpackaging/macos/120-python3.sh31
-rwxr-xr-xpackaging/macos/130-jhbuild-bootstrap.sh40
-rwxr-xr-xpackaging/macos/130-jhbuild-python.sh26
-rwxr-xr-xpackaging/macos/140-jhbuild-gtk3.sh15
-rwxr-xr-xpackaging/macos/150-jhbuild-inkdeps.sh8
-rwxr-xr-xpackaging/macos/160-jhbuild-other.sh24
-rwxr-xr-xpackaging/macos/210-inkscape-build.sh3
-rwxr-xr-xpackaging/macos/220-inkscape-package.sh86
-rwxr-xr-xpackaging/macos/230-inkscape-distrib.sh3
-rw-r--r--packaging/macos/README.md11
-rwxr-xr-xpackaging/macos/build_inkscape.sh3
-rwxr-xr-xpackaging/macos/build_toolset.sh8
17 files changed, 272 insertions, 198 deletions
diff --git a/packaging/macos/020-vars.sh b/packaging/macos/020-vars.sh
index c3c1810f7..5bbd91c1e 100644
--- a/packaging/macos/020-vars.sh
+++ b/packaging/macos/020-vars.sh
@@ -18,10 +18,11 @@
[ -f $HOME/.profile ] && source $HOME/.profile
-### name #######################################################################
+### name and directory #########################################################
SELF_NAME=$(basename $0)
-SELF_DIR=$(cd $(dirname "$0"); pwd -P)
+SELF_DIR=$(F=$0; while [ ! -z $(readlink $F) ] && F=$(readlink $F); \
+ cd $(dirname $F); F=$(basename $F); [ -L $F ]; do :; done; echo $(pwd -P))
### multithreading #############################################################
@@ -114,9 +115,24 @@ LIB_DIR=$OPT_DIR/lib
SRC_DIR=$OPT_DIR/src
TMP_DIR=$OPT_DIR/tmp
+### set system temporary locations to our TMP_DIR ##############################
+
+export TMP=$TMP_DIR
+export TEMP=$TMP_DIR
+export TMPDIR=$TMP_DIR
+
+### set jhbuild directories ####################################################
+
+export DEVROOT=$WRK_DIR/gtk-osx
+export DEVPREFIX=$DEVROOT/local
+export PYTHONUSERBASE=$DEVPREFIX
+export DEV_SRC_ROOT=$DEVROOT/source
+DEVCONFIG=$DEVROOT/config # no export because this is a made-up variable
+export PIP_CONFIG_DIR=$DEVCONFIG/pip
+
### Inkscape Git repository directory ##########################################
-# Location is different when run as GitLab CI job.
+# Location is different when running as GitLab CI job.
if [ -z $CI_JOB_ID ]; then
INK_DIR=$SRC_DIR/inkscape
@@ -151,35 +167,42 @@ APP_PLIST=$APP_CON_DIR/Info.plist
URL_BOOST=https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.bz2
URL_CPPUNIT=https://dev-www.libreoffice.org/src/cppunit-1.14.0.tar.gz
-URL_CURL_CACERT=https://curl.haxx.se/ca/cacert.pem
URL_CREATEDMG=https://github.com/andreyvit/create-dmg/archive/v1.0.0.5.tar.gz
URL_DOUBLE_CONVERSION=https://github.com/google/double-conversion/archive/v3.1.4.tar.gz
-URL_FREETYPE=https://download.savannah.gnu.org/releases/freetype/freetype-2.10.0.tar.bz2
URL_GC=https://github.com/ivmai/bdwgc/releases/download/v8.0.4/gc-8.0.4.tar.gz
URL_GDL=https://github.com/GNOME/gdl/archive/GDL_3_28_0.tar.gz
URL_GSL=http://ftp.fau.de/gnu/gsl/gsl-2.5.tar.gz
URL_GTK_MAC_BUNDLER=https://gitlab.gnome.org/GNOME/gtk-mac-bundler/-/archive/727793cfae08dec0e1e2621078d53a02ec5f7fb3.tar.gz
URL_GTK_OSX=https://raw.githubusercontent.com/dehesselle/gtk-osx/inkscape
-URL_GTK_OSX_BUILD_SETUP=$URL_GTK_OSX/gtk-osx-build-setup.sh
+URL_GTK_OSX_SETUP=$URL_GTK_OSX/gtk-osx-setup.sh
URL_GTK_OSX_MODULESET=$URL_GTK_OSX/modulesets-stable/gtk-osx.modules
URL_IMAGEMAGICK=https://github.com/ImageMagick/ImageMagick6/archive/6.9.7-10.tar.gz
# Inkscape Git repository
URL_INKSCAPE=https://gitlab.com/inkscape/inkscape
URL_LCMS2=https://netcologne.dl.sourceforge.net/project/lcms/lcms/2.9/lcms2-2.9.tar.gz
URL_LIBCDR=https://github.com/LibreOffice/libcdr/archive/libcdr-0.1.5.tar.gz
-URL_LIBPSL=https://github.com/rockdaboot/libpsl/releases/download/libpsl-0.20.2/libpsl-0.20.2.tar.gz
URL_LIBREVENGE=https://ayera.dl.sourceforge.net/project/libwpd/librevenge/librevenge-0.0.4/librevenge-0.0.4.tar.gz
-URL_LIBSOUP=https://ftp.gnome.org/pub/GNOME/sources/libsoup/2.65/libsoup-2.65.92.tar.xz
URL_LIBVISIO=https://github.com/LibreOffice/libvisio/archive/libvisio-0.1.6.tar.gz
URL_LIBWPG=https://netcologne.dl.sourceforge.net/project/libwpg/libwpg/libwpg-0.3.3/libwpg-0.3.3.tar.xz
URL_OPENJPEG=https://github.com/uclouvain/openjpeg/archive/v2.3.0.tar.gz
URL_OPENMP=https://github.com/llvm/llvm-project/releases/download/llvmorg-7.1.0/openmp-7.1.0.src.tar.xz
-# use OpenSSL version as in gtk-osx moduleset
-URL_OPENSSL=https://www.openssl.org/source/old/1.1.0/openssl-1.1.0g.tar.gz
URL_PNG2ICNS=https://github.com/bitboss-ca/png2icns/archive/v0.1.tar.gz
URL_POPPLER=https://gitlab.freedesktop.org/poppler/poppler/-/archive/poppler-0.74.0/poppler-poppler-0.74.0.tar.gz
URL_POTRACE=http://potrace.sourceforge.net/download/1.15/potrace-1.15.tar.gz
-URL_PYTHON3=https://github.com/dehesselle/py3framework/releases/download/py368.5/py368_framework_5.tar.xz
+# This is the relocatable framework to be bundled with the app.
+URL_PYTHON3_BIN=https://github.com/dehesselle/py3framework/releases/download/py374.1/py374_framework_1.tar.xz
+# This is for the jhbuild toolset only.
+URL_PYTHON3_SRC=https://github.com/dehesselle/py3framework/archive/py369.2.tar.gz
# A pre-built version of the complete toolset.
-URL_TOOLSET_CACHE=https://github.com/dehesselle/mibap/releases/download/v0.14/mibap_v0.14.tar.xz
+URL_TOOLSET_CACHE=https://github.com/dehesselle/mibap/releases/download/v0.15/mibap_v0.15.tar.xz
+
+### Python packages ############################################################
+
+PYTHON_CAIROSVG=cairosvg==2.4.0
+PYTHON_CAIROCFFI=cairocffi==1.0.2
+PYTHON_LXML=lxml==4.3.3
+PYTHON_NUMPY=numpy==1.16.4
+PYTHON_PYCAIRO=pycairo==1.18.1
+PYTHON_PYGOBJECT=PyGObject==3.32.1
+PYTHON_SCOUR=scour==0.37
diff --git a/packaging/macos/030-funcs.sh b/packaging/macos/030-funcs.sh
index e421178df..525e736e2 100644
--- a/packaging/macos/030-funcs.sh
+++ b/packaging/macos/030-funcs.sh
@@ -64,6 +64,7 @@ function get_source
[ ! -d $TMP_DIR ] && mkdir -p $TMP_DIR
local log=$(mktemp $TMP_DIR/$FUNCNAME.XXXX)
[ -z $target_dir ] && target_dir=$SRC_DIR
+ [ ! -d $SRC_DIR ] && mkdir -p $SRC_DIR
cd $target_dir
@@ -165,3 +166,29 @@ function relocate_dependency
install_name_tool -change $source $target $library
}
+### 'readlink -f' replacement ##################################################
+
+# This is what the oneliner used to set SELF_DIR is based on.
+
+function readlinkf
+{
+ # 'readlink -f' replacement: https://stackoverflow.com/a/1116890
+ # 'do while' replacement: https://stackoverflow.com/a/16491478
+
+ local file=$1
+
+ # iterate down a (possible) chain of symlinks
+ while
+ [ ! -z $(readlink $file) ] && file=$(readlink $file)
+ cd $(dirname $file)
+ file=$(basename $file)
+ [ -L "$file" ]
+ do
+ :
+ done
+
+ # Compute the canonicalized name by finding the physical path
+ # for the directory we're in and appending the target file.
+ echo $(pwd -P)/$file
+}
+
diff --git a/packaging/macos/110-jhbuild-install.sh b/packaging/macos/110-jhbuild-install.sh
deleted file mode 100755
index cff2ef39e..000000000
--- a/packaging/macos/110-jhbuild-install.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env bash
-# SPDX-License-Identifier: GPL-2.0-or-later
-#
-# This file is part of the build pipeline for Inkscape on macOS.
-#
-# ### 110-jhbuild-install.sh ###
-# Install the JHBuild tool.
-
-### load settings and functions ################################################
-
-SELF_DIR=$(cd $(dirname "$0"); pwd -P)
-for script in $SELF_DIR/0??-*.sh; do source $script; done
-
-### create our work directory ##################################################
-
-[ ! -d $WRK_DIR ] && mkdir -p $WRK_DIR
-
-# Use a ramdisk to speed up things.
-if $RAMDISK_ENABLE; then
- create_ramdisk $WRK_DIR $RAMDISK_SIZE
-fi
-
-### setup path #################################################################
-
-# WARNING: Operations like this are the reason that you're supposed to use
-# a dedicated machine for building. This script does not care for your
-# data.
-echo "export PATH=$BIN_DIR:/usr/bin:/bin:/usr/sbin:/sbin" > $HOME/.profile
-source $HOME/.profile
-
-### setup directories for jhbuild ##############################################
-
-mkdir -p $TMP_DIR
-mkdir -p $SRC_DIR/checkout # extracted tarballs
-mkdir -p $SRC_DIR/download # downloaded tarballs
-
-# WARNING: Operations like this are the reason that you're supposed to use
-# a dedicated machine for building. This script does not care for your
-# data.
-rm -rf $HOME/.cache
-rm -rf $HOME/.local
-ln -sf $TMP_DIR $HOME/.cache # link to our workspace
-ln -sf $OPT_DIR $HOME/.local # link to our workspace
-
-### install and configure jhbuild ##############################################
-
-# remove configuration files from a previous installation
-rm $HOME/.jhbuild*
-
-# install jhbuild
-cd $WRK_DIR
-export SRC_DIR # used as '$SOURCE' inside jhbuild
-bash <(curl -s $URL_GTK_OSX_BUILD_SETUP) # run jhbuild setup script
-
-# configure jhbuild
-JHBUILDRC=$HOME/.jhbuildrc-custom
-echo "checkoutroot = '$SRC_DIR/checkout'" >> $JHBUILDRC
-echo "prefix = '$OPT_DIR'" >> $JHBUILDRC
-echo "tarballdir = '$SRC_DIR/download'" >> $JHBUILDRC
-echo "quiet_mode = True" >> $JHBUILDRC # suppress output
-echo "progress_bar = True" >> $JHBUILDRC
-echo "moduleset = '$URL_GTK_OSX_MODULESET'" >> $JHBUILDRC # custom moduleset
-
-# configure SDK
-sed -i "" "s/^setup_sdk/#setup_sdk/" $JHBUILDRC # comment out existing setting
-echo "setup_sdk(target=\"$MACOSX_DEPLOYMENT_TARGET\")" >> $JHBUILDRC
-
diff --git a/packaging/macos/110-sysprep.sh b/packaging/macos/110-sysprep.sh
new file mode 100755
index 000000000..432972e6d
--- /dev/null
+++ b/packaging/macos/110-sysprep.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# This file is part of the build pipeline for Inkscape on macOS.
+#
+# ### 110-sysprep.sh ###
+# System preparation tasks.
+
+### load settings and functions ################################################
+
+SELF_DIR=$(F=$0; while [ ! -z $(readlink $F) ] && F=$(readlink $F); \
+ cd $(dirname $F); F=$(basename $F); [ -L $F ]; do :; done; echo $(pwd -P))
+for script in $SELF_DIR/0??-*.sh; do source $script; done
+
+### create our work directory ##################################################
+
+[ ! -d $WRK_DIR ] && mkdir -p $WRK_DIR
+
+# Use a ramdisk to speed up things.
+if $RAMDISK_ENABLE; then
+ create_ramdisk $WRK_DIR $RAMDISK_SIZE
+fi
+
+### housekeeping: redirect to locations below $WRK_DIR #########################
+
+mkdir -p $TMP_DIR
+
+rm -rf $HOME/.cache # used by jhbuild
+ln -sf $TMP_DIR $HOME/.cache
+
+rm -rf $HOME/.local # used by gtk-mac-bundler
+ln -sf $OPT_DIR $HOME/.local
+
+### setup path #################################################################
+
+# WARNING: Operations like this are the reason why you're supposed to use
+# a dedicated user for building.
+
+echo "export PATH=$DEVPREFIX/bin:$BIN_DIR:/usr/bin:/bin:/usr/sbin:/sbin" > $HOME/.profile
+echo "export LANG=de_DE.UTF-8" >> $HOME/.profile # jhbuild complains otherwise
+
diff --git a/packaging/macos/120-jhbuild-bootstrap.sh b/packaging/macos/120-jhbuild-bootstrap.sh
deleted file mode 100755
index b666d889c..000000000
--- a/packaging/macos/120-jhbuild-bootstrap.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env bash
-# SPDX-License-Identifier: GPL-2.0-or-later
-#
-# This file is part of the build pipeline for Inkscape on macOS.
-#
-# ### 120-jhbuild-bootstrap.sh ###
-# Bootstrap the JHBuild environment.
-
-### load settings and functions ################################################
-
-SELF_DIR=$(cd $(dirname "$0"); pwd -P)
-for script in $SELF_DIR/0??-*.sh; do source $script; done
-
-### install OpenSSL ############################################################
-
-# We install OpenSSL first so this version gets used instead instead of the
-# system one. (El Capitan uses 0.98)
-
-get_source $URL_OPENSSL
-./config --prefix=$OPT_DIR --openssldir=$OPT_DIR/etc/ssl $FLAG_MMACOSXVERSIONMIN
-make_makeinstall
-
-# The non-Apple OpenSSL cannot access the keychain where the certificates
-# are stored (required for https downloads). But the curl project provides
-# a certificates file that they extracted from Mozilla, so we use that.
-curl -o $OPT_DIR/etc/ssl/cert.pem $URL_CURL_CACERT
-
-### bootstrap jhbuild environment ##############################################
-
-jhbuild bootstrap
diff --git a/packaging/macos/120-python3.sh b/packaging/macos/120-python3.sh
new file mode 100755
index 000000000..5401574f0
--- /dev/null
+++ b/packaging/macos/120-python3.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# This file is part of the build pipeline for Inkscape on macOS.
+#
+# ### 120-python3.sh ###
+# Install a dedicated Python 3 for JHBuild because it fails to install
+# a working Python by itself.
+
+### load settings and functions ################################################
+
+SELF_DIR=$(F=$0; while [ ! -z $(readlink $F) ] && F=$(readlink $F); \
+ cd $(dirname $F); F=$(basename $F); [ -L $F ]; do :; done; echo $(pwd -P))
+for script in $SELF_DIR/0??-*.sh; do source $script; done
+
+### install Python 3 ###########################################################
+
+get_source $URL_PYTHON3_SRC
+
+sed -i "" '/^FRA_DIR/s/.*/FRA_DIR=$WRK_DIR/' 020-vars.sh
+
+./110-build.sh
+./310-package-fixed.sh
+
+cd $SELF_DIR
+rm -rf $OPT_DIR
+mkdir -p $BIN_DIR
+mkdir -p $TMP_DIR
+ln -sf $WRK_DIR/Python.framework/Versions/Current/bin/python3 $BIN_DIR
+ln -sf $BIN_DIR/python3 $BIN_DIR/python
+
diff --git a/packaging/macos/130-jhbuild-bootstrap.sh b/packaging/macos/130-jhbuild-bootstrap.sh
new file mode 100755
index 000000000..5bd7bae03
--- /dev/null
+++ b/packaging/macos/130-jhbuild-bootstrap.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# This file is part of the build pipeline for Inkscape on macOS.
+#
+# ### 130-jhbuild-bootstrap.sh ###
+# Bootstrap the JHBuild environment.
+
+### load settings and functions ################################################
+
+SELF_DIR=$(F=$0; while [ ! -z $(readlink $F) ] && F=$(readlink $F); \
+ cd $(dirname $F); F=$(basename $F); [ -L $F ]; do :; done; echo $(pwd -P))
+for script in $SELF_DIR/0??-*.sh; do source $script; done
+
+### install and configure jhbuild ##############################################
+
+# remove configuration files from a previous installation
+rm $HOME/.config/jhbuild* 2>/dev/null
+
+bash <(curl -s $URL_GTK_OSX_SETUP) # run jhbuild setup script
+
+mv $HOME/.config/jhbuild* $DEVCONFIG
+ln -sf $DEVCONFIG/jhbuild* $HOME/.config
+
+( # configure jhbuild
+ JHBUILDRC=$DEVCONFIG/jhbuildrc-custom
+ echo "checkoutroot = '$SRC_DIR/checkout'" >> $JHBUILDRC
+ echo "prefix = '$OPT_DIR'" >> $JHBUILDRC
+ echo "tarballdir = '$SRC_DIR/download'" >> $JHBUILDRC
+ echo "quiet_mode = True" >> $JHBUILDRC # suppress output
+ echo "progress_bar = True" >> $JHBUILDRC
+ echo "moduleset = '$URL_GTK_OSX_MODULESET'" >> $JHBUILDRC # custom moduleset
+
+ # configure SDK
+ sed -i "" "s/^setup_sdk/#setup_sdk/" $JHBUILDRC # disable existing setting
+ echo "setup_sdk(target=\"$MACOSX_DEPLOYMENT_TARGET\")" >> $JHBUILDRC
+)
+
+# bootstrapping
+jhbuild bootstrap-gtk-osx
diff --git a/packaging/macos/130-jhbuild-python.sh b/packaging/macos/130-jhbuild-python.sh
deleted file mode 100755
index c3a9dbe1e..000000000
--- a/packaging/macos/130-jhbuild-python.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/env bash
-# SPDX-License-Identifier: GPL-2.0-or-later
-#
-# This file is part of the build pipeline for Inkscape on macOS.
-#
-# ### 130-jhbuild-python.sh ###
-# Install Python 2 and packages for the build system.
-
-### load settings and functions ################################################
-
-SELF_DIR=$(cd $(dirname "$0"); pwd -P)
-for script in $SELF_DIR/0??-*.sh; do source $script; done
-
-### install Python 2 ###########################################################
-
-# Some packages complain about non-exiting development headers when you rely
-# solely on the macOS-provided Python installation. This also enables
-# system-wide installations of packages without permission issues.
-
-jhbuild build python
-
-cd $SRC_DIR
-curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
-jhbuild run python get-pip.py
-jhbuild run pip install six # required for a package in meta-gtk-osx-bootstrap
-
diff --git a/packaging/macos/140-jhbuild-gtk3.sh b/packaging/macos/140-jhbuild-gtk3.sh
index adb561ce0..aea766b72 100755
--- a/packaging/macos/140-jhbuild-gtk3.sh
+++ b/packaging/macos/140-jhbuild-gtk3.sh
@@ -8,18 +8,23 @@
### load settings and functions ################################################
-SELF_DIR=$(cd $(dirname "$0"); pwd -P)
+SELF_DIR=$(F=$0; while [ ! -z $(readlink $F) ] && F=$(readlink $F); \
+ cd $(dirname $F); F=$(basename $F); [ -L $F ]; do :; done; echo $(pwd -P))
for script in $SELF_DIR/0??-*.sh; do source $script; done
### install GTK3 libraries #####################################################
-# meta-gtk-osx-freetype is included to fix a breakage in meta-gtk-osx-gtk3
-# due to missing headers.
-# source: <TODO - there is/was a link, but I need to find it again>
-
jhbuild build \
meta-gtk-osx-bootstrap \
meta-gtk-osx-freetype \
meta-gtk-osx-gtk3 \
meta-gtk-osx-gtkmm3
+### fix loaders ################################################################
+
+for file in $LIB_DIR/gdk-pixbuf-2.0/2.10.0/loaders/*.dylib; do
+ mv $file $(dirname $file)/$(basename -s .dylib $file).so
+done
+
+gdk-pixbuf-query-loaders > $LIB_DIR/gdk-pixbuf-2.0/2.10.0/loaders.cache
+
diff --git a/packaging/macos/150-jhbuild-inkdeps.sh b/packaging/macos/150-jhbuild-inkdeps.sh
index db4c3b139..768c95e6a 100755
--- a/packaging/macos/150-jhbuild-inkdeps.sh
+++ b/packaging/macos/150-jhbuild-inkdeps.sh
@@ -9,7 +9,8 @@
### load settings and functions ################################################
-SELF_DIR=$(cd $(dirname "$0"); pwd -P)
+SELF_DIR=$(F=$0; while [ ! -z $(readlink $F) ] && F=$(readlink $F); \
+ cd $(dirname $F); F=$(basename $F); [ -L $F ]; do :; done; echo $(pwd -P))
for script in $SELF_DIR/0??-*.sh; do source $script; done
### install additional GNOME libraries #########################################
@@ -85,11 +86,6 @@ configure_make_makeinstall
get_source $URL_POPPLER
cmake_make_makeinstall -DENABLE_UNSTABLE_API_ABI_HEADERS=ON
-### install gtk-mac-bundler ####################################################
-
-get_source $URL_GTK_MAC_BUNDLER
-make install
-
### install double-conversion ##################################################
# Required by lib2geom.
diff --git a/packaging/macos/160-jhbuild-other.sh b/packaging/macos/160-jhbuild-other.sh
index 2dbd3265c..9b7692f0a 100755
--- a/packaging/macos/160-jhbuild-other.sh
+++ b/packaging/macos/160-jhbuild-other.sh
@@ -9,10 +9,32 @@
### load settings and functions ################################################
-SELF_DIR=$(cd $(dirname "$0"); pwd -P)
+SELF_DIR=$(F=$0; while [ ! -z $(readlink $F) ] && F=$(readlink $F); \
+ cd $(dirname $F); F=$(basename $F); [ -L $F ]; do :; done; echo $(pwd -P))
for script in $SELF_DIR/0??-*.sh; do source $script; done
### install create-dmg #########################################################
get_source $URL_CREATEDMG
+### install gtk-mac-bundler ####################################################
+
+get_source $URL_GTK_MAC_BUNDLER
+make install
+
+### install svg to pgn convertor ###############################################
+
+jhbuild run pip3 install $PYTHON_CAIROSVG
+jhbuild run pip3 install $PYTHON_CAIROCFFI
+
+### install png to icns converter ##############################################
+
+get_source $URL_PNG2ICNS
+ln -s $(pwd)/png2icns.sh $BIN_DIR
+
+### downlaod a pre-built Python.framework ######################################
+
+# This will be bundled with the application.
+
+save_file $URL_PYTHON3_BIN
+
diff --git a/packaging/macos/210-inkscape-build.sh b/packaging/macos/210-inkscape-build.sh
index 0bfca45b4..d92090f00 100755
--- a/packaging/macos/210-inkscape-build.sh
+++ b/packaging/macos/210-inkscape-build.sh
@@ -8,7 +8,8 @@
### load settings and functions ################################################
-SELF_DIR=$(cd $(dirname "$0"); pwd -P)
+SELF_DIR=$(F=$0; while [ ! -z $(readlink $F) ] && F=$(readlink $F); \
+ cd $(dirname $F); F=$(basename $F); [ -L $F ]; do :; done; echo $(pwd -P))
for script in $SELF_DIR/0??-*.sh; do source $script; done
set -e
diff --git a/packaging/macos/220-inkscape-package.sh b/packaging/macos/220-inkscape-package.sh
index 9fd12f934..ed0be6572 100755
--- a/packaging/macos/220-inkscape-package.sh
+++ b/packaging/macos/220-inkscape-package.sh
@@ -8,7 +8,8 @@
### load settings and functions ################################################
-SELF_DIR=$(cd $(dirname "$0"); pwd -P)
+SELF_DIR=$(F=$0; while [ ! -z $(readlink $F) ] && F=$(readlink $F); \
+ cd $(dirname $F); F=$(basename $F); [ -L $F ]; do :; done; echo $(pwd -P))
for script in $SELF_DIR/0??-*.sh; do source $script; done
set -e
@@ -16,11 +17,20 @@ set -e
### package Inkscape ###########################################################
mkdir -p $ARTIFACT_DIR
-export ARTIFACT_DIR # referenced in 'inkscape.bundle'
-cp $SRC_DIR/gtk-mac-bundler*/examples/gtk3-launcher.sh $SELF_DIR
-cd $SELF_DIR
-jhbuild run gtk-mac-bundler inkscape.bundle
+(
+ export ARTIFACT_DIR # referenced in 'inkscape.bundle'
+
+ BUILD_DIR=$SRC_DIR/gtk-mac-bundler.build
+ mkdir -p $BUILD_DIR
+
+ cp $SRC_DIR/gtk-mac-bundler*/examples/gtk3-launcher.sh $BUILD_DIR
+ cp $SELF_DIR/inkscape.bundle $BUILD_DIR
+ cp $SELF_DIR/inkscape.plist $BUILD_DIR
+
+ cd $BUILD_DIR
+ jhbuild run gtk-mac-bundler inkscape.bundle
+)
# patch library locations
relocate_dependency @executable_path/../Resources/lib/inkscape/libinkscape_base.dylib $APP_EXE_DIR/Inkscape-bin
@@ -60,28 +70,23 @@ mkdir -p $XDG_CACHE_HOME\
# svg to png
-jhbuild run pip3 install cairosvg==2.4.0
-jhbuild run pip3 install cairocffi==1.0.2
-
(
- export DYLD_FALLBACK_LIBRARY_PATH=/work/opt/lib
+ export DYLD_FALLBACK_LIBRARY_PATH=$LIB_DIR
jhbuild run cairosvg -f png -s 8 -o $SRC_DIR/inkscape.png $INK_DIR/share/branding/inkscape.svg
)
# png to icns
-get_source $URL_PNG2ICNS
-./png2icns.sh $SRC_DIR/inkscape.png
+cd $SRC_DIR # png2icns.sh outputs to current directory
+png2icns.sh inkscape.png
mv inkscape.icns $APP_RES_DIR
### bundle Python.framework ####################################################
# This section deals with bundling Python.framework into the application.
-save_file $URL_PYTHON3 # download a pre-built Python.framework
-
mkdir $APP_FRA_DIR
-get_source file://$SRC_DIR/$(basename $URL_PYTHON3) $APP_FRA_DIR
+get_source file://$SRC_DIR/$(basename $URL_PYTHON3_BIN) $APP_FRA_DIR
# add it to '$PATH' in launch script
insert_before $APP_EXE_DIR/Inkscape '\$EXEC' 'export PATH=$bundle_contents/Frameworks/Python.framework/Versions/Current/bin:$PATH'
@@ -89,22 +94,22 @@ insert_before $APP_EXE_DIR/Inkscape '\$EXEC' 'export PATH=$bundle_contents/Frame
export PATH=$APP_FRA_DIR/Python.framework/Versions/Current/bin:$PATH
# create '.pth' file inside Framework to include our site-packages directory
-echo "./../../../../../../../Resources/lib/python3.6/site-packages" > $APP_FRA_DIR/Python.framework/Versions/Current/lib/python3.6/site-packages/inkscape.pth
+echo "./../../../../../../../Resources/lib/python3.7/site-packages" > $APP_FRA_DIR/Python.framework/Versions/Current/lib/python3.7/site-packages/inkscape.pth
### install Python package: lxml ###############################################
(
export CFLAGS=-I$OPT_DIR/include/libxml2 # This became necessary when switching
export LDFLAGS=-L/$LIB_DIR # from builing on 10.13 to 10.11.
- pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed lxml==4.3.3
+ pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed $PYTHON_LXML
)
# patch 'etree'
-relocate_dependency @loader_path/../../../libxml2.2.dylib $APP_LIB_DIR/python3.6/site-packages/lxml/etree.cpython-36m-darwin.so
-relocate_dependency @loader_path/../../../libz.1.dylib $APP_LIB_DIR/python3.6/site-packages/lxml/etree.cpython-36m-darwin.so
+relocate_dependency @loader_path/../../../libxml2.2.dylib $APP_LIB_DIR/python3.7/site-packages/lxml/etree.cpython-37m-darwin.so
+relocate_dependency @loader_path/../../../libz.1.dylib $APP_LIB_DIR/python3.7/site-packages/lxml/etree.cpython-37m-darwin.so
# patch 'objectify'
-relocate_dependency @loader_path/../../../libxml2.2.dylib $APP_LIB_DIR/python3.6/site-packages/lxml/objectify.cpython-36m-darwin.so
-relocate_dependency @loader_path/../../../libz.1.dylib $APP_LIB_DIR/python3.6/site-packages/lxml/objectify.cpython-36m-darwin.so
+relocate_dependency @loader_path/../../../libxml2.2.dylib $APP_LIB_DIR/python3.7/site-packages/lxml/objectify.cpython-37m-darwin.so
+relocate_dependency @loader_path/../../../libz.1.dylib $APP_LIB_DIR/python3.7/site-packages/lxml/objectify.cpython-37m-darwin.so
# patch libxml2.dylib to use '@loader_path' to find neighbouring libraries
relocate_dependency @loader_path/libz.1.dylib $APP_LIB_DIR/libxml2.2.dylib
@@ -112,14 +117,14 @@ relocate_dependency @loader_path/liblzma.5.dylib $APP_LIB_DIR/libxml2.2.dylib
### install Python package: NumPy ##############################################
-pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed numpy==1.16.4
+pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed $PYTHON_NUMPY
### install Python package: Pycairo ############################################
-pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed pycairo==1.18.1
+pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed $PYTHON_PYCAIRO
# patch '_cairo'
-relocate_dependency @loader_path/../../../libcairo.2.dylib $APP_LIB_DIR/python3.6/site-packages/cairo/_cairo.cpython-36m-darwin.so
+relocate_dependency @loader_path/../../../libcairo.2.dylib $APP_LIB_DIR/python3.7/site-packages/cairo/_cairo.cpython-37m-darwin.so
# patch libcairo.2.dylib to use '@loader_path' to find neighbouring libraries
relocate_dependency @loader_path/libpixman-1.0.dylib $APP_LIB_DIR/libcairo.2.dylib
@@ -130,15 +135,15 @@ relocate_dependency @loader_path/libz.1.dylib $APP_LIB_DIR/libcairo.2.dylib
### install Python package: PyGObject ##########################################
-pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed PyGObject==3.32.1
+pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed $PYTHON_PYGOBJECT
# patch '_gi'
-relocate_dependency @loader_path/../../../libglib-2.0.0.dylib $APP_LIB_DIR/python3.6/site-packages/gi/_gi.cpython-36m-darwin.so
-relocate_dependency @loader_path/../../../libintl.9.dylib $APP_LIB_DIR/python3.6/site-packages/gi/_gi.cpython-36m-darwin.so
-relocate_dependency @loader_path/../../../libgio-2.0.0.dylib $APP_LIB_DIR/python3.6/site-packages/gi/_gi.cpython-36m-darwin.so
-relocate_dependency @loader_path/../../../libgobject-2.0.0.dylib $APP_LIB_DIR/python3.6/site-packages/gi/_gi.cpython-36m-darwin.so
-relocate_dependency @loader_path/../../../libgirepository-1.0.1.dylib $APP_LIB_DIR/python3.6/site-packages/gi/_gi.cpython-36m-darwin.so
-relocate_dependency @loader_path/../../../libffi.6.dylib $APP_LIB_DIR/python3.6/site-packages/gi/_gi.cpython-36m-darwin.so
+relocate_dependency @loader_path/../../../libglib-2.0.0.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi.cpython-37m-darwin.so
+relocate_dependency @loader_path/../../../libintl.9.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi.cpython-37m-darwin.so
+relocate_dependency @loader_path/../../../libgio-2.0.0.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi.cpython-37m-darwin.so
+relocate_dependency @loader_path/../../../libgobject-2.0.0.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi.cpython-37m-darwin.so
+relocate_dependency @loader_path/../../../libgirepository-1.0.1.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi.cpython-37m-darwin.so
+relocate_dependency @loader_path/../../../libffi.6.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi.cpython-37m-darwin.so
# patch libglib-2.0.0.dylib to find neighbouring libraries
relocate_dependency @loader_path/libintl.9.dylib $APP_LIB_DIR/libglib-2.0.0.dylib
@@ -161,18 +166,17 @@ relocate_dependency @loader_path/libgmodule-2.0.0.dylib $APP_LIB_DIR/libgireposi
relocate_dependency @loader_path/libgio-2.0.0.dylib $APP_LIB_DIR/libgirepository-1.0.1.dylib
relocate_dependency @loader_path/libgobject-2.0.0.dylib $APP_LIB_DIR/libgirepository-1.0.1.dylib
relocate_dependency @loader_path/libglib-2.0.0.dylib $APP_LIB_DIR/libgirepository-1.0.1.dylib
-relocate_dependency @loader_path/libintl.9.dylib $APP_LIB_DIR/libgirepository-1.0.1.dylib
relocate_dependency @loader_path/libffi.6.dylib $APP_LIB_DIR/libgirepository-1.0.1.dylib
# patch '_gi_cairo'
-relocate_dependency @loader_path/../../../libglib-2.0.0.dylib $APP_LIB_DIR/python3.6/site-packages/gi/_gi_cairo.cpython-36m-darwin.so
-relocate_dependency @loader_path/../../../libintl.9.dylib $APP_LIB_DIR/python3.6/site-packages/gi/_gi_cairo.cpython-36m-darwin.so
-relocate_dependency @loader_path/../../../libgio-2.0.0.dylib $APP_LIB_DIR/python3.6/site-packages/gi/_gi_cairo.cpython-36m-darwin.so
-relocate_dependency @loader_path/../../../libgobject-2.0.0.dylib $APP_LIB_DIR/python3.6/site-packages/gi/_gi_cairo.cpython-36m-darwin.so
-relocate_dependency @loader_path/../../../libgirepository-1.0.1.dylib $APP_LIB_DIR/python3.6/site-packages/gi/_gi_cairo.cpython-36m-darwin.so
-relocate_dependency @loader_path/../../../libffi.6.dylib $APP_LIB_DIR/python3.6/site-packages/gi/_gi_cairo.cpython-36m-darwin.so
-relocate_dependency @loader_path/../../../libcairo.2.dylib $APP_LIB_DIR/python3.6/site-packages/gi/_gi_cairo.cpython-36m-darwin.so
-relocate_dependency @loader_path/../../../libcairo-gobject.2.dylib $APP_LIB_DIR/python3.6/site-packages/gi/_gi_cairo.cpython-36m-darwin.so
+relocate_dependency @loader_path/../../../libglib-2.0.0.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi_cairo.cpython-37m-darwin.so
+relocate_dependency @loader_path/../../../libintl.9.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi_cairo.cpython-37m-darwin.so
+relocate_dependency @loader_path/../../../libgio-2.0.0.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi_cairo.cpython-37m-darwin.so
+relocate_dependency @loader_path/../../../libgobject-2.0.0.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi_cairo.cpython-37m-darwin.so
+relocate_dependency @loader_path/../../../libgirepository-1.0.1.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi_cairo.cpython-37m-darwin.so
+relocate_dependency @loader_path/../../../libffi.6.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi_cairo.cpython-37m-darwin.so
+relocate_dependency @loader_path/../../../libcairo.2.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi_cairo.cpython-37m-darwin.so
+relocate_dependency @loader_path/../../../libcairo-gobject.2.dylib $APP_LIB_DIR/python3.7/site-packages/gi/_gi_cairo.cpython-37m-darwin.so
# patch libcairo-gobject.2.dylib
relocate_dependency @loader_path/libcairo.2.dylib $APP_LIB_DIR/libcairo-gobject.2.dylib
@@ -191,7 +195,7 @@ relocate_dependency @loader_path/libintl.9.dylib $APP_LIB_DIR/libgmodule-2.0.0.d
### install Python package: Scour ##############################################
-pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed scour==0.37
+pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed $PYTHON_SCOUR
### set default Python interpreter #############################################
@@ -200,7 +204,7 @@ pip3 install --install-option="--prefix=$APP_RES_DIR" --ignore-installed scour==
# ) we set the bundled Python to be the default one.
# Default interpreter is an unversioned environment lookup for 'python', so
-# we prepar to override it.
+# we prepare to override it.
mkdir -p $APP_BIN_DIR
cd $APP_BIN_DIR
ln -sf ../../Frameworks/Python.framework/Versions/Current/bin/python3 python
diff --git a/packaging/macos/230-inkscape-distrib.sh b/packaging/macos/230-inkscape-distrib.sh
index 631610317..929a51d72 100755
--- a/packaging/macos/230-inkscape-distrib.sh
+++ b/packaging/macos/230-inkscape-distrib.sh
@@ -8,7 +8,8 @@
### load settings and functions ################################################
-SELF_DIR=$(cd $(dirname "$0"); pwd -P)
+SELF_DIR=$(F=$0; while [ ! -z $(readlink $F) ] && F=$(readlink $F); \
+ cd $(dirname $F); F=$(basename $F); [ -L $F ]; do :; done; echo $(pwd -P))
for script in $SELF_DIR/0??-*.sh; do source $script; done
set -e
diff --git a/packaging/macos/README.md b/packaging/macos/README.md
index 1e12b30b0..bd755d941 100644
--- a/packaging/macos/README.md
+++ b/packaging/macos/README.md
@@ -25,12 +25,13 @@ _In some regards it would've been more fair if this section was called "recommen
```
- __Use a dedicated user account__ unless you're prepared that these scripts will delete and overwrite your data in the following locations:
-_(comments based on default configuration)_
+_(based on default configuration)_
```bash
- $HOME/.cache # will be symlinked to $WRK_DIR/tmp
- $HOME/.local # will be symlinked to $WRK_DIR/opt
- $HOME/.profile # will be overwritten
+ $HOME/.cache # will be linked to $TMP_DIR
+ $HOME/.config/jhbuildrc* # will be overwritten
+ $HOME/.local # will be linked to $OPT_DIR
+ $HOME/.profile # will be overwritten
```
- __16 GiB RAM__, since we're using a 9 GiB ramdisk to build everything.
@@ -55,7 +56,7 @@ to have everything run for you. If you are doing this the first time, my advice
### GitLab CI
-> TODO: configuration examples need to be reworked
+> TODO: configuration examples need to be updated!
#### configuration example `.gitlab-runner/config.toml`
diff --git a/packaging/macos/build_inkscape.sh b/packaging/macos/build_inkscape.sh
index 65f430271..dc3139a2c 100755
--- a/packaging/macos/build_inkscape.sh
+++ b/packaging/macos/build_inkscape.sh
@@ -8,7 +8,8 @@
### load settings and functions ################################################
-SELF_DIR=$(cd $(dirname "$0"); pwd -P)
+SELF_DIR=$(F=$0; while [ ! -z $(readlink $F) ] && F=$(readlink $F); \
+ cd $(dirname $F); F=$(basename $F); [ -L $F ]; do :; done; echo $(pwd -P))
for script in $SELF_DIR/0??-*.sh; do source $script; done
set -e
diff --git a/packaging/macos/build_toolset.sh b/packaging/macos/build_toolset.sh
index 12e0d7b8d..0a50b7bcb 100755
--- a/packaging/macos/build_toolset.sh
+++ b/packaging/macos/build_toolset.sh
@@ -8,7 +8,8 @@
### load settings and functions ################################################
-SELF_DIR=$(cd $(dirname "$0"); pwd -P)
+SELF_DIR=$(F=$0; while [ ! -z $(readlink $F) ] && F=$(readlink $F); \
+ cd $(dirname $F); F=$(basename $F); [ -L $F ]; do :; done; echo $(pwd -P))
for script in $SELF_DIR/0??-*.sh; do source $script; done
set -e
@@ -26,8 +27,11 @@ else
# Until a better solution is found, the ramdisk has to be manually created
# on the runner and is disabled on CI.
[ ! -z $CI_JOB_ID ] && RAMDISK_ENABLE=false
- $SELF_DIR/110-jhbuild-install.sh
+ $SELF_DIR/110-sysprep.sh
get_source $URL_TOOLSET_CACHE $WRK_DIR
+ mkdir -p $HOME/.config
+ rm -f $HOME/.config/jhbuild*
+ ln -sf $DEVCONFIG/jhbuild* $HOME/.config
else # we need to build from scratch
for script in $SELF_DIR/1??-*.sh; do
$script