all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add higan.
@ 2016-06-03 23:44 Taylan Ulrich Bayırlı/Kammer
  2016-06-07 15:28 ` Taylan Ulrich Bayırlı/Kammer
  2016-06-08 12:37 ` Ludovic Courtès
  0 siblings, 2 replies; 9+ messages in thread
From: Taylan Ulrich Bayırlı/Kammer @ 2016-06-03 23:44 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 1249 bytes --]

Some things to note about this package & questions:

- There's no official VCS repo and the author doesn't want automated
  tools to download files from his homepage; there's an unofficial git
  repo at GitLab but I found it unsuitable so I'm hosting the sources
  specifically for Guix at GitHub now:

  https://github.com/TaylanUB/higan

  Is this OK, or is there a place we can upload the original source
  bundle for Guix to download from?

- I forgot if there's a guideline for this: the release versions are
  called 'v097', 'v098' etc. with always a 'v' in front.  Should that
  'v' appear in the version field of the package or should it be
  stripped?

- As seems to be tradition among emulator developers, the build system
  and the program's handling of the file system are a big pile of poo,
  so:

  * Is it principally OK to reuse the standard `build' and `install'
    phase procedures a second time, just with the CWD changed, as I do
    here?

  * The program insists on looking in ~/.local/share for some data files
    that are actually installed in $prefix/share; does my strategy here
    look OK, in that I wrap the executable to copy the data files into
    ~/.local/share every time the program is run?

Thank you!

Taylan


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-higan.patch --]
[-- Type: text/x-diff, Size: 4883 bytes --]

From 707e8fc3c2ba1293693168b1d7a34e6000671158 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Taylan=20Ulrich=20Bay=C4=B1rl=C4=B1/Kammer?=
 <taylanbayirli@gmail.com>
Date: Sun, 1 Nov 2015 20:45:09 +0100
Subject: [PATCH] gnu: Add higan.

* gnu/packages/games.scm (higan): New variable.
---
 gnu/packages/games.scm | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 92 insertions(+)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index e552d09..57f8907 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -2243,3 +2243,95 @@ Red Eclipse provides fast paced and accessible gameplay.")
                      license:cc-by-sa3.0
                      license:cc-by3.0
                      license:cc0)))))
+
+(define-public higan
+  (package
+    (name "higan")
+    (version "v098")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://github.com/TaylanUB/higan/archive/" version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "12snxrk8wa94x3l69qcimgm0xc22zjgf7vzhckp2lzyfbf27950v"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("alsa-lib" ,alsa-lib)
+       ("ao" ,ao)
+       ("eudev" ,eudev)
+       ("gtk+" ,gtk+-2)
+       ("gtksourceview-2" ,gtksourceview-2)
+       ("libxv" ,libxv)
+       ("mesa" ,mesa)
+       ("openal" ,openal)
+       ("pulseaudio" ,pulseaudio)
+       ("sdl" ,sdl)))
+    (arguments
+     '(#:phases
+       (let ((build-phase (assoc-ref %standard-phases 'build))
+             (install-phase (assoc-ref %standard-phases 'install)))
+         (modify-phases %standard-phases
+           ;; The higan build system has no configure phase.
+           (delete 'configure)
+           (add-before 'build 'chdir-to-higan
+             (lambda _
+               (chdir "higan")))
+           (add-before 'install 'create-/share/applications
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((out (assoc-ref outputs "out")))
+                 ;; It seems the author forgot to do this in the Makefile.
+                 (mkdir-p (string-append out "/share/applications")))))
+           (add-after 'install 'chdir-to-icarus
+             (lambda _
+               (chdir "../icarus")))
+           (add-after 'chdir-to-icarus 'build-icarus build-phase)
+           (add-after 'build-icarus 'install-icarus install-phase)
+           (add-after 'install-icarus 'wrap-higan-executable
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (bin (string-append out "/bin"))
+                      (higan (string-append bin "/higan"))
+                      (higan-original (string-append higan "-original"))
+                      (bash (string-append (assoc-ref inputs "bash")
+                                           "/bin/bash"))
+                      (coreutils (assoc-ref inputs "coreutils"))
+                      (mkdir (string-append coreutils "/bin/mkdir"))
+                      (cp (string-append coreutils "/bin/cp")))
+                 ;; First, have the executable make sure ~/.local/share/higan
+                 ;; contains up to date files.  Higan insists on looking there
+                 ;; for these data files.
+                 (rename-file higan higan-original)
+                 (with-output-to-file higan
+                   (lambda ()
+                     (display
+                      (string-append
+                       "#!" bash "\n"
+                       ;; higan doesn't respect $XDG_DATA_HOME
+                       mkdir " -p ~/.local/share\n"
+                       cp " -r " out "/share/higan ~/.local/share\n"
+                       "exec " higan-original))))
+                 (chmod higan #o555)
+                 ;; Second, make sure higan will find icarus in PATH.
+                 (wrap-program higan
+                   `("PATH" ":" prefix (,bin))))))))
+       #:make-flags
+       (list "compiler=g++"
+             (string-append "prefix=" (assoc-ref %outputs "out")))
+       ;; There is no test suite.
+       #:tests? #f))
+    (home-page "http://byuu.org/emulation/higan/")
+    (synopsis "Nintendo multi-system emulator")
+    (description
+     "higan (formerly bsnes) is an emulator for multiple Nintendo video game
+consoles, including the Nintendo Entertainment System (NES/Famicom), Super
+Nintendo Entertainment System (SNES/Super Famicom), Game Boy, Game Boy
+Color (GBC), and Game Boy Advance (GBA).  It also supports the subsystems
+Super Game Boy, BS-X Satellaview, and Sufami Turbo.")
+    ;; As noted in these files among more:
+    ;; - icarus/icarus.cpp
+    ;; - higan/emulator/emulator.hpp
+    (license license:gpl3)))
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-06-10 12:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-03 23:44 [PATCH] gnu: Add higan Taylan Ulrich Bayırlı/Kammer
2016-06-07 15:28 ` Taylan Ulrich Bayırlı/Kammer
2016-06-07 18:29   ` Efraim Flashner
2016-06-07 19:08     ` Taylan Ulrich Bayırlı/Kammer
2016-06-08 12:37 ` Ludovic Courtès
2016-06-08 13:21   ` Taylan Ulrich Bayırlı/Kammer
2016-06-08 15:27     ` Ludovic Courtès
2016-06-09 20:43       ` Taylan Ulrich Bayırlı/Kammer
2016-06-10 12:56         ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.