[PATCH 2/2] gnu: Add ps1 homebrew development kit

  • Open
  • quality assurance status badge
Details
2 participants
  • Liliana Marie Prikler
  • manolis837
Owner
unassigned
Submitted by
manolis837
Severity
normal
M
M
manolis837 wrote on 15 Sep 21:03 +0200
(address . guix-patches@gnu.org)(name . Manolis Ragkousis)(address . manolis837@gmail.com)
2cc2ac1f520e35433ac87183afad2ceebdc01f0e.1726426231.git.manolis837@gmail.com
From: Manolis Ragkousis <manolis837@gmail.com>

* gnu/packages/game-development.scm (miniaudio): New variable.
(miniaudio-0.10.43): New variable.
(gulrak-filesystem): New variable.
(ThreadPool): New variable.
(mkpsxiso): New variable.
(psn00bsdk): New variable.

Change-Id: I96cbfa6bb91ed90b183297cc3118bb9411e11705
---
gnu/packages/game-development.scm | 249 +++++++++++++++++++++++++++++-
1 file changed, 248 insertions(+), 1 deletion(-)

Toggle diff (280 lines)
diff --git a/gnu/packages/game-development.scm b/gnu/packages/game-development.scm
index efbbabaaf5..af5d2506d9 100644
--- a/gnu/packages/game-development.scm
+++ b/gnu/packages/game-development.scm
@@ -9,7 +9,7 @@
;;; Copyright © 2016, 2018, 2019, 2024 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2016, 2017, 2018 Julian Graham <joolean@gmail.com>
;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
-;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
+;;; Copyright © 2017, 2024 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
;;; Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
;;; Copyright © 2017, 2019 Rutger Helling <rhelling@mykolab.com>
@@ -75,6 +75,7 @@ (define-module (gnu packages game-development)
#:use-module (gnu packages check)
#:use-module (gnu packages curl)
#:use-module (gnu packages documentation)
+ #:use-module (gnu packages embedded)
#:use-module (gnu packages fltk)
#:use-module (gnu packages fonts)
#:use-module (gnu packages fontutils)
@@ -82,6 +83,7 @@ (define-module (gnu packages game-development)
#:use-module (gnu packages fribidi)
#:use-module (gnu packages dbm)
#:use-module (gnu packages gawk)
+ #:use-module (gnu packages gcc)
#:use-module (gnu packages gettext)
#:use-module (gnu packages gl)
#:use-module (gnu packages glib)
@@ -3382,3 +3384,248 @@ (define-public bbcsdl
allowing you to write utilities and games, use sound and graphics, perform
calculations and create complete applications.")
(license license:zlib)))
+
+(define-public miniaudio
+ (package
+ (name "miniaudio")
+ (version "0.11.21")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mackron/miniaudio")
+ (commit version)
+ (recursive? #f)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0hlqp44ifi3vswvfpqljj89321y6yz3zq6rng51wfq8p4n9k5qhh"))))
+ (build-system copy-build-system)
+ (arguments
+ (list #:tests? #f))
+ (synopsis "Audio playback and capture library for C and C++")
+ (description
+ "Miniaudio is a lightweight, single-file audio playback and capture
+library designed for use in C and C++ applications. It features no external
+dependencies, making it highly portable and easy to integrate.")
+ (home-page "https://miniaud.io/")
+ (license license:expat-0)))
+
+(define-public miniaudio-0.10.43
+ (package (inherit miniaudio)
+ (name "miniaudio")
+ (version "0.10.43")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mackron/miniaudio")
+ (commit "8686f52e6625e562f4756b946696692c016324ab")
+ (recursive? #f)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0lv5gq23rspa3s9yqr3lhrfvbz63zcnkbxngsl2bgvj79x49vw9a"))))))
+
+(define-public gulrak-filesystem
+ (package
+ (name "gulrak-filesystem")
+ (version "v1.5.14")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/gulrak/filesystem")
+ (commit version)
+ (recursive? #f)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0n1w2q0fp31z2l7g16ysc5nwyhmy3rj3hb89ganws0j84g3hi7ax"))))
+ (build-system copy-build-system)
+ (arguments
+ (list #:tests? #f))
+ (synopsis "Header-only single-file std::filesystem helper library for C++")
+ (description
+ "This library provides std::filesystem-compatible functionality for C++11,
+C++14, C++17, and C++20. It is portable, tested on various platforms, and
+resides in the ghc::filesystem namespace to avoid conflicts with
+std::filesystem.")
+ (home-page "https://github.com/gulrak/filesystem")
+ (license license:expat)))
+
+(define-public ThreadPool
+ (package
+ (name "ThreadPool")
+ ;; No actual version in upstream
+ (version "v0.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/progschj/ThreadPool")
+ (commit "9a42ec1329f259a5f4881a291db1dcb8f2ad9040")
+ (recursive? #f)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "020j6cgvl9aq2gs6fndl31w7wni7djwl90nw465bnmx0648ss89n"))))
+ (build-system copy-build-system)
+ (arguments
+ (list #:tests? #f))
+ (synopsis "Simple C++11 Thread Pool implementation")
+ (description
+ "A simple C++11 Thread Pool implementation.")
+ (home-page "https://github.com/progschj/ThreadPool")
+ (license license:expat)))
+
+(define-public mkpsxiso
+ (package
+ (name "mkpsxiso")
+ (version "v2.04")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Lameguy64/mkpsxiso")
+ (commit version)
+ (recursive? #f)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "19cs5i39qhgwabrcklm6dym9p1zqmsgfgv6hcfc5z207yzdc9qhl"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list #:tests? #f ;no test
+ #:configure-flags
+ #~(list "-DCMAKE_CXX_FLAGS=-fpermissive")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'copy-tinyxml2
+ (lambda _
+ (copy-recursively
+ #$(package-source tinyxml2)
+ "tinyxml2")))
+ (add-after 'copy-tinyxml2 'copy-miniaudio
+ (lambda _
+ (copy-recursively
+ #$(package-source miniaudio-0.10.43)
+ "miniaudio")))
+ (add-after 'copy-miniaudio 'copy-gulrak-filesystem
+ (lambda _
+ (copy-recursively
+ #$(package-source gulrak-filesystem)
+ "ghc")))
+ (add-after 'copy-gulrak-filesystem 'copy-threadpool
+ (lambda _
+ (copy-recursively
+ #$(package-source ThreadPool)
+ "ThreadPool")))
+ (add-after 'copy-threadpool 'copy-flac
+ (lambda _
+ (mkdir-p "flac")
+ (with-directory-excursion "flac"
+ (invoke "tar" "xvf" #$(package-source flac)
+ "--strip-components=1")))))))
+ (inputs (list glfw pulseaudio))
+ (native-inputs
+ (list
+ pkg-config
+ tinyxml2
+ miniaudio-0.10.43
+ gulrak-filesystem
+ ThreadPool
+ flac
+ ninja))
+ (synopsis "Builds PlayStation CD images from an XML document")
+ (description
+ "MKPSXISO is capable of generating 2352 byte per sector ISO images with
+CD-DA audio tracks and mixed-mode CD-XA and interleaved data for streaming
+content. It also uses XML with very simple to use directives for scripting the
+contents of the image project.")
+ (home-page "http://lameguy64.net/")
+ (license license:gpl2)))
+
+(define-public psn00bsdk
+ (package
+ (name "psn00bsdk")
+ (version "v0.24")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/Lameguy64/PSn00bSDK")
+ (commit "702bb601fb5712e2ae962a34b89204c646fe98f5")
+ (recursive? #f)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1nvy6lff4p54127awc4pl0a73myrgssihksvpaxamadzpk12vvl4"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list #:tests? #f ;no test
+ #:configure-flags
+ #~(list "-DCMAKE_BUILD_TYPE=Release"
+ "-DSKIP_EXAMPLES=true"
+ (string-append
+ "-DCMAKE_ASM_FLAGS=-Wa,-I"
+ #$source
+ "/libpsn00b/include,-march=r3000"))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-cmake
+ (lambda _
+ (substitute* "CMakeLists.txt"
+ ;; Modify ExternalProject_Add for 'libpsn00b-debug'
+ (("CMAKE_CACHE_ARGS[^\n]+-DCMAKE_BUILD_TYPE:STRING=Debug")
+ (string-append
+ "CMAKE_CACHE_ARGS ${_libpsn00b_args} -DCMAKE_BUILD_TYPE:STRING=Debug "
+ "-DCMAKE_ASM_FLAGS:STRING=-Wa,-I"
+ #$source "/libpsn00b/include,-march=r3000"))
+ ;; Modify ExternalProject_Add for 'libpsn00b-release'
+ (("CMAKE_CACHE_ARGS[^\n]+-DCMAKE_BUILD_TYPE:STRING=Release")
+ (string-append
+ "CMAKE_CACHE_ARGS ${_libpsn00b_args} -DCMAKE_BUILD_TYPE:STRING=Release "
+ "-DCMAKE_ASM_FLAGS:STRING=-Wa,-I"
+ #$source "/libpsn00b/include,-march=r3000")))))
+ (add-after 'patch-cmake 'copy-mkpsxiso
+ (lambda _
+ (copy-recursively
+ #$(package-source mkpsxiso)
+ "tools/mkpsxiso")))
+ (add-after 'copy-mkpsxiso 'copy-tinyxml2
+ (lambda _
+ (copy-recursively #$(package-source tinyxml2) "tools/tinyxml2")
+ (with-directory-excursion "tools/mkpsxiso"
+ (copy-recursively
+ #$(package-source tinyxml2)
+ "tinyxml2"))))
+ (add-after 'copy-tinyxml2 'copy-miniaudio
+ (lambda _
+ (with-directory-excursion "tools/mkpsxiso"
+ (copy-recursively
+ #$(package-source miniaudio-0.10.43)
+ "miniaudio"))))
+ (add-after 'copy-miniaudio 'copy-gulrak-filesystem
+ (lambda _
+ (with-directory-excursion "tools/mkpsxiso"
+ (copy-recursively
+ #$(package-source gulrak-filesystem)
+ "ghc"))))
+ (add-after 'copy-gulrak-filesystem 'copy-threadpool
+ (lambda _
+ (with-directory-excursion "tools/mkpsxiso"
+ (copy-recursively
+ #$(package-source ThreadPool)
+ "ThreadPool"))))
+ (add-after 'copy-threadpool 'copy-flac
+ (lambda _
+ (mkdir-p "flac")
+ (with-directory-excursion "tools/mkpsxiso/flac"
+ (invoke "tar" "xvf" #$(package-source flac)
+ "--strip-components=1")))))))
+ (propagated-inputs
+ `(("mipsel-none-elf-toolchain" ,(make-mipsel-none-elf-toolchain-ps1))))
+ (native-inputs (list pkg-config))
+ (synopsis "Homebrew software development kit for the original Sony
+PlayStation")
+ (description
+ "Sn00bSDK is a set of libraries that implements most of the core
+functionality of the official Sony SDK (excluding higher-level libraries) plus
+several new extensions to it.")
+ (home-page "http://lameguy64.net/")
+ (license license:mpl2.0)))
--
2.46.0
L
L
Liliana Marie Prikler wrote on 15 Sep 21:09 +0200
e3888b31dd1ff3fcf01bbedbf9acf7a75c02dcc6.camel@gmail.com
Am Sonntag, dem 15.09.2024 um 22:03 +0300 schrieb manolis837@gmail.com:
Toggle quote (8 lines)
> From: Manolis Ragkousis <manolis837@gmail.com>
>
> * gnu/packages/game-development.scm (miniaudio): New variable.
>   (miniaudio-0.10.43): New variable.
>   (gulrak-filesystem): New variable.
>   (ThreadPool): New variable.
>   (mkpsxiso): New variable.
>   (psn00bsdk): New variable.
Please only do one package per patch.

Toggle quote (2 lines)
> […]
> +     (list #:tests? #f))
Should always be documented (using a comment).

Toggle quote (2 lines)
> +    (synopsis "Header-only single-file std::filesystem helper
> library for C++")
Perhaps we can shorten that a little?
Toggle quote (9 lines)
> +    (description
> + "This library provides std::filesystem-compatible functionality for
> C++11,
> +C++14, C++17, and C++20.  It is portable, tested on various
> platforms, and
> +resides in the ghc::filesystem namespace to avoid conflicts with
> +std::filesystem.")
> +    (home-page "https://github.com/gulrak/filesystem")
> +    (license license:expat)))
It looks like gulrak-filesystem is actually defined already.

Toggle quote (1 lines)
> +(define-public ThreadPool
Use kebab-case.

Toggle quote (3 lines)
> […]
> +    (description
> +     "A simple C++11 Thread Pool implementation.")
Avoid marketing speech ("simple" often isn't, particularly with thread
pools ?).

Toggle quote (51 lines)
> +    (license license:expat)))
> +
> +(define-public mkpsxiso
> +  (package
> +    (name "mkpsxiso")
> +    (version "v2.04")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/Lameguy64/mkpsxiso")
> +                    (commit version)
> +                    (recursive? #f)))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +               
> "19cs5i39qhgwabrcklm6dym9p1zqmsgfgv6hcfc5z207yzdc9qhl"))))
> +    (build-system cmake-build-system)
> +    (arguments
> +     (list #:tests? #f  ;no test
> +           #:configure-flags
> +           #~(list "-DCMAKE_CXX_FLAGS=-fpermissive")
> +           #:phases
> +           #~(modify-phases %standard-phases
> +               (add-after 'unpack 'copy-tinyxml2
> +                 (lambda _
> +                   (copy-recursively
> +                    #$(package-source tinyxml2)
> +                    "tinyxml2")))
> +               (add-after 'copy-tinyxml2 'copy-miniaudio
> +                 (lambda _
> +                   (copy-recursively
> +                    #$(package-source miniaudio-0.10.43)
> +                    "miniaudio")))
> +               (add-after 'copy-miniaudio 'copy-gulrak-filesystem
> +                 (lambda _
> +                   (copy-recursively
> +                    #$(package-source gulrak-filesystem)
> +                    "ghc")))
> +               (add-after 'copy-gulrak-filesystem 'copy-threadpool
> +                 (lambda _
> +                   (copy-recursively
> +                    #$(package-source ThreadPool)
> +                    "ThreadPool")))
> +               (add-after 'copy-threadpool 'copy-flac
> +                 (lambda _
> +                   (mkdir-p "flac")
> +                   (with-directory-excursion "flac"
> +                     (invoke "tar" "xvf" #$(package-source flac)
> +                             "--strip-components=1")))))))
Do actually unbundle those instead of copying their sources.
Toggle quote (109 lines)
> +    (inputs (list glfw pulseaudio))
> +    (native-inputs
> +     (list
> +      pkg-config
> +      tinyxml2
> +      miniaudio-0.10.43
> +      gulrak-filesystem
> +      ThreadPool
> +      flac
> +      ninja))
> +    (synopsis "Builds PlayStation CD images from an XML document")
> +    (description
> +     "MKPSXISO is capable of generating 2352 byte per sector ISO
> images with
> +CD-DA audio tracks and mixed-mode CD-XA and interleaved data for
> streaming
> +content.  It also uses XML with very simple to use directives for
> scripting the
> +contents of the image project.")
> +    (home-page "http://lameguy64.net/")
> +    (license license:gpl2)))
> +
> +(define-public psn00bsdk
> +  (package
> +    (name "psn00bsdk")
> +    (version "v0.24")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/Lameguy64/PSn00bSDK")
> +                    (commit
> "702bb601fb5712e2ae962a34b89204c646fe98f5")
> +                    (recursive? #f)))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +               
> "1nvy6lff4p54127awc4pl0a73myrgssihksvpaxamadzpk12vvl4"))))
> +    (build-system cmake-build-system)
> +    (arguments
> +     (list #:tests? #f  ;no test
> +           #:configure-flags
> +           #~(list "-DCMAKE_BUILD_TYPE=Release"
> +                   "-DSKIP_EXAMPLES=true"
> +                   (string-append
> +                    "-DCMAKE_ASM_FLAGS=-Wa,-I"
> +                    #$source
> +                    "/libpsn00b/include,-march=r3000"))
> +           #:phases
> +           #~(modify-phases %standard-phases
> +               (add-after 'unpack 'patch-cmake
> +                 (lambda _
> +                   (substitute* "CMakeLists.txt"
> +                     ;; Modify ExternalProject_Add for 'libpsn00b-
> debug'
> +                     (("CMAKE_CACHE_ARGS[^\n]+-
> DCMAKE_BUILD_TYPE:STRING=Debug")
> +                      (string-append
> +                       "CMAKE_CACHE_ARGS ${_libpsn00b_args} -
> DCMAKE_BUILD_TYPE:STRING=Debug "
> +                       "-DCMAKE_ASM_FLAGS:STRING=-Wa,-I"
> +                       #$source "/libpsn00b/include,-march=r3000"))
> +                     ;; Modify ExternalProject_Add for 'libpsn00b-
> release'
> +                     (("CMAKE_CACHE_ARGS[^\n]+-
> DCMAKE_BUILD_TYPE:STRING=Release")
> +                      (string-append
> +                       "CMAKE_CACHE_ARGS ${_libpsn00b_args} -
> DCMAKE_BUILD_TYPE:STRING=Release "
> +                       "-DCMAKE_ASM_FLAGS:STRING=-Wa,-I"
> +                       #$source "/libpsn00b/include,-
> march=r3000")))))
> +               (add-after 'patch-cmake 'copy-mkpsxiso
> +                 (lambda _
> +                   (copy-recursively
> +                    #$(package-source mkpsxiso)
> +                    "tools/mkpsxiso")))
> +               (add-after 'copy-mkpsxiso 'copy-tinyxml2
> +                 (lambda _
> +                   (copy-recursively #$(package-source tinyxml2)
> "tools/tinyxml2")
> +                   (with-directory-excursion "tools/mkpsxiso"
> +                     (copy-recursively
> +                      #$(package-source tinyxml2)
> +                      "tinyxml2"))))
> +               (add-after 'copy-tinyxml2 'copy-miniaudio
> +                 (lambda _
> +                   (with-directory-excursion "tools/mkpsxiso"
> +                     (copy-recursively
> +                      #$(package-source miniaudio-0.10.43)
> +                      "miniaudio"))))
> +               (add-after 'copy-miniaudio 'copy-gulrak-filesystem
> +                 (lambda _
> +                   (with-directory-excursion "tools/mkpsxiso"
> +                     (copy-recursively
> +                      #$(package-source gulrak-filesystem)
> +                      "ghc"))))
> +               (add-after 'copy-gulrak-filesystem 'copy-threadpool
> +                 (lambda _
> +                   (with-directory-excursion "tools/mkpsxiso"
> +                     (copy-recursively
> +                      #$(package-source ThreadPool)
> +                      "ThreadPool"))))
> +               (add-after 'copy-threadpool 'copy-flac
> +                 (lambda _
> +                   (mkdir-p "flac")
> +                   (with-directory-excursion "tools/mkpsxiso/flac"
> +                     (invoke "tar" "xvf" #$(package-source flac)
> +                             "--strip-components=1")))))))
As above.

Cheers
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 73278@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 73278
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch