gnu: higan: Update to 110-0.ad0e11e and modernize.

* gnu/packages/emulators.scm (higan): Update to 110-0.ad0e11e.
[inputs]: Remove labels. Replace gtk+-2 with gtk+ and gtksourceview-2 with
gtksourceview-3.
[arguments]: Use gexps and gexp variables as well as search-input-file in
phases.
<#:make-flags>: Add higan.path and platform flags.
<#:phases> {chdir-to-higan}: Rename to...
{chdir-to-higan-ui}: ... this, switching to higan-ui directory.
{wrap-higan-executable}: Streamline via wrap-program.

Fixes: #1477
Change-Id: I46130180a3b8505233c9baba81789cd0ade262bd
This commit is contained in:
Maxim Cournoyer 2025-07-22 15:51:22 +09:00
parent cd028a4e0e
commit 242dceabb4
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -778,91 +778,62 @@ and a game metadata scraper.")
(license license:expat)))) (license license:expat))))
(define-public higan (define-public higan
;; There are no recent releases; use the latest commit of the master branch.
(let ((commit "ad0e11e7b73053eb1bcd5bdeabbe2de92c356286")
(revision "0"))
(package (package
(name "higan") (name "higan")
(version "110") (version (git-version "110" revision commit))
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
(uri (git-reference (uri (git-reference
(url "https://github.com/higan-emu/higan") (url "https://github.com/higan-emu/higan")
(commit (string-append "v" version)))) (commit commit)))
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 "11rvm53c3p2f6zk8xbyv2j51xp8zmqnch7zravhj3fk590qrjrr2")))) (base32 "1dlx5vqxv8mr8faw0wggsd10bk51p258l56yixjarv0dyhv6nkbq"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(native-inputs (native-inputs
(list pkg-config)) (list pkg-config))
(inputs (inputs
`(("alsa-lib" ,alsa-lib) (list alsa-lib
("bash" ,bash-minimal) ; for wrap-program bash-minimal ; for wrap-program
("ao" ,ao) ao
("eudev" ,eudev) eudev
("gtk+" ,gtk+-2) gtk+
("gtksourceview-2" ,gtksourceview-2) gtksourceview-3
("libxrandr" ,libxrandr) libxrandr
("libxv" ,libxv) libxv
("mesa" ,mesa) mesa
("openal" ,openal) openal
("pulseaudio" ,pulseaudio) pulseaudio
("sdl2" ,sdl2))) sdl2))
(arguments (arguments
'(#:phases (list
(let ((build-phase (assoc-ref %standard-phases 'build)) #:tests? #f ;no test suite
(install-phase (assoc-ref %standard-phases 'install))) #:make-flags #~(list "compiler=g++"
(modify-phases %standard-phases "higan.path=../higan"
"platform=linux"
(string-append "prefix=" #$output))
#:phases
#~(modify-phases %standard-phases
;; The higan build system has no configure phase. ;; The higan build system has no configure phase.
(delete 'configure) (delete 'configure)
(add-before 'build 'chdir-to-higan (add-before 'build 'chdir-to-higan-ui
(lambda _ (lambda _
(chdir "higan") (chdir "higan-ui")))
#t))
(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"))
#t)))
(add-after 'install 'chdir-to-icarus (add-after 'install 'chdir-to-icarus
(lambda _ (lambda _
(chdir "../icarus") (chdir "../icarus")))
#t)) (add-after 'chdir-to-icarus 'build-icarus
(add-after 'chdir-to-icarus 'build-icarus build-phase) (assoc-ref %standard-phases 'build))
(add-after 'build-icarus 'install-icarus install-phase) (add-after 'build-icarus 'install-icarus
(assoc-ref %standard-phases 'install))
(add-after 'install-icarus 'wrap-higan-executable (add-after 'install-icarus 'wrap-higan-executable
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda _
(let* ((out (assoc-ref outputs "out")) (wrap-program (string-append #$output "/bin/higan")
(bin (string-append out "/bin")) `("PATH" prefix (,(string-append #$output "/bin")))))))))
(higan (string-append bin "/higan"))
(higan-original (string-append higan "-original"))
(bash (search-input-file inputs "/bin/bash"))
(coreutils (assoc-ref inputs "coreutils"))
(mkdir (string-append coreutils "/bin/mkdir"))
(cp (string-append coreutils "/bin/cp"))
(cp-r (string-append cp " -r --no-preserve=mode")))
;; 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)))
#t)))))
#:make-flags
(list "compiler=g++"
(string-append "prefix=" (assoc-ref %outputs "out")))
;; There is no test suite.
#:tests? #f))
(home-page "https://github.com/higan-emu/higan/") (home-page "https://github.com/higan-emu/higan/")
(synopsis "Multi-system emulator") (synopsis "Multi-system emulator")
(description (description
@ -875,7 +846,7 @@ Game Boy Player, SG-1000, SC-3000, Master System, Game Gear, Mega Drive, Mega
CD, PC Engine, SuperGrafx, MSX, MSX2, ColecoVision, Neo Geo Pocket, Neo Geo CD, PC Engine, SuperGrafx, MSX, MSX2, ColecoVision, Neo Geo Pocket, Neo Geo
Pocket Color, WonderSwan, WonderSwan Color, SwanCrystal, Pocket Challenge Pocket Color, WonderSwan, WonderSwan Color, SwanCrystal, Pocket Challenge
V2.") V2.")
(license license:gpl3+))) (license license:gpl3+))))
(define-public mednafen (define-public mednafen
(package (package