Skip to content

Commit

Permalink
refactor: macOS: move capsimg.so to Resources, copy Abr directory as …
Browse files Browse the repository at this point in the history
…well

- Move capsimg.so under Resources instead of the MacOS directory
- Look for capsimg.so in the right place
- Added "abr" directory in the bundle as well
  • Loading branch information
midwan committed Nov 20, 2023
1 parent 741fd66 commit a55318e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
8 changes: 8 additions & 0 deletions macos_init_amiberry.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ for file in $CWD_VAR/../Resources/Configurations/**/*(.); do
fi
done

for file in $CWD_VAR/../Resources/Abr/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Abr${file##*/Abr}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Abr${file##*/Abr}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Abr${file##*/Abr}")
cp $file "$USERDIR/Documents/Amiberry/Abr${file##*/Abr}"
fi
done

for file in $CWD_VAR/../Resources/Controllers/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Controllers${file##*/Controllers}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Controllers${file##*/Controllers}"
Expand Down
7 changes: 3 additions & 4 deletions make-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mkdir -p Amiberry.app/Contents/Resources
# Copy executable into App bundle
cp amiberry Amiberry.app/Contents/MacOS/Amiberry
# Copy capsimg.so into App bundle
cp capsimg.so Amiberry.app/Contents/MacOS/capsimg.so
cp capsimg.so Amiberry.app/Contents/Resources/capsimg.so
# Copy init script into the bundle
cp macos_init_amiberry.zsh Amiberry.app/Contents/Resources
chmod +x Amiberry.app/Contents/Resources/macos_init_amiberry.zsh
Expand All @@ -27,7 +27,7 @@ cat Info.plist.template | sed -e "s/LONGVERSION/$LONGVER/" | sed -e "s/VERSION/$
export CODE_SIGN_ENTITLEMENTS=Entitlements.plist
codesign --entitlements=Entitlements.plist --force -s - Amiberry.app
# Copy directories into the bundle
cp -R abr Amiberry.app/Contents/Resources/abr
cp -R abr Amiberry.app/Contents/Resources/Abr
cp -R conf Amiberry.app/Contents/Resources/Configurations
cp -R controllers Amiberry.app/Contents/Resources/Controllers
cp -R data Amiberry.app/Contents/Resources/Data
Expand All @@ -39,8 +39,7 @@ cp -R screenshots Amiberry.app/Contents/Resources/Screenshots
cp -R whdboot Amiberry.app/Contents/Resources/Whdboot

# Overwrite default conf with OSX specific one
mkdir Amiberry.app/Contents/Resources/conf
cat conf/amiberry-osx.conf | sed -e "s#USERDIR#$USERDIR#g" >Amiberry.app/Contents/Resources/conf/amiberry.conf
cat conf/amiberry-osx.conf | sed -e "s#USERDIR#$USERDIR#g" >Amiberry.app/Contents/Resources/Configurations/amiberry.conf
# Use dylibbundler to install into app if exists
dylibbundler -od -b -x Amiberry.app/Contents/MacOS/Amiberry -d Amiberry.app/Contents/libs/ -s external/libguisan/dylib/
if [ $? -gt 0 ]; then
Expand Down
2 changes: 1 addition & 1 deletion src/dlopen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ UAE_DLHANDLE uae_dlopen_plugin(const TCHAR *name)
directory = directory.substr(0, last_slash_idx);
}
}
UAE_DLHANDLE handle = uae_dlopen(directory.append("/MacOS/capsimg.so").c_str());
UAE_DLHANDLE handle = uae_dlopen(directory.append("/Resources/capsimg.so").c_str());
#else
UAE_DLHANDLE handle = uae_dlopen("./capsimg.so");
#endif // __MACH__
Expand Down

0 comments on commit a55318e

Please sign in to comment.