guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#41778] [PATCH 2/2] gnu: Add ppsspp.


From: Leo Prikler
Subject: [bug#41778] [PATCH 2/2] gnu: Add ppsspp.
Date: Tue, 9 Jun 2020 23:47:20 +0200

* gnu/packages/emulators.scm (ppsspp): New variable.
---
 gnu/packages/emulators.scm | 115 +++++++++++++++++++++++++++++++++++++
 1 file changed, 115 insertions(+)

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index 9798ac370e..2e11807325 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -1622,3 +1622,118 @@ derived from Gens.  Project goals include clean source 
code, combined features
 from various forks of Gens, and improved platform portability.")
     (supported-systems '("i686-linux" "x86_64-linux"))
     (license license:gpl2+)))
+
+(define-public ppsspp
+  (package
+    (name "ppsspp")
+    (version "1.9.4")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/hrydgard/ppsspp.git";)
+             (commit (string-append "v" version))))
+       (sha256
+        (base32
+         "0cbxrm7i4xymlglb2aqyiiys3wm6zvnrn5n0cw4fcxdvh196ivwm"))
+       (file-name (git-file-name name version))))
+    (build-system cmake-build-system)
+    (native-inputs
+     `(("python" ,python)))
+    (inputs
+     `(;; TODO: find a way to add FFMPEG
+       ;; ("ffmpeg" ,ffmpeg)
+       ;; TODO: unbundle builds
+       ("armips-source" ,(package-source armips))
+       ("glslang-source" ,(package-source glslang))
+       ("spirv-cross-source" ,(package-source spirv-cross))
+
+       ("lang"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/hrydgard/ppsspp-lang.git";)
+                 (commit "3a5eb3fcb4852cb28c9138e78492effa0c227253")))
+           (sha256
+            (base32
+             "0cnv9g5l75dmdb0hq7xxbxl06z18p1621j41bggfqj1015kvq7jk"))))
+       ("tests"
+        ,(origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/hrydgard/pspautotests.git";)
+                 (commit "2970fbcc23c258ebc03bba922926003fe37555e5")))
+           (sha256
+            (base32
+             "1c3lkjhknwmiyikrfjrghfxnkd2jp698c28s4kwv6qjwdj2nwc1i"))))
+
+       ("glew" ,glew)
+       ("libpng" ,libpng)
+       ("mesa" ,mesa)
+       ("sdl2" ,sdl2)
+       ("snappy" ,snappy)
+       ("zlib" ,zlib)))
+    (arguments
+     `(#:out-of-source? #f
+       #:configure-flags (list "-DUSE_FFMPEG=OFF" ; see TODO above
+                               "-DUSE_DISCORD=OFF"
+                               ;; for testing
+                               "-DUNITTEST=ON" "-DHEADLESS=ON")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'add-external-sources
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; TODO: unbundle builds
+             ;;       not only should we not copy these sources in,
+             ;;       we should also remove as much from ext/ as we can
+             (copy-recursively (assoc-ref inputs "armips-source")
+                               "ext/armips")
+             (copy-recursively (assoc-ref inputs "glslang-source")
+                               "ext/glslang")
+             (copy-recursively (assoc-ref inputs "spirv-cross-source")
+                               "ext/SPIRV-Cross")
+             ;; some tests are externalised, so we add them here
+             (copy-recursively (assoc-ref inputs "tests")
+                               "pspautotests")
+             ;; i18n is externalised, so we add it here
+             (copy-recursively (assoc-ref inputs "lang")
+                               "assets/lang")
+             #t))
+         (replace 'check
+           (lambda _
+             (for-each
+              (lambda (t) (invoke "./unitTest" t))
+              '("Arm64Emitter" "ArmEmitter" "X64Emitter" "VertexJit" "Asin"
+                "SinCos" "VFPUSinCos" "MathUtil" "Parsers" "Jit"
+                "MatrixTranspose" "ParseLBN" "QuickTexHash" "CLZ" "MemMap"))
+             (invoke "python3" "test.py" "-g")
+             #t))
+         (replace 'install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin/ppsspp (string-append out "/bin/ppsspp"))
+                    (share (string-append out "/share/ppsspp")))
+               (copy-recursively "icons/hicolor"
+                                 (string-append out "/share/icons/hicolor"))
+               (install-file "PPSSPPSDL" share)
+               (copy-recursively "assets" (string-append share "/assets"))
+
+               (make-desktop-entry-file
+                (string-append out "/share/applications/ppsspp.desktop")
+                #:name "PPSSPP"
+                #:exec (string-append share "/PPSSPPSDL")
+                #:icon "ppsspp")
+
+               (mkdir-p (string-append out "/bin"))
+               (with-output-to-file bin/ppsspp
+                 (lambda ()
+                   (format #t "#!~a~%exec ~a/PPSSPPSDL \"$@\""
+                           (which "sh") share)))
+               (chmod bin/ppsspp #o755)
+
+               #t))))))
+    (home-page "https://www.ppsspp.org/";)
+    (synopsis "PSP emulator")
+    (description
+     "PPSSPP is a \"high-level\" emulator simulating the PSP operating 
system.")
+    (license license:gpl2+)))
-- 
2.26.2






reply via email to

[Prev in Thread] Current Thread [Next in Thread]