New app icon, packaged with a menu entry for Linux
The icon is a plate wearing headphones with a red Nordic house cookie on it. It replaces the default Godot icon, so the game window, Windows and macOS builds use it. Linux programs can't carry their own icon, so the build now also makes MusicPlayer_<version>_linux.tar.gz with the game, the icon as a PNG, a .desktop menu entry and install.sh, which installs them for the current user. The bare Linux binary is still published.
This commit is contained in:
1 parent
29b11560b5
commit
10e9e7b2a4
10 files changed
+239
-6
No files matched your search
Executable
+35
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
# Packages an exported Linux build with its icon, app menu entry and install script.
|
||||
#
|
||||
# Usage: linux/package.sh <exported binary> <version> <output dir>
|
||||
# Creates <output dir>/MusicPlayer_<version>_linux.tar.gz. Godot is taken from $GODOT,
|
||||
# or `godot` on PATH, to render the icon.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if [[ $# -ne 3 ]]; then
|
||||
echo "Usage: $0 <exported binary> <version> <output dir>" >&2
|
||||
exit 1
|
||||
fi
|
||||
binary="$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
|
||||
version="$2"
|
||||
out_dir="$(mkdir -p "$3" && cd "$3" && pwd)"
|
||||
linux_dir="$(cd "$(dirname "$0")" && pwd)"
|
||||
project_dir="$(dirname "$linux_dir")"
|
||||
godot_bin="${GODOT:-godot}"
|
||||
|
||||
staging="$(mktemp -d)"
|
||||
trap 'rm -rf "$staging"' EXIT
|
||||
package_dir="$staging/MusicPlayer"
|
||||
mkdir -p "$package_dir"
|
||||
|
||||
install -m755 "$binary" "$package_dir/MusicPlayer.x86_64"
|
||||
install -m755 "$linux_dir/install.sh" "$package_dir/install.sh"
|
||||
install -m644 "$linux_dir/music-player-randomizer.desktop" "$package_dir/"
|
||||
# Run outside the project so Godot only renders the icon
|
||||
(cd "$staging" && "$godot_bin" --headless -s "$linux_dir/render_icon.gd" -- \
|
||||
"$project_dir/icon.svg" "$package_dir/music-player-randomizer.png" 256)
|
||||
|
||||
archive="$out_dir/MusicPlayer_${version}_linux.tar.gz"
|
||||
tar -czf "$archive" -C "$staging" MusicPlayer
|
||||
echo "Created $archive"
|
||||
Reference in new issue
Block a user