I tried using the "stable" daily build, and indeed it doesn't work. I think the implementation may be incomplete in branch-2-7. I will need to check this. But it worked as expected using the "latest" daily build, which is good news.
Here are the steps I used to create a bundle that automatically starts Beneath a Steel Sky:
1. Download a ScummVM "latest" (not "stable") daily build for macOS
Files downloaded from the internet are quarantined by macOS. This can be cleared by starting the application once using a right mouse button click on ScummVM.app and select
Open.
But this can also be cleared with the following command from a terminal:
Code: Select all
xattr -d -r com.apple.quarantine ScummVM.app
2. Download Beneath a Steel Sky from https://www.scummvm.org/games/
Unzip, clear quantile and macl matter, rename the folder to "game" and move it to ScummVM.app/Content/Resources/
Code: Select all
unzip bass-cd-1.2.zip
xattr -c bass-cd-1.2
mv bass-cd-1.2 ScummVM.app/Contents/Resources/game
The
ScummVM.app/Contents/Resources/game/ folder now contains the following files:
Code: Select all
readme.txt sky.cpt sky.dnr sky.dsk
3. Add default settings (optional)
This could be done using a
scummvm-autorun file to specify command line arguments, but I used a scummvm.ini file instead.
The main difference between the two options, is that the command line arguments specified in
scummvm-autorun are used every time the app is started and overwrite any settings saved. The
scummvm.ini file on the other hand is only used on the first start to provide the initial settings. But if the user then changes the settings (e.g. to toggle off fullscreen), this gets saved.
Code: Select all
echo "[scummvm]" > ScummVM.app/Contents/Resources/scummvm.ini
echo "fullscreen=true" >> ScummVM.app/Contents/Resources/scummvm.ini
echo "shader=crt/crt-lottes.glslp" >> ScummVM.app/Contents/Resources/scummvm.ini
echo "updates_check=0" >> ScummVM.app/Contents/Resources/scummvm.ini
The commands above result in a scummvm.ini that contains:
scummvm.ini wrote:
[scummvm]
fullscreen=true
shader=crt/crt-lottes.glslp
updates_check=0
4. Create custom icon (optional)
Download sky-sky.png icon from
https://github.com/scummvm/scummvm-icon ... ster/icons
I wrote a script to automate the creation of an icon file from a png file (see below). It can be used as follow togenerate a bass.icns from the
sky-sky.png file.
Move the icon to bundle
Code: Select all
mv bass.icns ScummVM.app/Contents/Resources/
Edit icon name in the
Info.plist
Code: Select all
sed -i '' 's|scummvm.icns|bass.icns|' ScummVM.app/Contents/Info.plist
(or open ScummVM.app/Contents/Info.plist and edit manually)
Note that it takes a bit of time for macOS to refresh the app icon in Finder.
The
create_icns.sh script is:
Code: Select all
#!/bin/bash
if [ $# -ne 2 ]; then
echo "Usage: $0 <png file> <output name>"
echo "Example: $0 sky-sky.png bass"
exit 1
fi
input=$1
output=$2
echo "Generating $output.icns from $input..."
iconset_dir=${output}.iconset
if [ ! -d $iconset_dir ] ; then
mkdir $iconset_dir
fi
for size in 16 32 128 256 512 ; do
sips -z $size $size $input --out $iconset_dir/icon_${size}x${size}.png > /dev/null
done
for size in 32 64 256 512 1024 ; do
sips -z $size $size $input --out $iconset_dir/icon_${size}x${size}@2x.png > /dev/null
done
iconutil -c icns $iconset_dir
rm -r $iconset_dir
5. Change the bundle name, bundle display name, and bundle identifiers (optional)
In particular, the bundle name defined in the Info.plist is used to name the preference file. So changing it means that our game bundle will have its own set of settings instead of sharing settings with other ScummVM games.
You again need to edit the
ScummVM.app/Contents/Info.plist, for example using the following commands:
Code: Select all
sed -i '' 's|org.scummvm.scummvm|org.scummvm.bass|' ScummVM.app/Contents/Info.plist
sed -i '' 's|<string>ScummVM</string>|<string>BASS</string>|' ScummVM.app/Contents/Info.plist
6. Regenerate the ad hoc signature
Code: Select all
codesign -s - --deep --force ScummVM.app
7. Rename ScummVM.app (optional)
I have uploaded the resulting BASS application for mac M1 to my dropbox:
https://www.dropbox.com/s/cpkzybub4npc9 ... 5.zip?dl=0
For now I will keep it there as it is using a daily build and only works on M1 macs, but it is indeed a good idea to have an example available from our web site. I will try to prepare one at the same time I build the macOS ScummVM package for the next release.
It is also probably a good time to mention that as part of this year's Google Summer of Code, we have got a contributor working on an automated system for packaging games with ScummVM. So hopefully this will make the whole process easier for users. You can follow his progress on
https://blogs.scummvm.org/ankushdutt/