summaryrefslogtreecommitdiffstats
path: root/taskcluster/scripts/misc/build-dmg-hfsplus.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /taskcluster/scripts/misc/build-dmg-hfsplus.sh
parentInitial commit. (diff)
downloadfirefox-esr-upstream.tar.xz
firefox-esr-upstream.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'taskcluster/scripts/misc/build-dmg-hfsplus.sh')
-rwxr-xr-xtaskcluster/scripts/misc/build-dmg-hfsplus.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/taskcluster/scripts/misc/build-dmg-hfsplus.sh b/taskcluster/scripts/misc/build-dmg-hfsplus.sh
new file mode 100755
index 0000000000..b0039432aa
--- /dev/null
+++ b/taskcluster/scripts/misc/build-dmg-hfsplus.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+set -x -e -v
+
+# This script is for building libdmg-hfsplus to get the `dmg` and `hfsplus`
+# tools for producing DMG archives on Linux.
+
+WORKSPACE=$HOME/workspace
+STAGE=$WORKSPACE/dmg
+
+mkdir -p $UPLOAD_DIR $STAGE
+
+cd $MOZ_FETCHES_DIR/libdmg-hfsplus
+
+# The openssl libraries in the sysroot cannot be linked in a PIE executable so we use -no-pie
+cmake \
+ -DCMAKE_C_COMPILER=$MOZ_FETCHES_DIR/clang/bin/clang \
+ -DCMAKE_CXX_COMPILER=$MOZ_FETCHES_DIR/clang/bin/clang++ \
+ -DCMAKE_SYSROOT=$MOZ_FETCHES_DIR/sysroot \
+ -DOPENSSL_USE_STATIC_LIBS=1 \
+ -DCMAKE_EXE_LINKER_FLAGS=-no-pie \
+ .
+
+make VERBOSE=1 -j$(nproc)
+
+# We only need the dmg and hfsplus tools.
+strip dmg/dmg hfs/hfsplus
+cp dmg/dmg hfs/hfsplus $STAGE
+
+# duplicate the functionality of taskcluster-lib-urls, but in bash..
+queue_base="$TASKCLUSTER_ROOT_URL/api/queue/v1"
+
+cat >$STAGE/README<<EOF
+Source is available as a taskcluster artifact:
+$queue_base/task/$(python3 -c 'import json, os; print("{task}/artifacts/{artifact}".format(**next(f for f in json.loads(os.environ["MOZ_FETCHES"]) if "dmg-hfsplus" in f["artifact"])))')
+EOF
+tar caf $UPLOAD_DIR/dmg.tar.zst -C $WORKSPACE `basename $STAGE`