mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
Ports: Add launchers for some of the ports
This commit is contained in:
parent
1e5a7ca0a7
commit
e72235b981
Notes:
sideshowbarker
2024-07-18 19:12:11 +09:00
Author: https://github.com/gunnarbeutner Commit: https://github.com/SerenityOS/serenity/commit/e72235b9812 Pull-request: https://github.com/SerenityOS/serenity/pull/6544 Reviewed-by: https://github.com/emanuele6
9 changed files with 57 additions and 5 deletions
|
@ -68,6 +68,9 @@ shift
|
||||||
: "${auth_type:=md5}"
|
: "${auth_type:=md5}"
|
||||||
: "${auth_import_key:=}"
|
: "${auth_import_key:=}"
|
||||||
: "${auth_opts:=}"
|
: "${auth_opts:=}"
|
||||||
|
: "${launcher_name:=}"
|
||||||
|
: "${launcher_category:=}"
|
||||||
|
: "${launcher_command:=}"
|
||||||
|
|
||||||
run_nocd() {
|
run_nocd() {
|
||||||
echo "+ $@ (nocd)"
|
echo "+ $@ (nocd)"
|
||||||
|
@ -77,9 +80,34 @@ run() {
|
||||||
echo "+ $@"
|
echo "+ $@"
|
||||||
(cd "$workdir" && "$@")
|
(cd "$workdir" && "$@")
|
||||||
}
|
}
|
||||||
run_replace_in_file(){
|
run_replace_in_file() {
|
||||||
run perl -p -i -e "$1" $2
|
run perl -p -i -e "$1" $2
|
||||||
}
|
}
|
||||||
|
install_launcher() {
|
||||||
|
if [ -z "$launcher_name" ] || [ -z "${launcher_category}" ] || [ -z "${launcher_command}" ]; then
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
script_name="${launcher_name,,}"
|
||||||
|
script_name="${script_name// /}"
|
||||||
|
mkdir -p $DESTDIR/usr/local/libexec
|
||||||
|
cat >$DESTDIR/usr/local/libexec/$script_name <<SCRIPT
|
||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
cd -- "\$(dirname -- "\$(which -- $(printf %q "${launcher_command%% *}"))")"
|
||||||
|
exec $(printf '%q ' $launcher_command)
|
||||||
|
SCRIPT
|
||||||
|
chmod +x $DESTDIR/usr/local/libexec/$script_name
|
||||||
|
|
||||||
|
chmod +x $DESTDIR/usr/local/libexec
|
||||||
|
mkdir -p $DESTDIR/res/apps
|
||||||
|
cat >$DESTDIR/res/apps/$script_name.af <<CONFIG
|
||||||
|
[App]
|
||||||
|
Name=$launcher_name
|
||||||
|
Executable=/usr/local/libexec/$script_name
|
||||||
|
Category=$launcher_category
|
||||||
|
CONFIG
|
||||||
|
unset script_name
|
||||||
|
}
|
||||||
# Checks if a function is defined. In this case, if the function is not defined in the port's script, then we will use our defaults. This way, ports don't need to include these functions every time, but they can override our defaults if needed.
|
# Checks if a function is defined. In this case, if the function is not defined in the port's script, then we will use our defaults. This way, ports don't need to include these functions every time, but they can override our defaults if needed.
|
||||||
func_defined() {
|
func_defined() {
|
||||||
PATH= command -V "$1" > /dev/null 2>&1
|
PATH= command -V "$1" > /dev/null 2>&1
|
||||||
|
@ -219,6 +247,7 @@ func_defined build || build() {
|
||||||
}
|
}
|
||||||
func_defined install || install() {
|
func_defined install || install() {
|
||||||
run make DESTDIR=$DESTDIR $installopts install
|
run make DESTDIR=$DESTDIR $installopts install
|
||||||
|
install_launcher
|
||||||
}
|
}
|
||||||
func_defined post_install || post_install() {
|
func_defined post_install || post_install() {
|
||||||
echo
|
echo
|
||||||
|
|
|
@ -7,6 +7,9 @@ workdir=SDLPoP-86988c668eeaa10f218e1d4938fc5b4e42314d68
|
||||||
configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt"
|
configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt"
|
||||||
files="https://github.com/NagyD/SDLPoP/archive/86988c668eeaa10f218e1d4938fc5b4e42314d68.zip PoP.zip d18cae8541fb8cbcc374fd998316993d561429a83f92061bc0754337ada774c5"
|
files="https://github.com/NagyD/SDLPoP/archive/86988c668eeaa10f218e1d4938fc5b4e42314d68.zip PoP.zip d18cae8541fb8cbcc374fd998316993d561429a83f92061bc0754337ada774c5"
|
||||||
auth_type=sha256
|
auth_type=sha256
|
||||||
|
launcher_name="Prince of Persia"
|
||||||
|
launcher_category=Games
|
||||||
|
launcher_command=/opt/PrinceOfPersia/prince
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
run cmake $configopts ./src
|
run cmake $configopts ./src
|
||||||
|
@ -15,4 +18,5 @@ configure() {
|
||||||
install() {
|
install() {
|
||||||
mkdir -p "${SERENITY_INSTALL_ROOT}/opt/PrinceOfPersia"
|
mkdir -p "${SERENITY_INSTALL_ROOT}/opt/PrinceOfPersia"
|
||||||
run cp -r prince data SDLPoP.ini "${SERENITY_INSTALL_ROOT}/opt/PrinceOfPersia"
|
run cp -r prince data SDLPoP.ini "${SERENITY_INSTALL_ROOT}/opt/PrinceOfPersia"
|
||||||
|
install_launcher
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,9 @@ workdir=Super-Mario-Clone-Cpp-master
|
||||||
configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt"
|
configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt"
|
||||||
files="https://github.com/Bennyhwanggggg/Super-Mario-Clone-Cpp/archive/refs/heads/master.zip master.zip 11f622721d1ba504acf75c024aa0dbe3"
|
files="https://github.com/Bennyhwanggggg/Super-Mario-Clone-Cpp/archive/refs/heads/master.zip master.zip 11f622721d1ba504acf75c024aa0dbe3"
|
||||||
auth_type=md5
|
auth_type=md5
|
||||||
|
launcher_name="Super Mario"
|
||||||
|
launcher_category=Games
|
||||||
|
launcher_command=/opt/Super_Mario/uMario
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
run cmake $configopts
|
run cmake $configopts
|
||||||
|
@ -15,4 +18,5 @@ configure() {
|
||||||
install() {
|
install() {
|
||||||
run mkdir -p "${SERENITY_INSTALL_ROOT}/opt/Super_Mario"
|
run mkdir -p "${SERENITY_INSTALL_ROOT}/opt/Super_Mario"
|
||||||
run cp -r uMario app.ico icon2.ico files "${SERENITY_INSTALL_ROOT}/opt/Super_Mario"
|
run cp -r uMario app.ico icon2.ico files "${SERENITY_INSTALL_ROOT}/opt/Super_Mario"
|
||||||
|
install_launcher
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,9 @@ workdir=cmatrix-master
|
||||||
configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt"
|
configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt"
|
||||||
files="https://github.com/abishekvashok/cmatrix/archive/refs/heads/master.zip cmatrix.zip 2541321b89149b375d5732402e52d654"
|
files="https://github.com/abishekvashok/cmatrix/archive/refs/heads/master.zip cmatrix.zip 2541321b89149b375d5732402e52d654"
|
||||||
auth_type=md5
|
auth_type=md5
|
||||||
|
launcher_name=cmatrix
|
||||||
|
launcher_category=Games
|
||||||
|
launcher_command="Terminal -e cmatrix"
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
run cmake $configopts
|
run cmake $configopts
|
||||||
|
@ -14,4 +17,5 @@ configure() {
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
run cp cmatrix "${SERENITY_INSTALL_ROOT}/bin"
|
run cp cmatrix "${SERENITY_INSTALL_ROOT}/bin"
|
||||||
|
install_launcher
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,3 +6,6 @@ files="https://github.com/SerenityOS/SerenityDOOM/archive/master.tar.gz doom-git
|
||||||
auth_type=md5
|
auth_type=md5
|
||||||
makeopts="-C doomgeneric/"
|
makeopts="-C doomgeneric/"
|
||||||
installopts="-C doomgeneric/"
|
installopts="-C doomgeneric/"
|
||||||
|
launcher_name=Doom
|
||||||
|
launcher_category=Games
|
||||||
|
launcher_command=doom
|
||||||
|
|
|
@ -8,11 +8,10 @@ workdir="${port}-${commit}"
|
||||||
configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt"
|
configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_SOURCE_DIR/Toolchain/CMake/CMakeToolchain.txt"
|
||||||
files="https://github.com/hatari/hatari/archive/${commit}.tar.gz ${commit}.tar.gz 614d8c20a06deea6df464a5de32cc795"
|
files="https://github.com/hatari/hatari/archive/${commit}.tar.gz ${commit}.tar.gz 614d8c20a06deea6df464a5de32cc795"
|
||||||
auth_type=md5
|
auth_type=md5
|
||||||
|
launcher_name=Hatari
|
||||||
|
launcher_category=Games
|
||||||
|
launcher_command=hatari
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
run cmake $configopts
|
run cmake $configopts
|
||||||
}
|
}
|
||||||
|
|
||||||
install() {
|
|
||||||
run make install
|
|
||||||
}
|
|
||||||
|
|
|
@ -4,3 +4,6 @@ version=git
|
||||||
workdir=nyancat-master
|
workdir=nyancat-master
|
||||||
files="https://github.com/klange/nyancat/archive/master.tar.gz nyancat-git.tar.gz dcb9dc135f87a4e5e0e6e72e6c3b2430"
|
files="https://github.com/klange/nyancat/archive/master.tar.gz nyancat-git.tar.gz dcb9dc135f87a4e5e0e6e72e6c3b2430"
|
||||||
auth_type=md5
|
auth_type=md5
|
||||||
|
launcher_name=Nyancat
|
||||||
|
launcher_category=Games
|
||||||
|
launcher_command="Terminal -e nyancat"
|
||||||
|
|
|
@ -6,6 +6,9 @@ useconfigure=false
|
||||||
files="https://github.com/SerenityOS/SerenityQuake/archive/master.tar.gz quake.tar.gz"
|
files="https://github.com/SerenityOS/SerenityQuake/archive/master.tar.gz quake.tar.gz"
|
||||||
makeopts="V=1 SYMBOLS_ON=Y "
|
makeopts="V=1 SYMBOLS_ON=Y "
|
||||||
depends=SDL2
|
depends=SDL2
|
||||||
|
launcher_name=Quake
|
||||||
|
launcher_category=Games
|
||||||
|
launcher_command=quake
|
||||||
|
|
||||||
# FIXME: Uhh, the things in this directory are not supposed to run on the host, why add this to $PATH?!
|
# FIXME: Uhh, the things in this directory are not supposed to run on the host, why add this to $PATH?!
|
||||||
export PATH="${SERENITY_INSTALL_ROOT}/usr/bin:${PATH}"
|
export PATH="${SERENITY_INSTALL_ROOT}/usr/bin:${PATH}"
|
||||||
|
|
|
@ -5,6 +5,9 @@ version="0.59.1"
|
||||||
files="https://github.com/vicgeralds/vitetris/archive/refs/tags/v${version}.tar.gz vitetris.tar.gz 699443df03c8d4bf2051838c1015da72039bbbdd0ab0eede891c59c840bdf58d"
|
files="https://github.com/vicgeralds/vitetris/archive/refs/tags/v${version}.tar.gz vitetris.tar.gz 699443df03c8d4bf2051838c1015da72039bbbdd0ab0eede891c59c840bdf58d"
|
||||||
configopts="--without-xlib --without-joystick --without-network"
|
configopts="--without-xlib --without-joystick --without-network"
|
||||||
auth_type=sha256
|
auth_type=sha256
|
||||||
|
launcher_name=vitetris
|
||||||
|
launcher_category=Games
|
||||||
|
launcher_command="Terminal -e tetris"
|
||||||
|
|
||||||
configure() {
|
configure() {
|
||||||
run chmod +x "$configscript"
|
run chmod +x "$configscript"
|
||||||
|
|
Loading…
Reference in a new issue