From 46de51f467256ca7e030a4a40deed4589f50cc60 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 3 Jun 2021 23:39:01 +0200 Subject: [PATCH] Ports: Create launchers for the stpuzzles port This changes the .port_include.sh script so that ports can more easily create more than one launcher by making the install_launcher function available to the port's package.sh script. This creates launchers for the stpuzzles port in the Games/Puzzles category. --- Base/res/icons/SystemMenu.ini | 1 + Ports/.port_include.sh | 44 ++++++++++++++++++++++++----------- Ports/SDLPoP/package.sh | 1 - Ports/Super-Mario/package.sh | 1 - Ports/cmatrix/package.sh | 1 - Ports/openttd/package.sh | 2 -- Ports/opentyrian/package.sh | 1 - Ports/stpuzzles/package.sh | 4 ++++ 8 files changed, 35 insertions(+), 20 deletions(-) diff --git a/Base/res/icons/SystemMenu.ini b/Base/res/icons/SystemMenu.ini index 23a83badad..a3921626af 100644 --- a/Base/res/icons/SystemMenu.ini +++ b/Base/res/icons/SystemMenu.ini @@ -2,6 +2,7 @@ Demos=/res/icons/16x16/demos.png Development=/res/icons/16x16/development.png Games=/res/icons/16x16/games.png +Games/Puzzles=/res/icons/16x16/games.png Graphics=/res/icons/16x16/graphics.png Internet=/res/icons/16x16/internet.png Settings=/res/icons/16x16/settings.png diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index c944dc9c19..16d9c78ae3 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -95,29 +95,45 @@ ensure_build() { fi } -install_launcher() { - if [ -z "$launcher_name" ] || [ -z "${launcher_category}" ] || [ -z "${launcher_command}" ]; then - return +install_main_launcher() { + if [ -n "$launcher_name" ] && [ -n "$launcher_category" ] && [ -n "$launcher_command" ]; then + install_launcher "$launcher_name" "$launcher_category" "$launcher_command" fi - script_name="${launcher_name,,}" - script_name="${script_name// /}" - mkdir -p $DESTDIR/usr/local/libexec - cat >$DESTDIR/usr/local/libexec/$script_name <