Subject: [PATCH] gnu: Add gens-gs.

From: "David Wilson" <[email-masked]>
Date: Sat, 19 Oct 2019 06:36:50 -0700

Hi all! I was able to get the gens-gs build working with the attached patch on top of Pierre's original. Tested the output by loading up a "Chakan: The Forever Man" ROM, seemed to work fine :)  The key was this line of the Nix package definition:

https://github.com/NixOS/nixpkgs/blob/master/pkgs/misc/emulators/gens-gs/default.nix#L16

Apparently gens-gs' code is so old that it's using some deprecated GTK APIs, so we have to remove the GTK_DISABLE_DEPRECATED define, etc, from GTK_CFLAGS so that the build will complete successfully.

David

diff --git a/gnu/packages/emulators.scm b/gnu/packages/emulators.scm
index c1d1d54052..d616f7fd21 100644
--- a/gnu/packages/emulators.scm
+++ b/gnu/packages/emulators.scm
@@ -82,6 +82,7 @@
   #:use-module (gnu packages xorg)
   #:use-module (gnu packages web)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu))
 
 (define-public desmume
@@ -1379,9 +1380,18 @@ functions.  The source code to MAME serves as this documentation.")
        (sha256
         (base32
          "1ha5s6d3y7s9aq9f4zmn9p88109c3mrj36z2w68jhiw5xrxws833"))))
-    (build-system gnu-build-system)
+    (build-system glib-or-gtk-build-system)
+    (supported-systems '("i686-linux" "x86_64-linux"))
     (arguments
-     `(#:system "i686-linux"))
+     `(#:system "i686-linux"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'fix-CFLAGS
+           (lambda* _
+             ;; Remove GTK API deprecation flags that cause build errors
+             (substitute* "configure"
+               (("GTK_CFLAGS=\"\\$GTK_CFLAGS .*\"") ""))
+             #t)))))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("nasm" ,nasm)))