amiberry/make-bundle.sh
Dimitris Panokostas 40e73ea8ae
1440 create home directories on startup (#1443)
* build: move gamecontrollerdb.txt to controllers directory

* enhancement: create home directories if they don't exist

- After the directories have been decided (data, home, config), create those in the specified HOME directory, if they don't exist
- If they didn't exist, and we had the original contents installed in /usr/share/amiberry/<dir>, copy those over and change permissions. This ensures that the distributed files like the AROS ROMs, the WHDLoad booter and the controllerdb files, are always there in the home dir.

* chore: we no longer need to copy all the directories in the package

Now that we create the home directories on startup, we don't need the empty ones in the package anymore.
Only those that contain something can stay

* build: add stripping of binaries

* chore: ignore .idea folder

* bugfix: WHDLoad booter A1200 config was incorrect

After the additional entries in A1200 configs and models, the booter was set to incorrectly use a config with a Blizzard accelerator. Since that requires a board ROM, which might not be available, it has to change.

Using the default A1200 config instead, and setting Fast RAM to 8MB after that.

* build: install icon in shared location

When preparing the .deb package, the application icon should go in the /usr/share/icons/hicolor/... location, to adhere with established standards

* build: use ~/Amiberry instead of ~/.amiberry

Perhaps it's best to use a non-hidden folder for amiberry directories, make it easier on the users to find it

* refactor: use ~/Amiberry/conf instead of ~/.config/amiberry for config files

* refactor: change desktop file icon reference

Should be possible to use just "amiberry" now, that the icon file is copied in the right location

* chore: fix references to github.com/midwan -> github.com/BlitterStudio

* refactor: move plugins dir to /usr/lib/amiberry in the .deb package

If we are using a system-wide installation, with the .deb package, use /usr/lib/amiberry for plugins.
Check the HOME/Amiberry/plugins next, create it if necessary.
Fallback to the startup directory if that's not available (probably never).

* refactor: only move the abr folder in the destination plugins

When using the .deb package, only the abr folder should be copied in the destination.
Otherwise, we get a plugins directory created there as well

* refactor: Change Kickstarts to Roms

The Kickstarts directory can contain different kind of ROMs, not only kickstarts.
It's best if we rename it accordingly

* build: CPack updates

- Removed unneeded line
- added CPACK_DEBIAN_PACKAGE_ARCHITECTURE
- Added Extended Description
- Fixed description starts with package name

* ci: rename architectures properly

Let's keep the names identical to what dpkg reports

* build: fix some lintian errors

- location of plugins
- section

* build: added copyright and changelog in DEB

* build: fix location of debian files

* build: add copyright notice, fix changelog

* build: changelog should be compressed

* build: extend the description

* build: make the description lines shorter...

* build: description should not be longer than 80 chars

* build: remove timestamp from changelog

Fix another lintian complaint

* build: description again

* bugfix: the plugins dir was not correctly set

* refactor: Updated desktop entry to handle MimeTypes

* build: remove duplicate key in desktop file

* build: add more mimetypes to desktop file
2024-09-28 09:54:50 +02:00

47 lines
2.2 KiB
Bash

#!/usr/bin/env sh
USERDIR=`echo ~`
LONGVER=`cat src/osdep/target.h | grep AMIBERRYVERSION | awk -F '_T\\\(\\\"' '{print $2}' | awk -F '\\\"' '{printf $1}'`
VERSION=`echo $LONGVER | awk -F v '{printf $2}' | awk '{print $1}'`
MAJOR=`echo $VERSION | awk -F . '{printf $1}' | sed 's/[^0-9]*//g'`
MINOR=`echo $VERSION | awk -F . '{printf $2}' | sed 's/[^0-9]*//g'`
echo "Removing old App directory"
rm -Rf Amiberry.app
echo "Creating App directory"
# Make directory for App bundle
mkdir -p Amiberry.app/Contents/MacOS
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 plugin libs into App bundle
cp plugins/*.so Amiberry.app/Contents/Resources/
# 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
# Copy parameter list into the bundle
cat Info.plist.template | sed -e "s/LONGVERSION/$LONGVER/" | sed -e "s/VERSION/$VERSION/" | sed -e "s/MAJOR/$MAJOR/" | sed -e "s/MINOR/$MINOR/" > Amiberry.app/Contents/Info.plist
# Self-sign binary
export CODE_SIGN_ENTITLEMENTS=Entitlements.plist
codesign --entitlements=Entitlements.plist --force -s - Amiberry.app
# Copy directories into the bundle
cp -R cdroms Amiberry.app/Contents/Resources/Cdroms
cp -R conf Amiberry.app/Contents/Resources/Configurations
cp -R controllers Amiberry.app/Contents/Resources/Controllers
cp -R data Amiberry.app/Contents/Resources/Data
cp -R floppies Amiberry.app/Contents/Resources/Floppies
cp -R harddrives Amiberry.app/Contents/Resources/Harddrives
cp -R inputrecordings Amiberry.app/Contents/Resources/Inputrecordings
cp -R roms Amiberry.app/Contents/Resources/Roms
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
# Overwrite default conf with OSX specific one
cat conf/amiberry-osx.conf | sed -e "s#USERDIR#$USERDIR#g" >Amiberry.app/Contents/Resources/Configurations/amiberry.conf