Subject: bug#50653: closed (Re: [bug#50653] [PATCH v2] gnu: Add sdlpop.)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 28 Sep 2021 19:38:01 +0000

Your bug report

#50653: [PATCH] gnu: Add sdlpop.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
50653: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=50653
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#50653] [PATCH v2] gnu: Add sdlpop.
From: Nicolas Goaziou <[email-masked]>
To: Xinglu Chen <[email-masked]>
Cc: [email-masked], phodina <[email-masked]>
Date: Tue, 28 Sep 2021 21:37:26 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello,

Xinglu Chen <[email-masked]> writes:

> The updated patch LGTM!

Thank you for the review. I removed "Open-source" from the synopsis and
pushed.

Thanks to phodina for the patch.

Regards,
-- 
Nicolas Goaziou

Subject: [PATCH] gnu: Add sdlpop.
From: phodina <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Sat, 18 Sep 2021 09:49:10 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

* gnu/packages/games.scm (sdlpop): New variable.
  [copyright]: Sort by date [email-masked].

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index c39770c260..0eed238f32 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -45,6 +45,7 @@
 ;;; Copyright © 2019, 2020 Guillaume Le Vaillant <[email-masked]>
 ;;; Copyright © 2019, 2020 Timotej Lazar <[email-masked]>
 ;;; Copyright © 2019 Josh Holland <[email-masked]>
+;;; Copyright © 2019 Pkill -9 <[email-masked]>
 ;;; Copyright © 2017, 2019 Hartmut Goebel <[email-masked]>
 ;;; Copyright © 2020 Alberto Eleuterio Flores Guerrero <[email-masked]>
 ;;; Copyright © 2020 Naga Malleswari <[email-masked]>
@@ -63,7 +64,7 @@
 ;;; Copyright © 2021 Felix Gruber <[email-masked]>
 ;;; Copyright © 2021 Solene Rapenne <[email-masked]>
 ;;; Copyright © 2021 Noisytoot <[email-masked]>
-;;; Copyright © 2019 Pkill -9 <[email-masked]>
+;;; Copyright © 2021 Petr Hodina <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -12480,6 +12481,62 @@ do so you need to explore the island, find food, build a shelter and try to
 get attention, so you get found.")
       (license license:cc-by4.0))))

+(define-public sdlpop
+  (package
+    (name "sdlpop")
+    (version "1.22")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/NagyD/SDLPoP")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1yy5r1r0hv0xggk8qd8bwk2zy7abpv89nikq4flqgi53fc5q9xl7"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-before 'build 'prepare-build
+           ;; Set correct environment for SDL.
+           (lambda* (#:key inputs #:allow-other-keys)
+             (setenv "CPATH"
+                     (string-append (assoc-ref inputs "sdl")
+                                    "/include/SDL2:"
+                                    (or (getenv "CPATH") "")))))
+         (add-after 'unpack 'chdir
+           (lambda* _
+             (chdir "src")))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (bin (string-append out "/bin"))
+                    (opt (string-append out "/opt/sdlpop"))
+                    (app (string-append out "/usr/share/applications"))
+                    (template "src/SDLPoP.desktop.template"))
+               (chdir "..")
+               (install-file "prince" bin)
+               (substitute* template (("\\$ROOT") out))
+               (install-file template app)
+               (rename-file (string-append app "/SDLPoP.desktop.template")
+                            (string-append app "/SDLPoP.desktop"))
+               (install-file "SDLPoP.ini" opt)
+               (copy-recursively "data" (string-append bin "/data"))
+               (copy-recursively "doc" opt)
+               (copy-recursively "mods" opt)))))))
+    (native-inputs `(("pkg-config" ,pkg-config)))
+    (inputs `(("sdl" ,(sdl-union (list sdl2
+                                       sdl2-image
+                                       sdl2-mixer)))))
+    (synopsis "Open-source port of Prince of Persia")
+    (description "Open-source port of Prince of Persia, based on the disassembly
+of the DOS version, extended with new features.")
+    (home-page "https://github.com/NagyD/SDLPoP")
+    (license license:gpl3)))
+
 (define-public fheroes2
   (package
     (name "fheroes2")
--
2.32.0