Subject: [PATCH v1] Updated and fixed frotz package.

From: Christopher Rodriguez <[email-masked]>
Date: Wed, 22 Jun 2022 20:58:03 -0400

---

Hello!

Was going through my open issues, saw this one was still open. Took a crack at
fixing frotz; It builds and works as expected now. Wanted to share.

Thanks for Your time!

 gnu/packages/games.scm | 66 +++++++++++++++++++++++++++---------------
 1 file changed, 43 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 8e6ab03530..512871d780 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -7988,7 +7988,7 @@ (define (install src dst)
 (define-public frotz
   (package
     (name "frotz")
-    (version "2.44")
+    (version "2.54")
     (source (origin
               (method url-fetch)
               (uri (list (string-append
@@ -7999,30 +7999,50 @@ (define-public frotz
                           "frotz/frotz-" version ".tar.gz")))
               (sha256
                (base32
-                "1v735xr3blznac8fnwa27s1vhllx4jpz7kw7qdw1bsfj6kq21v3k"))))
+                "1vsfq9ryyb4nvzxpnnn40k423k9pdy8k67i8390qz5h0vmxw0fds"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:tests? #f                      ; there are no tests
-       #:phases
-       (modify-phases %standard-phases
-         (delete 'configure)
-         (add-before 'build 'curses
-           (lambda _
-             (substitute* "Makefile"
-               (("lcurses") "lncurses"))
-             #t))
-         (replace 'install
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (bin (string-append out "/bin"))
-                    (man (string-append out "/share/man/man6")))
-               (install-file "frotz" bin)
-               (mkdir-p man)
-               (install-file "doc/frotz.6" man)
-               #t))))))
-    (inputs (list libmodplug libsamplerate libsndfile libvorbis ncurses))
-    (synopsis "Portable Z-machine interpreter (ncurses version) for text adventure games")
-    (description "Frotz is an interpreter for Infocom games and other Z-machine
+     `(#:tests? #f ;there are no tests
+       #:phases (modify-phases %standard-phases
+                  (delete 'configure)
+                  (replace 'build
+                    (lambda* _
+                      ;; Compile.
+                      (invoke "make" "frotz")))
+                  (add-before 'build 'patch-makefile
+                    (lambda* _
+                      (let ((makefiles (list "Makefile"
+                                             "src/common/Makefile"
+                                             "src/curses/Makefile"
+                                             "src/x11/Makefile"
+                                             "src/sdl/Makefile"
+                                             "src/dumb/Makefile"
+                                             "src/blorb/Makefile")))
+                        (map (lambda (x)
+                               (substitute* x
+                                 (("\\$\\(CC\\)") "gcc"))) makefiles))))
+                  (replace 'install
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let* ((out (assoc-ref outputs "out")) (bin (string-append
+                                                                   out "/bin"))
+                             (man (string-append out "/share/man/man6")))
+                        (install-file "frotz" bin)
+                        (mkdir-p man)
+                        (install-file "doc/frotz.6" man)))))))
+    (native-inputs (list pkg-config))
+    (inputs (list ao
+                  libmodplug
+                  libsamplerate
+                  libsndfile
+                  libvorbis
+                  ncurses
+                  which
+                  perl
+                  pkg-config))
+    (synopsis
+     "Portable Z-machine interpreter (ncurses version) for text adventure games")
+    (description
+     "Frotz is an interpreter for Infocom games and other Z-machine
 games in the text adventure/interactive fiction genre.  This version of Frotz
 complies with standard 1.0 of Graham Nelson's specification.  It plays all
 Z-code games V1-V8, including V6, with sound support through libao, and uses

base-commit: 2873433c72ad6302a275579a646ba9635f036927
-- 
2.36.1