refactor: Use "Plugins" directory for macOS

This commit is contained in:
Dimitris Panokostas 2024-05-27 18:45:20 +02:00
parent 0a67ebb7f3
commit 9ee35b26b4
No known key found for this signature in database
GPG Key ID: 330156A68E9E0929
4 changed files with 13 additions and 9 deletions

View File

@ -20,7 +20,7 @@
<key>CFBundleShortVersionString</key>
<string>VERSION</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<string>6.3</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>IFMajorVersion</key>

View File

@ -115,6 +115,14 @@ for file in $CWD_VAR/../Resources/Nvram/**/*(.); do
fi
done
for file in $CWD_VAR/../Resources/Plugins/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Plugins{file##*/Plugins}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Plugins{file##*/Plugins}"
mkdir -p $(dirname "$USERDIR/Documents/Amiberry/Plugins{file##*/Plugins}")
cp $file "$USERDIR/Documents/Amiberry/Plugins{file##*/Plugins}"
fi
done
for file in $CWD_VAR/../Resources/Whdboot/**/*(.); do
if [[ ! -f "$USERDIR/Documents/Amiberry/Whdboot${file##*/Whdboot}" ]]; then
echo "Copying $file to $USERDIR/Documents/Amiberry/Whdboot${file##*/Whdboot}"

View File

@ -16,10 +16,6 @@ mkdir -p Amiberry.app/Contents/Frameworks
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 plugins/capsimg.so Amiberry.app/Contents/Resources/capsimg.so
# Copy floppybridge lib into App bundle
cp plugins/libfloppybridge.so Amiberry.app/Contents/Resources/libfloppybridge.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
@ -40,6 +36,7 @@ cp -R inputrecordings Amiberry.app/Contents/Resources/Inputrecordings
cp -R kickstarts Amiberry.app/Contents/Resources/Kickstarts
cp -R lha Amiberry.app/Contents/Resources/Lha
cp -R nvram Amiberry.app/Contents/Resources/Nvram
cp -R plugins Amiberry.app/Contents/Resources/Plugins
cp -R savestates Amiberry.app/Contents/Resources/Savestates
cp -R screenshots Amiberry.app/Contents/Resources/Screenshots
cp -R whdboot Amiberry.app/Contents/Resources/Whdboot

View File

@ -3970,8 +3970,7 @@ static void init_amiberry_paths(void)
}
config_path = controllers_path = data_dir = whdboot_path = whdload_arch_path = floppy_path = harddrive_path = cdrom_path =
logfile_path = rom_path = rp9_path = saveimage_dir = savestate_dir = ripper_path =
input_dir = screenshot_dir = nvram_dir = video_dir = macos_amiberry_directory;
plugins_dir = start_path_data;
input_dir = screenshot_dir = nvram_dir = plugins_dir = video_dir = macos_amiberry_directory;
config_path.append("/Configurations/");
controllers_path.append("/Controllers/");
@ -3990,6 +3989,7 @@ static void init_amiberry_paths(void)
input_dir.append("/Inputrecordings/");
screenshot_dir.append("/Screenshots/");
nvram_dir.append("/Nvram/");
plugins_dir.append("/Plugins/");
video_dir.append("/Videos/");
#else
config_path = controllers_path = data_dir = whdboot_path = whdload_arch_path = floppy_path = harddrive_path = cdrom_path =
@ -4120,8 +4120,7 @@ const TCHAR** uaenative_get_library_dirs(void)
nats = xcalloc(const TCHAR*, 3);
if (path == NULL) {
path = xcalloc(TCHAR, MAX_DPATH);
_tcscpy(path, start_path_data.c_str());
_tcscat(path, _T("plugins"));
_tcscpy(path, plugins_dir.c_str());
}
nats[0] = start_path_data.c_str();
nats[1] = path;