From 89368f63c99d67cde8868c0269b66a1b0c507397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Sun, 20 Aug 2023 11:21:25 +0200 Subject: [PATCH] Add script for local macOS distribution --- .gitignore | 2 ++ scripts/macos-dist-local.sh | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100755 scripts/macos-dist-local.sh diff --git a/.gitignore b/.gitignore index 0b9eccd..f30ef42 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,5 @@ compile_commands.json chiaki.conf /appimage .cache/ +/*.app +/*.dmg diff --git a/scripts/macos-dist-local.sh b/scripts/macos-dist-local.sh new file mode 100755 index 0000000..d2ac740 --- /dev/null +++ b/scripts/macos-dist-local.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Build Chiaki for macOS distribution using dependencies from MacPorts and custom ffmpeg + +set -xe +cd $(dirname "${BASH_SOURCE[0]}")/.. +scripts/build-ffmpeg.sh +export CMAKE_PREFIX_PATH="`pwd`/ffmpeg-prefix" +scripts/build-common.sh +cp -a build/gui/chiaki.app Chiaki.app +/opt/local/libexec/qt5/bin/macdeployqt Chiaki.app + +# Remove all LC_RPATH load commands that have absolute paths of the build machine +RPATHS=$(otool -l Chiaki.app/Contents/MacOS/chiaki | grep -A 2 LC_RPATH | grep 'path /' | awk '{print $2}') +for p in ${RPATHS}; do install_name_tool -delete_rpath "$p" Chiaki.app/Contents/MacOS/chiaki; done + +# This may warn because we already ran macdeployqt above +/opt/local/libexec/qt5/bin/macdeployqt Chiaki.app -dmg