diff --git a/README.md b/README.md index 7f8b953..c5cc3c3 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,17 @@ pacman -S games/elden.ring # Install a game pacman -R games/elden.ring # Remove a game ``` +You can also download the packages yourself and install with: +```sh +pacman -U ./pkg.file.tar.gz.zst +``` + +Since the package files can become very big for games and pacman might not handle it always, you could add the following the `pacman.conf` + +``` +XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +``` + ## Package Format Each game package should contain: - **Game Icons** → `/usr/share/icons/` @@ -35,3 +46,4 @@ Game names should be formatted by replacing spaces with dots (e.g., `Game Title` See the `examples/` directory for a minimal build template to package games. - [Windows Games](./examples/wine/) +- [PlayStation 3](./examples/ps3/) diff --git a/create_ps3.py b/create_ps3.py new file mode 100644 index 0000000..3e74393 --- /dev/null +++ b/create_ps3.py @@ -0,0 +1,60 @@ +#!/usr/bin/python +import sys +import os + +def main(): + if len(sys.argv) < 3: + print("Usage: script.py ") + sys.exit(1) + + out_path = sys.argv[1] + game_title = sys.argv[2] + game_desc = input("Enter game description: ") + + safe_game_title = game_title.replace(" ", ".").lower() + + print("Creating pkg structure") + root = os.path.join(out_path, "root") + os.makedirs(root, exist_ok=True) + + os.makedirs( + os.path.join(root, "games", "rom", "ps3", safe_game_title) + , + exist_ok=True + ) + os.makedirs( + os.path.join(root, "usr", "share", "icons", safe_game_title) + , + exist_ok=True + ) + + os.makedirs( + os.path.join(root, "usr", "share", "applications") + , + exist_ok=True + ) + + open( + os.path.join(root, "usr", "share", "applications", f"{game_title}.desktop"), + "w" + ).write( + open("./examples/ps3/root/usr/share/applications/Game Title.desktop").read() + .replace("", game_title) + .replace("", game_desc) + .replace("game.title", safe_game_title) + ) + + open( + os.path.join(out_path, "PKGBUILD"), + "w" + ).write( + open("./examples/ps3/PKGBUILD").read() + .replace("", game_desc) + .replace("game.title", safe_game_title) + ) + + + + +if __name__ == "__main__": + main() diff --git a/create_wine.py b/create_wine.py new file mode 100644 index 0000000..9cb925f --- /dev/null +++ b/create_wine.py @@ -0,0 +1,60 @@ +#!/usr/bin/python +import sys +import os + +def main(): + if len(sys.argv) < 3: + print("Usage: script.py ") + sys.exit(1) + + out_path = sys.argv[1] + game_title = sys.argv[2] + game_desc = input("Enter game description: ") + + safe_game_title = game_title.replace(" ", ".").lower() + + print("Creating pkg structure") + root = os.path.join(out_path, "root") + os.makedirs(root, exist_ok=True) + + os.makedirs( + os.path.join(root, "games", safe_game_title) + , + exist_ok=True + ) + os.makedirs( + os.path.join(root, "usr", "share", "icons", safe_game_title) + , + exist_ok=True + ) + + os.makedirs( + os.path.join(root, "usr", "share", "applications") + , + exist_ok=True + ) + + open( + os.path.join(root, "usr", "share", "applications", f"{game_title}.desktop"), + "w" + ).write( + open("./examples/wine/root/usr/share/applications/Game Title.desktop").read() + .replace("", game_title) + .replace("", game_desc) + .replace("game.title", safe_game_title) + ) + + open( + os.path.join(out_path, "PKGBUILD"), + "w" + ).write( + open("./examples/wine/PKGBUILD").read() + .replace("", game_desc) + .replace("game.title", safe_game_title) + ) + + + + +if __name__ == "__main__": + main() diff --git a/examples/ps3/PKGBUILD b/examples/ps3/PKGBUILD new file mode 100644 index 0000000..ee2164f --- /dev/null +++ b/examples/ps3/PKGBUILD @@ -0,0 +1,12 @@ +pkgname=game.title +pkgver=1.0 +pkgrel=1 +pkgdesc="" +arch=('x86_64') +depends=('rpcs3') +source=() +sha256sums=() + +package() { + rsync -vzr ../root/ "$pkgdir/" +} diff --git a/examples/ps3/root/games/rom/ps3/game.title/CONTENT b/examples/ps3/root/games/rom/ps3/game.title/CONTENT new file mode 100644 index 0000000..6ecbd78 --- /dev/null +++ b/examples/ps3/root/games/rom/ps3/game.title/CONTENT @@ -0,0 +1 @@ +GAME CONTENT \ No newline at end of file diff --git a/examples/ps3/root/usr/share/applications/Game Title.desktop b/examples/ps3/root/usr/share/applications/Game Title.desktop new file mode 100644 index 0000000..19b41aa --- /dev/null +++ b/examples/ps3/root/usr/share/applications/Game Title.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name= +Comment= +Exec=rpcs3 --no-gui --fullscreen "/games/rom/ps3/game.title/PS3_GAME" +Icon=/usr/share/icons/game.title/icon1.ico +StartupNotify=true +Terminal=false +Type=Application +Categories=Game; diff --git a/examples/ps3/root/usr/share/icons/game.title/CONTENT b/examples/ps3/root/usr/share/icons/game.title/CONTENT new file mode 100644 index 0000000..6ecbd78 --- /dev/null +++ b/examples/ps3/root/usr/share/icons/game.title/CONTENT @@ -0,0 +1 @@ +GAME CONTENT \ No newline at end of file diff --git a/examples/wine/PKGBUILD b/examples/wine/PKGBUILD index 16904f5..90bc582 100644 --- a/examples/wine/PKGBUILD +++ b/examples/wine/PKGBUILD @@ -8,5 +8,5 @@ source=() sha256sums=() package() { - rsync -vzr ./root/ "$pkgdir/" + rsync -vzr ../root/ "$pkgdir/" } diff --git a/examples/wine/root/usr/share/applications/Game Title.desktop b/examples/wine/root/usr/share/applications/Game Title.desktop index 5fc5784..bf16d5e 100644 --- a/examples/wine/root/usr/share/applications/Game Title.desktop +++ b/examples/wine/root/usr/share/applications/Game Title.desktop @@ -1,8 +1,8 @@ [Desktop Entry] Name= Comment= -Exec=env WINEPREFIX="$HOME/Games/umu/game.title" STEAM_COMPAT_LIBRARY_PATHS="/games" bash -c "umu-run /games/game.title/_Redist/vc_redist.x64.exe /Install /Quiet && umu-run /games/game.title/_Redist/vc_redist.x86.exe /Install /Quiet && umu-run /games/game.title/game.exe" -Icon=/usr/share/icons/game.title/icon.png +Exec=env WINEPREFIX="$HOME/Games/umu/game.title" STEAM_COMPAT_LIBRARY_PATHS="/games" bash -c "cd /games/game.title && umu-run /games/game.title/_Redist/vc_redist.x64.exe /Install /Quiet && umu-run /games/game.title/_Redist/vc_redist.x86.exe /Install /Quiet && umu-run /games/game.title/game.exe" +Icon=/usr/share/icons/game.title/icon1.ico StartupNotify=true Terminal=false Type=Application