diff options
| author | René de Hesselle <dehesselle@web.de> | 2019-06-28 22:32:49 +0000 |
|---|---|---|
| committer | René de Hesselle <dehesselle@web.de> | 2019-06-28 23:04:22 +0000 |
| commit | 5dcf1e17a99f0912d7e27d5aa6087f547da26f87 (patch) | |
| tree | ad3b9d0da03680f4d2c1f2c5b5612246e47dedfd /packaging | |
| parent | No longer allow macOS CI to fail (diff) | |
| download | inkscape-5dcf1e17a99f0912d7e27d5aa6087f547da26f87.tar.gz inkscape-5dcf1e17a99f0912d7e27d5aa6087f547da26f87.zip | |
Update macOS build pipeline
Noteworthy are the creation of '.dmg' and a fix for inbox#605.
Lots of minor improvements.
Diffstat (limited to 'packaging')
| -rw-r--r-- | packaging/macos/020-vars.sh | 9 | ||||
| -rw-r--r-- | packaging/macos/030-funcs.sh | 13 | ||||
| -rwxr-xr-x | packaging/macos/120-jhbuild-bootstrap.sh | 3 | ||||
| -rwxr-xr-x | packaging/macos/130-jhbuild-python.sh | 2 | ||||
| -rwxr-xr-x | packaging/macos/160-jhbuild-other.sh | 23 | ||||
| -rwxr-xr-x | packaging/macos/210-inkscape-build.sh | 12 | ||||
| -rwxr-xr-x | packaging/macos/220-inkscape-package.sh | 10 | ||||
| -rwxr-xr-x | packaging/macos/230-inkscape-distrib.sh | 41 | ||||
| -rw-r--r-- | packaging/macos/inkscape.plist | 6 | ||||
| -rw-r--r-- | packaging/macos/inkscape_dmg.json | 7 |
10 files changed, 95 insertions, 31 deletions
diff --git a/packaging/macos/020-vars.sh b/packaging/macos/020-vars.sh index 59e2e49df..dbc1f4152 100644 --- a/packaging/macos/020-vars.sh +++ b/packaging/macos/020-vars.sh @@ -30,12 +30,12 @@ export MAKEFLAGS="-j $CORES" ### target OS version ########################################################## -# There are a lot of ways to appraoch this. I recommend: +# There are a lot of ways to appraoch this. Recommendation: # - OS X El Capitan (10.11) # - Xcode 8.2.1 (latest Xcode to support 10.11) for its clang 8.x # - MacOSX10.11.sdk from Xcode 7.3.1 -export MACOSX_DEPLOYMENT_TARGET=10.11 # minimum version Mavericks +export MACOSX_DEPLOYMENT_TARGET=10.11 # minimum version El Capitan FLAG_MMACOSXVERSIONMIN="-mmacosx-version-min=$MACOSX_DEPLOYMENT_TARGET" @@ -171,6 +171,7 @@ URL_LIBREVENGE=https://ayera.dl.sourceforge.net/project/libwpd/librevenge/librev 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_NODEJS=https://nodejs.org/dist/v10.16.0/node-v10.16.0-darwin-x64.tar.gz 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 @@ -178,7 +179,7 @@ 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.4/py368_framework_4.tar.xz +URL_PYTHON3=https://github.com/dehesselle/py3framework/releases/download/py368.5/py368_framework_5.tar.xz # A pre-built version of the complete toolset. -URL_TOOLSET_CACHE=https://github.com/dehesselle/mibap/releases/download/v0.11/mibap_v0.11.tar.xz +URL_TOOLSET_CACHE=https://github.com/dehesselle/mibap/releases/download/v0.13/mibap_v0.13.tar.xz diff --git a/packaging/macos/030-funcs.sh b/packaging/macos/030-funcs.sh index e44fc7034..e421178df 100644 --- a/packaging/macos/030-funcs.sh +++ b/packaging/macos/030-funcs.sh @@ -4,11 +4,11 @@ # # ### 030-funcs.sh ### # This file contains all the functions used by the other scripts. It helps -# modularizing functionalities and keeping the scripts that do the real work -# as clean as possible. +# modularizing functionality and keeping the scripts that do the real work +# as readable as possible. # This file does not include the "vars" files it requires itself (on purpose, # for flexibility reasons), the script that wants to use these functions -# needs to do that. The suggest way is to always source all the "0nn-*.sh" +# needs to do that. The suggested way is to always source all the "0nn-*.sh" # files in order. [ -z $FUNCS_INCLUDED ] && FUNCS_INCLUDED=true || return # include guard @@ -26,7 +26,7 @@ function get_repo_version function get_inkscape_version { - local file=$SRC_DIR/inkscape/CMakeLists.txt + local file=$INK_DIR/CMakeLists.txt local ver_major=$(grep INKSCAPE_VERSION_MAJOR $file | head -n 1 | awk '{ print $2+0 }') local ver_minor=$(grep INKSCAPE_VERSION_MINOR $file | head -n 1 | awk '{ print $2+0 }') local ver_patch=$(grep INKSCAPE_VERSION_PATCH $file | head -n 1 | awk '{ print $2+0 }') @@ -35,11 +35,6 @@ function get_inkscape_version ver_suffix=${ver_suffix%\"*} # remove "double quote and everything after" from end ver_suffix=${ver_suffix#\"} # remove "double quote" from beginning - # If there is a suffix, add the dot to it. Otherwise the suffix stays an - # empty string and resolves to "nothing" down below (as intended in that - # case). - [ ${#ver_suffix} -gt 0 ] && ver_suffix=.$ver_suffix - echo $ver_major.$ver_minor.$ver_patch$ver_suffix } diff --git a/packaging/macos/120-jhbuild-bootstrap.sh b/packaging/macos/120-jhbuild-bootstrap.sh index 3fbf82689..b666d889c 100755 --- a/packaging/macos/120-jhbuild-bootstrap.sh +++ b/packaging/macos/120-jhbuild-bootstrap.sh @@ -20,6 +20,9 @@ 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 ############################################## diff --git a/packaging/macos/130-jhbuild-python.sh b/packaging/macos/130-jhbuild-python.sh index 4229bb2da..c3a9dbe1e 100755 --- a/packaging/macos/130-jhbuild-python.sh +++ b/packaging/macos/130-jhbuild-python.sh @@ -4,7 +4,7 @@ # This file is part of the build pipeline for Inkscape on macOS. # # ### 130-jhbuild-python.sh ### -# Install Python 2 and 3. +# Install Python 2 and packages for the build system. ### load settings and functions ################################################ diff --git a/packaging/macos/160-jhbuild-other.sh b/packaging/macos/160-jhbuild-other.sh new file mode 100755 index 000000000..0b5214a37 --- /dev/null +++ b/packaging/macos/160-jhbuild-other.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: GPL-2.0-or-later +# +# This file is part of the build pipeline for Inkscape on macOS. +# +# ### 160-jhbuild-other.sh ### +# Install additional components that are not direct dependencies, like tools +# required for packaging. + +### load settings and functions ################################################ + +SELF_DIR=$(cd $(dirname "$0"); pwd -P) +for script in $SELF_DIR/0??-*.sh; do source $script; done + +### install Node.js ############################################################ + +get_source $URL_NODEJS + +( + export PATH=$PATH:$(pwd)/bin + npm install -g appdmg # tool to easily create .dmg +) + diff --git a/packaging/macos/210-inkscape-build.sh b/packaging/macos/210-inkscape-build.sh index feb404bca..0bfca45b4 100755 --- a/packaging/macos/210-inkscape-build.sh +++ b/packaging/macos/210-inkscape-build.sh @@ -45,12 +45,12 @@ make make install # patch Poppler library locations -install_name_tool -change @rpath/libpoppler.85.dylib $LIB_DIR/libpoppler.85.dylib $BIN_DIR/inkscape -install_name_tool -change @rpath/libpoppler-glib.8.dylib $LIB_DIR/libpoppler-glib.8.dylib $BIN_DIR/inkscape -install_name_tool -change @rpath/libpoppler.85.dylib $LIB_DIR/libpoppler.85.dylib $LIB_DIR/inkscape/libinkscape_base.dylib -install_name_tool -change @rpath/libpoppler-glib.8.dylib $LIB_DIR/libpoppler-glib.8.dylib $LIB_DIR/inkscape/libinkscape_base.dylib +relocate_dependency $LIB_DIR/libpoppler.85.dylib $BIN_DIR/inkscape +relocate_dependency $LIB_DIR/libpoppler-glib.8.dylib $BIN_DIR/inkscape +relocate_dependency $LIB_DIR/libpoppler.85.dylib $LIB_DIR/inkscape/libinkscape_base.dylib +relocate_dependency $LIB_DIR/libpoppler-glib.8.dylib $LIB_DIR/inkscape/libinkscape_base.dylib # patch OpenMP library locations -install_name_tool -change @rpath/libomp.dylib $LIB_DIR/libomp.dylib $BIN_DIR/inkscape -install_name_tool -change @rpath/libomp.dylib $LIB_DIR/libomp.dylib $LIB_DIR/inkscape/libinkscape_base.dylib +relocate_dependency $LIB_DIR/libomp.dylib $BIN_DIR/inkscape +relocate_dependency $LIB_DIR/libomp.dylib $LIB_DIR/inkscape/libinkscape_base.dylib diff --git a/packaging/macos/220-inkscape-package.sh b/packaging/macos/220-inkscape-package.sh index 3bef7a6e6..9fd12f934 100755 --- a/packaging/macos/220-inkscape-package.sh +++ b/packaging/macos/220-inkscape-package.sh @@ -23,13 +23,13 @@ cd $SELF_DIR jhbuild run gtk-mac-bundler inkscape.bundle # patch library locations -install_name_tool -change @rpath/libinkscape_base.dylib @executable_path/../Resources/lib/inkscape/libinkscape_base.dylib $APP_EXE_DIR/Inkscape-bin +relocate_dependency @executable_path/../Resources/lib/inkscape/libinkscape_base.dylib $APP_EXE_DIR/Inkscape-bin -install_name_tool -change @rpath/libpoppler.85.dylib @executable_path/../Resources/lib/libpoppler.85.dylib $APP_LIB_DIR/libpoppler-glib.8.dylib -install_name_tool -change @rpath/libpoppler.85.dylib @executable_path/../Resources/lib/libpoppler.85.dylib $APP_LIB_DIR/inkscape/libinkscape_base.dylib -install_name_tool -change @rpath/libpoppler-glib.8.dylib @executable_path/../Resources/lib/libpoppler-glib.8.dylib $APP_LIB_DIR/inkscape/libinkscape_base.dylib +relocate_dependency @executable_path/../Resources/lib/libpoppler.85.dylib $APP_LIB_DIR/libpoppler-glib.8.dylib +relocate_dependency @executable_path/../Resources/lib/libpoppler.85.dylib $APP_LIB_DIR/inkscape/libinkscape_base.dylib +relocate_dependency @executable_path/../Resources/lib/libpoppler-glib.8.dylib $APP_LIB_DIR/inkscape/libinkscape_base.dylib -install_name_tool -change @executable_path/../Resources/lib/libcrypto.1.1.dylib @loader_path/libcrypto.1.1.dylib $APP_LIB_DIR/libssl.1.1.dylib +relocate_dependency @loader_path/libcrypto.1.1.dylib $APP_LIB_DIR/libssl.1.1.dylib # set Inkscape's data directory via environment variables # TODO: as follow-up to https://gitlab.com/inkscape/inkscape/merge_requests/612, diff --git a/packaging/macos/230-inkscape-distrib.sh b/packaging/macos/230-inkscape-distrib.sh index 55013f188..bb7997895 100755 --- a/packaging/macos/230-inkscape-distrib.sh +++ b/packaging/macos/230-inkscape-distrib.sh @@ -15,9 +15,44 @@ set -e ### create disk image for distribution ######################################### -# TODO: *.dmg, signing, notarization, ... +# Update the .json file with our paths. -if [ ! -z $CI_JOB_ID ]; then # create build artifcat for CI job - cd $WRK_DIR +cp $SELF_DIR/inkscape_dmg.json $SRC_DIR + +( + # escaping forward slashes: https://unix.stackexchange.com/a/379577 + # ESCAPED=${STRING//\//\\\/} + + FILE=$SRC_DIR/inkscape_dmg.png + sed -i '' "s/PLACEHOLDERBACKGROUND/${FILE//\//\\\/}/" $SRC_DIR/inkscape_dmg.json + sed -i '' "s/PLACEHOLDERPATH/${APP_DIR//\//\\\/}/" $SRC_DIR/inkscape_dmg.json +) + +# Create background for development snapshots. This is not meant for +# official releases, those will be re-packaged manually (they also need +# to be signed and notarized). + +convert -size 560x400 xc:transparent \ + -font Andale-Mono -pointsize 64 -fill black \ + -draw "text 20,60 'Inkscape'" \ + -draw "text 20,120 '$(get_inkscape_version)'" \ + -draw "text 20,180 'development'" \ + -draw "text 20,240 'snapshot'" \ + -draw "text 20,300 '$(get_repo_version $INK_DIR)'" \ + $SRC_DIR/inkscape_dmg.png + +# create the disk image + +( + cd $SRC_DIR/node-* + export PATH=$PATH:$(pwd)/bin + appdmg $SRC_DIR/inkscape_dmg.json $ARTIFACT_DIR/Inkscape.dmg +) + +# CI: move disk image to a location accessible for the runner + +if [ ! -z $CI_JOB_ID ]; then + [ -d $INK_DIR/artifacts ] && rm -rf $INK_DIR/artifacts mv $ARTIFACT_DIR $INK_DIR/artifacts + rm -rf $INK_DIR/artifacts/*.app fi diff --git a/packaging/macos/inkscape.plist b/packaging/macos/inkscape.plist index 5ee321db6..f4bdfccd9 100644 --- a/packaging/macos/inkscape.plist +++ b/packaging/macos/inkscape.plist @@ -536,17 +536,17 @@ <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> - <string>1.0alpha</string> + <string>CFBundleShortVersionString</string> <key>CFBundleSignature</key> <string>Inks</string> <key>CFBundleVersion</key> - <string>1.0alpha</string> + <string>CFBundleVersion</string> <key>NSHumanReadableCopyright</key> <string>Copyright 2019 Inkscape Developers, GNU General Public License.</string> <key>LSApplicationCategoryType</key> <string>public.app-category.graphics-design</string> <key>LSMinimumSystemVersion</key> - <string>10.11</string> + <string>LSMinimumSystemVersion</string> <key>GtkOSXLaunchScriptFile</key> <string>gtk_launcher.py</string> <key>NSHighResolutionCapable</key> diff --git a/packaging/macos/inkscape_dmg.json b/packaging/macos/inkscape_dmg.json new file mode 100644 index 000000000..f098073f4 --- /dev/null +++ b/packaging/macos/inkscape_dmg.json @@ -0,0 +1,7 @@ +{ + "title": "Inkscape", + "background": "PLACEHOLDERBACKGROUND", + "contents": [ + { "x": 420, "y": 260, "type": "file", "path": "PLACEHOLDERPATH" } + ] +} |
