summaryrefslogtreecommitdiffstats
path: root/packaging/macos/210-inkscape-build.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:29:01 +0000
commit35a96bde514a8897f6f0fcc41c5833bf63df2e2a (patch)
tree657d15a03cc46bd099fc2c6546a7a4ad43815d9f /packaging/macos/210-inkscape-build.sh
parentInitial commit. (diff)
downloadinkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.tar.xz
inkscape-35a96bde514a8897f6f0fcc41c5833bf63df2e2a.zip
Adding upstream version 1.0.2.upstream/1.0.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/macos/210-inkscape-build.sh')
-rwxr-xr-xpackaging/macos/210-inkscape-build.sh59
1 files changed, 59 insertions, 0 deletions
diff --git a/packaging/macos/210-inkscape-build.sh b/packaging/macos/210-inkscape-build.sh
new file mode 100755
index 0000000..5f6f61e
--- /dev/null
+++ b/packaging/macos/210-inkscape-build.sh
@@ -0,0 +1,59 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: GPL-2.0-or-later
+#
+# This file is part of the build pipeline for Inkscape on macOS.
+#
+# ### 210-inkscape-build.sh ###
+# Build Inscape.
+
+### 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
+
+set -e -o errtrace
+trap 'catch_error "$SELF_NAME" "$LINENO" "$FUNCNAME" "${BASH_COMMAND}" "${?}"' ERR
+
+### build Inkscape #############################################################
+
+if [ -z $CI_JOB_ID ]; then # running standalone
+ git clone --recurse-submodules --depth 10 $URL_INKSCAPE $INK_DIR
+fi
+
+[ -d $INK_DIR.build ] && rm -rf $INK_DIR.build || true # cleanup previous run
+
+mkdir -p $INK_DIR.build
+cd $INK_DIR.build
+
+# about the '-DOpenMP_*' arguments:
+# All the settings for OpenMP are to trigger the detection during 'cmake'.
+# Experimenting with a "Hello World"-style example shows that linking with
+# '-lomp' would suffice, no '-fopenmp' required.
+# TODO further investigation into required flags
+
+cmake \
+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
+ -DCMAKE_PREFIX_PATH=$OPT_DIR \
+ -DCMAKE_INSTALL_PREFIX=$OPT_DIR \
+ -DOpenMP_CXX_FLAGS="-Xclang -fopenmp" \
+ -DOpenMP_C_FLAGS="-Xclang -fopenmp" \
+ -DOpenMP_CXX_LIB_NAMES="omp" \
+ -DOpenMP_C_LIB_NAMES="omp" \
+ -DOpenMP_omp_LIBRARY=$LIB_DIR/libomp.dylib \
+ $INK_DIR
+
+make
+make install
+make tests
+
+### patch Poppler library locations ############################################
+
+relocate_dependency $LIB_DIR/libpoppler.94.dylib $BIN_DIR/inkscape
+relocate_dependency $LIB_DIR/libpoppler-glib.8.dylib $BIN_DIR/inkscape
+relocate_dependency $LIB_DIR/libpoppler.94.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 #############################################
+
+relocate_dependency $LIB_DIR/libomp.dylib $BIN_DIR/inkscape
+relocate_dependency $LIB_DIR/libomp.dylib $LIB_DIR/inkscape/libinkscape_base.dylib