summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Luby <patrick.luby@collabora.com>2023-03-01 09:23:12 -0500
committerAndras Timar <andras.timar@collabora.com>2023-03-02 20:20:24 +0000
commit4637080c28ac082ca44ee37e05e1b0c0a6183ba6 (patch)
treedcbe2fe801ed13d0f7c6e0e8be8ff5735547f688
parenttdf#153672 Use RelativeMapMode so text in gdis are scaled/offset correctly (diff)
downloadcore-4637080c28ac082ca44ee37e05e1b0c0a6183ba6.tar.gz
core-4637080c28ac082ca44ee37e05e1b0c0a6183ba6.zip
Enable building non-Mac App Store Universal .dmg from merged and signed .app
Add a new bin/create-dmg-from-merged-app-bundle script which is used to package a merged and signed .app folder (created with the bin/merge-app-bundles and manually signed) into a distributable .dmg. Also, add .jnilib files to the lipo list in bin/merge-app-bundles since these are really .dylib files for Java. Change-Id: I1da4105b0820251580401f975f499b8d59a20499 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148101 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
-rwxr-xr-xbin/create-dmg-from-merged-app-bundle81
-rwxr-xr-xbin/merge-app-bundles2
2 files changed, 83 insertions, 0 deletions
diff --git a/bin/create-dmg-from-merged-app-bundle b/bin/create-dmg-from-merged-app-bundle
new file mode 100755
index 000000000000..8f32e4d24b3e
--- /dev/null
+++ b/bin/create-dmg-from-merged-app-bundle
@@ -0,0 +1,81 @@
+#!/usr/bin/env bash
+
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# Exit on errors
+set -e
+
+# Use of unset variable is an error
+set -u
+
+# If any part of a pipeline of commands fails, the whole pipeline fails
+set -o pipefail
+
+if [ `uname` != Darwin ]; then
+ echo This is for macOS only >&2
+ exit 1
+fi
+
+if [ $# != 1 ]; then
+ echo Usage: $0 signed-app-bundle
+ exit 1
+fi
+
+if [ ! -d "$1" ]; then
+ echo No such directory: $1 >&2
+ exit 1
+fi
+
+if [[ "$1" != *.app ]]; then
+ echo "signed-app-bundle argument $1 does not end with .app" >&2
+ exit 1
+fi
+
+IN=$(cd "$1" && /bin/pwd)
+INAPP=$(basename "$IN")
+INDIR=$(dirname "$IN")
+OUTVOLUME=$(basename "$IN" .app)
+OUTTMPDIR=$(dirname "$IN")/"$OUTVOLUME"
+OUTFILE="$OUTTMPDIR".dmg
+SRCDIR=$(cd `dirname "$0"`/.. && /bin/pwd)
+
+# Create $OUTTMPDIR directory in the same directory as the output .dmg and
+# assemble assets
+
+if [ -f "$OUTFILE" ]; then
+ echo The file $OUTFILE exists already >&2
+ exit 1
+fi
+
+if [ -d "$OUTFILE" ]; then
+ echo $OUTFILE exists and is a directory >&2
+ exit 1
+fi
+
+if [ -d "$OUTTMPDIR" ]; then
+ echo The directory $OUTTMPDIR exists already >&2
+ exit 1
+fi
+
+if [ -f "$OUTTMPDIR" ]; then
+ echo $OUTTMPDIR exists and is a file >&2
+ exit 1
+fi
+
+mkdir "$OUTTMPDIR"
+mkdir "$OUTTMPDIR"/.background
+tar cf - "$INAPP" -C "$INDIR" | tar xvpf - -C "$OUTTMPDIR"
+ln -s /Applications "$OUTTMPDIR"/Applications
+cp "$SRCDIR"/setup_native/source/packinfo/DS_Store "$OUTTMPDIR"/.DS_Store
+cp "$SRCDIR"/setup_native/source/packinfo/VolumeIcon.icns "$OUTTMPDIR"/.VolumeIcon.icns
+cp "$SRCDIR"/setup_native/source/packinfo/osxdndinstall.png "$OUTTMPDIR"/.background/background.png
+
+# Create and mount empty .dmg
+
+# Copied and adapted to bash from solenv/bin/modules/installer/simplepackage.pm
+# tdf#151341 Use lzfse compression instead of bzip2
+hdiutil create -srcfolder "$OUTTMPDIR" "$OUTFILE" -ov -fs HFS+ -volname "$OUTVOLUME" -format ULFO
diff --git a/bin/merge-app-bundles b/bin/merge-app-bundles
index 2a2200f1c44d..b92c90b5a0c9 100755
--- a/bin/merge-app-bundles
+++ b/bin/merge-app-bundles
@@ -76,6 +76,8 @@ OUT=$(cd "$3" && /bin/pwd)
elif test -f "$fname"; then
case "$fname" in
*.so | \
+ *.jnilib | \
+ *.jnilib.* | \
*.dylib | \
*.dylib.* | \
*/Frameworks/LibreOfficePython.framework/Versions/*/LibreOfficePython | \