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>
This commit is contained in:
Stéphane Lesimple
2023-09-17 19:13:47 +02:00
committed by GitHub
parent f38969c7c8
commit eeb9f0705d
30 changed files with 1689 additions and 1348 deletions

View File

@@ -48,4 +48,4 @@ if command -v zip >/dev/null; then
zip -9r $archive ${archive/.zip/}
mv ${archive/.zip/} dist
fi
echo "dist done ($archive)"
echo "dist done ($archive)"

45
.github/workflows/make-mac-app.sh vendored Executable file
View File

@@ -0,0 +1,45 @@
#!/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)"

View File

@@ -5,6 +5,57 @@ on:
types: [published]
jobs:
mac:
runs-on: macos-10.15
strategy:
matrix:
ui: [cli, gui]
include:
- ui: cli
clionly: --with-gui=no
steps:
- uses: actions/checkout@v2
- name: install prerequisites
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: brew install ghostscript glib gdk-pixbuf
- name: install prerequisites (GUI)
if: matrix.ui == 'gui'
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: brew install gtk+ dylibbundler create-dmg
- name: configure
run: |
set +x
./configure ${{ matrix.clionly }} --with-werror
- name: make
run: make -j$(sysctl -n hw.ncpu || 2)
- name: check executability
run: ./dvdisaster --version
- name: check executable (GUI)
if: matrix.ui == 'gui'
run: |
./dvdisaster --version
if ./dvdisaster --version | grep NOGUI; then exit 1; fi
- name: check executable (CLI)
if: matrix.ui == 'cli'
run: |
./dvdisaster --version
./dvdisaster --version | grep NOGUI
- name: build dist
run: ./.github/workflows/make-mac-app.sh ${{ github.ref }}
id: dist
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.dist.outputs.archive }}
asset_name: ${{ steps.dist.outputs.archive }}
asset_content_type: application/zip
win:
runs-on: windows-latest
strategy:
@@ -24,130 +75,129 @@ jobs:
run:
shell: msys2 {0}
steps:
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: false
install: git diffutils make pkg-config mingw-w64-${{ matrix.arch }}-glib2 mingw-w64-${{ matrix.arch }}-gcc mingw-w64-${{ matrix.arch }}-ghostscript mingw-w64-${{ matrix.arch }}-ntldd-git man zip
- name: install GUI prereqs
if: matrix.ui == 'gui'
run: pacman -S --noconfirm mingw-w64-${{ matrix.arch }}-gtk2
- name: git config
run: git config --global core.autocrlf input
shell: bash
- uses: actions/checkout@v2
- name: configure
run: ./configure ${{ matrix.clionly }}
- name: make
run: nproc && make -j$(nproc)
- name: check executable
run: |
- uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.msystem }}
update: false
install: git diffutils make pkg-config mingw-w64-${{ matrix.arch }}-glib2 mingw-w64-${{ matrix.arch }}-gcc mingw-w64-${{ matrix.arch }}-ghostscript mingw-w64-${{ matrix.arch }}-ntldd-git man zip
- name: install GUI prereqs
if: matrix.ui == 'gui'
run: pacman -S --noconfirm mingw-w64-${{ matrix.arch }}-gtk2
- name: git config
run: git config --global core.autocrlf input
shell: bash
- uses: actions/checkout@v2
- name: configure
run: ./configure ${{ matrix.clionly }}
- name: make
run: nproc && make -j$(nproc)
- name: check executable
run: |
./dvdisaster.exe --version
file dvdisaster.exe
if ./dvdisaster.exe --version | grep dirty; then exit 1; fi
file dvdisaster.exe | grep -q '${{ matrix.grep }}, for MS Windows'
- name: check executable (GUI)
if: matrix.ui == 'gui'
run: if ./dvdisaster.exe --version | grep NOGUI; then exit 1; fi
- name: check executable (CLI)
if: matrix.ui == 'cli'
run: ./dvdisaster.exe --version | grep NOGUI
- name: prepare dist
run: ./.github/workflows/make-dist.sh ${{ github.ref }}
id: dist
- name: check executability of dist from cmd.exe
shell: cmd
run: |
- name: check executable (GUI)
if: matrix.ui == 'gui'
run: if ./dvdisaster.exe --version | grep NOGUI; then exit 1; fi
- name: check executable (CLI)
if: matrix.ui == 'cli'
run: ./dvdisaster.exe --version | grep NOGUI
- name: prepare dist
run: ./.github/workflows/make-dist.sh ${{ github.ref }}
id: dist
- name: check executability of dist from cmd.exe
shell: cmd
run: |
cd dist
dvdisaster.exe --version
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.dist.outputs.archive }}
asset_name: ${{ steps.dist.outputs.archive }}
asset_content_type: application/zip
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.dist.outputs.archive }}
asset_name: ${{ steps.dist.outputs.archive }}
asset_content_type: application/zip
linux64-cli:
runs-on: ubuntu-latest
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: install prerequisites
run: sudo apt update && sudo apt install -y libglib2.0-dev ghostscript man
- name: configure
run: ./configure --with-gui=no
- name: make
run: nproc && make -j$(nproc) && make static && mv -f dvdisaster-static dvdisaster
- name: check executable
run: |
./dvdisaster --version && ./dvdisaster --version | grep -q dirty || true
file dvdisaster && file dvdisaster | grep -q 'ELF 64' && file dvdisaster | grep -q 'statically linked'
- uses: actions/checkout@v2
- name: install prerequisites
run: sudo apt update && sudo apt install -y libglib2.0-dev ghostscript man
- name: configure
run: ./configure --with-gui=no
- name: make
run: nproc && make -j$(nproc) && make static && mv -f dvdisaster-static dvdisaster
- name: check executable
run: |
./dvdisaster --version && ./dvdisaster --version | grep -q dirty || true
file dvdisaster && file dvdisaster | grep -q 'ELF 64' && file dvdisaster | grep -q 'statically linked'
- name: build dist
run: ./.github/workflows/make-dist.sh ${{ github.ref }}
id: dist
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.dist.outputs.archive }}
asset_name: ${{ steps.dist.outputs.archive }}
asset_content_type: application/zip
- name: build dist
run: ./.github/workflows/make-dist.sh ${{ github.ref }}
id: dist
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.dist.outputs.archive }}
asset_name: ${{ steps.dist.outputs.archive }}
asset_content_type: application/zip
linux64-appimage:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: install prerequisites
run: sudo apt update && sudo apt install -y libglib2.0-dev ghostscript man wget libgtk2.0-dev gtk2-engines-pixbuf gtk2-engines pkg-config gnome-themes-standard
- name: configure
run: ./configure --prefix=/usr
- name: make
run: nproc && make -j$(nproc) && make
- name: make install
run: touch documentation/user-manual/manual.pdf && mkdir /tmp/dist && make install DESTDIR=/tmp/dist
- name: copy things to dist
run: |
install -d /tmp/dist/usr/lib/gtk-2.0
cp -va $(pkg-config --variable=libdir gtk+-2.0)/gtk-2.0/$(pkg-config --variable=gtk_binary_version gtk+-2.0)/* /tmp/dist/usr/lib/gtk-2.0
- name: build appimage
run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod 755 linuxdeploy-x86_64.AppImage
export VERSION=$(echo "${{ github.ref }}" | grep -Eo '[^/]+$')
./linuxdeploy-x86_64.AppImage -d contrib/dvdisaster.desktop -i contrib/dvdisaster64.png -i contrib/dvdisaster48.png -i contrib/dvdisaster32.png -i contrib/dvdisaster16.png --icon-filename dvdisaster --custom-apprun=contrib/AppRun.sh --appdir /tmp/dist/ --output appimage
- name: apply glib workaround
run: |
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod 755 appimagetool-x86_64.AppImage
exe=$(ls -1 dvdisaster*.AppImage)
chmod 755 $exe
./$exe --appimage-extract
rm -vf $exe
./appimagetool-x86_64.AppImage -v squashfs-root
mv -v dvdisaster*AppImage $exe
chmod 755 $exe
- name: test appimage
id: dist
run: |
chmod 755 dvdisaster*.AppImage && ./dvdisaster*.AppImage --version
archive=$(ls -1 dvdisaster*.AppImage)
echo "::set-output name=archive::$archive"
echo "appimage is <$archive>"
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.dist.outputs.archive }}
asset_name: ${{ steps.dist.outputs.archive }}
asset_content_type: application/zip
- uses: actions/checkout@v2
- name: install prerequisites
run: sudo apt update && sudo apt install -y libglib2.0-dev ghostscript man wget libgtk2.0-dev gtk2-engines-pixbuf gtk2-engines pkg-config gnome-themes-standard
- name: configure
run: ./configure --prefix=/usr
- name: make
run: nproc && make -j$(nproc) && make
- name: make install
run: touch documentation/user-manual/manual.pdf && mkdir /tmp/dist && make install DESTDIR=/tmp/dist
- name: copy things to dist
run: |
install -d /tmp/dist/usr/lib/gtk-2.0
cp -va $(pkg-config --variable=libdir gtk+-2.0)/gtk-2.0/$(pkg-config --variable=gtk_binary_version gtk+-2.0)/* /tmp/dist/usr/lib/gtk-2.0
- name: build appimage
run: |
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod 755 linuxdeploy-x86_64.AppImage
export VERSION=$(echo "${{ github.ref }}" | grep -Eo '[^/]+$')
./linuxdeploy-x86_64.AppImage -d contrib/dvdisaster.desktop -i contrib/dvdisaster64.png -i contrib/dvdisaster48.png -i contrib/dvdisaster32.png -i contrib/dvdisaster16.png --icon-filename dvdisaster --custom-apprun=contrib/AppRun.sh --appdir /tmp/dist/ --output appimage
- name: apply glib workaround
run: |
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod 755 appimagetool-x86_64.AppImage
exe=$(ls -1 dvdisaster*.AppImage)
chmod 755 $exe
./$exe --appimage-extract
rm -vf $exe
./appimagetool-x86_64.AppImage -v squashfs-root
mv -v dvdisaster*AppImage $exe
chmod 755 $exe
- name: test appimage
id: dist
run: |
chmod 755 dvdisaster*.AppImage && ./dvdisaster*.AppImage --version
archive=$(ls -1 dvdisaster*.AppImage)
echo "::set-output name=archive::$archive"
echo "appimage is <$archive>"
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ steps.dist.outputs.archive }}
asset_name: ${{ steps.dist.outputs.archive }}
asset_content_type: application/zip

View File

@@ -3,6 +3,53 @@ name: non-regression tests
on: [pull_request]
jobs:
mac:
runs-on: macos-latest
strategy:
matrix:
ui: [cli, gui]
printf: [fmtdbg, normal]
include:
- ui: cli
clionly: --with-gui=no
- printf: fmtdbg
debugprintf: --with-debug-printf-format
steps:
- uses: actions/checkout@v2
- name: install prerequisites
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: brew install ghostscript
- name: install prerequisites (GUI)
if: matrix.ui == 'gui'
env:
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: brew install gtk+
- name: configure
run: |
set +x
./configure ${{ matrix.clionly }} ${{ matrix.debugprintf }} --with-werror
- name: make
run: make -j$(sysctl -n hw.ncpu || 2)
- name: check executability
run: ./dvdisaster --version
- name: check executable (GUI)
if: matrix.ui == 'gui'
run: |
./dvdisaster --version
if ./dvdisaster --version | grep NOGUI; then exit 1; fi
- name: check executable (CLI)
if: matrix.ui == 'cli'
run: |
./dvdisaster --version
./dvdisaster --version | grep NOGUI
- name: prepare dist
run: ./.github/workflows/make-dist.sh ${{ github.ref }}
- name: regression tests
if: matrix.printf == 'normal'
env:
REGTEST_NO_UTF8: 1
run: mkdir /var/tmp/regtest && ./regtest/runtests.sh
win:
runs-on: windows-latest
strategy: