Files
dvdisaster/.github/workflows/make-mac-app.sh
Stéphane Lesimple eeb9f0705d feat: re-introduced MacOS support (#71)
* preparatory changes to make dvdisaster compilable under MacOS
* Implemented workaround to macOS Test Unit Ready bug
* fixed manual.pdf not opening on macOS
* Added case for binary being in app bundle
* updated locale files due to change in closure.c
* added back mac app bundle specific files
* reverted make-dist.sh to windows/linux only version and created separate mac script which uses dylibbundler
* altered release.yml accordingly
* chore: fix build under MacOS

---------

Co-authored-by: Stéphane Lesimple <speed47_github@speed47.net>
Co-authored-by: jlnbxn <julianboxan@gmail.com>
Co-authored-by: wojas <github@m.wojas.nl>
2023-09-17 19:13:47 +02:00

45 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
set -e
set -x
github_ref="$1"
archive="dvdisaster-$(echo "$github_ref" | grep -Eo '[^/]+$').dmg"
echo "Archive name is $archive"
echo "::set-output name=archive::$archive"
mkdir dist
# Create directory structure for the macOS application bundle
mkdir -p dvdisaster.app/Contents/{MacOS,Resources}
# Copy the main executable to the appropriate location
cp dvdisaster dvdisaster.app/Contents/MacOS
# Use dylibbundler to bundle dynamic libraries into the application bundle
dylibbundler -od -cd -b -x dvdisaster.app/Contents/MacOS/dvdisaster -d 'dvdisaster.app/Contents/libs/'
# Copy the Info.plist file to define application metadata
cp macinst/Info.plist dvdisaster.app/Contents/
# Create a directory for documentation resources
mkdir dvdisaster.app/Contents/Resources/documentation
# Copy documentation files to the documentation directory
cp CHANGELOG TODO COPYING CREDITS.* documentation/dvdisaster.*.1 documentation/user-manual/manual.pdf dvdisaster.app/Contents/Resources/documentation
# Copy localization files to the locale directory
find locale/* -maxdepth 0 -type d -exec cp -r {} dvdisaster.app/Contents/Resources/locale/ \;
# Copy the application icon to the resources directory
cp macinst/dvdisaster.icns dvdisaster.app/Contents/Resources/
# Make the main executable executable
chmod +x dvdisaster.app/Contents/MacOS/dvdisaster
# Move the application bundle to the 'dist' directory
mv dvdisaster.app dist
create-dmg "$archive" dist
echo "dist done ($archive)"