summaryrefslogtreecommitdiffstats
path: root/packaging/macos/jhb/etc/jhb.conf/ccache.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:24:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:24:48 +0000
commitcca66b9ec4e494c1d919bff0f71a820d8afab1fa (patch)
tree146f39ded1c938019e1ed42d30923c2ac9e86789 /packaging/macos/jhb/etc/jhb.conf/ccache.sh
parentInitial commit. (diff)
downloadinkscape-cca66b9ec4e494c1d919bff0f71a820d8afab1fa.tar.xz
inkscape-cca66b9ec4e494c1d919bff0f71a820d8afab1fa.zip
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'packaging/macos/jhb/etc/jhb.conf/ccache.sh')
-rw-r--r--packaging/macos/jhb/etc/jhb.conf/ccache.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/packaging/macos/jhb/etc/jhb.conf/ccache.sh b/packaging/macos/jhb/etc/jhb.conf/ccache.sh
new file mode 100644
index 0000000..82a2208
--- /dev/null
+++ b/packaging/macos/jhb/etc/jhb.conf/ccache.sh
@@ -0,0 +1,49 @@
+# SPDX-FileCopyrightText: 2022 René de Hesselle <dehesselle@web.de>
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+### description ################################################################
+
+# Settings and functions to setup ccache.
+
+### shellcheck #################################################################
+
+# shellcheck shell=bash # no shebang as this file is intended to be sourced
+
+### variables ##################################################################
+
+export CCACHE_DIR=${CCACHE_DIR:-$WRK_DIR/ccache}
+
+# https://ccache.dev
+# https://github.com/ccache/ccache
+# https://gitlab.com/dehesselle/ccache_macos
+CCACHE_VER=4.6.3r1
+CCACHE_URL=https://gitlab.com/api/v4/projects/29039216/packages/generic/\
+ccache_macos/$CCACHE_VER/ccache_$(uname -m).tar.xz
+
+### functions ##################################################################
+
+function ccache_configure
+{
+ mkdir -p "$CCACHE_DIR"
+
+ cat <<EOF > "$CCACHE_DIR/ccache.conf"
+base_dir = $WRK_DIR
+hash_dir = false
+max_size = 3.0G
+temporary_dir = $CCACHE_DIR/tmp
+EOF
+}
+
+function ccache_install
+{
+ curl -L "$CCACHE_URL" | tar -C "$USR_DIR"/bin --exclude="ccache.sha256" -xJ
+
+ for compiler in clang clang++ gcc g++; do
+ ln -sf ccache "$USR_DIR"/bin/$compiler
+ done
+}
+
+### main #######################################################################
+
+# Nothing here.