summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorIan Eure <ian@retrospec.tv>2026-01-24 14:00:35 -0800
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2026-08-19 21:25:13 +0200
commitc8e6c2fef1fe29c073057105f83afbcb5a36d466 (patch)
tree76c3a609e233758f961cb039c2a35a274d1c3240 /gnu
parent8d0732a747b3432a82c76fa47ad7ceb5453b1435 (diff)
gnu: Add emacs-nethack.
* gnu/packages/emacs-xyz.scm (emacs-nethack): New variable. Co-authored-by: bdunahu <bdunahu@operationnull.com> Fixes: guix/guix!5756 Merges: guix/guix!5884 Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/emacs-xyz.scm86
1 files changed, 86 insertions, 0 deletions
diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 4f54cced337..5b092742d39 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -3562,6 +3562,92 @@ mode line as @samp{[ status | name (primary) secondary ]}. It can be
3562displayed at the bottom or at the top.") 3562displayed at the bottom or at the top.")
3563 (license license:gpl3+)))) 3563 (license license:gpl3+))))
3564 3564
3565(define (make-nethack+lisp nethack emacs-nethack)
3566 "Create a nethack package variant with nethack-el patches."
3567 ;; Compute the patch file name from the nethack package version.
3568 (let ((patch-file-name
3569 (string-append
3570 "/enh-"
3571 (string-replace-substring (package-version nethack)
3572 "." "")
3573 ".patch")))
3574 (package
3575 (inherit nethack)
3576 (name (string-append (package-name nethack) "+lisp"))
3577 (source
3578 (origin
3579 (inherit (package-source nethack))
3580 (patches
3581 (list
3582 (file-append (package-source emacs-nethack) patch-file-name)))))
3583 (arguments
3584 (substitute-keyword-arguments arguments
3585 ((#:make-flags flags)
3586 #~(cons "WANT_WIN_LISP=1" #$flags))
3587 ((#:phases phases)
3588 #~(modify-phases #$phases
3589 (add-after 'make-writable-hackdir 'rename-binary
3590 (lambda _
3591 (with-directory-excursion #$output
3592 ;; Allows parallel installation with nethack.
3593 (rename-file "bin/nethack"
3594 "bin/nethack-lisp"))))))))
3595 (license
3596 (cons
3597 ;; nethack-el patches are under 3-clause BSD.
3598 license:bsd-3
3599 (list (package-license nethack)))))))
3600
3601(define-public emacs-nethack
3602 ;; 0.15.1 does not support Nethack 5.0.0 yet. Use newest commit.
3603 (let ((commit "a666c5917a44458a103e99587239fa7db67b9072")
3604 (revision "0"))
3605 (package
3606 (name "emacs-nethack")
3607 (version (git-version "0.15.1" revision commit))
3608 (source
3609 (origin
3610 (method git-fetch)
3611 (uri (git-reference
3612 (url "https://github.com/Feyorsh/nethack-el")
3613 (commit commit)))
3614 (file-name (git-file-name name version))
3615 (sha256
3616 (base32 "1h2akkw5hg7d2ffra94gam2zm5al4lxxhd2indkap8ppnjiidl32"))))
3617 (build-system emacs-build-system)
3618 (arguments
3619 (list
3620 #:include ''("^nethack[^/]*.el$")
3621 ;; Tests are tightly coupled to the network, and the only non-network
3622 ;; test is broken.
3623 #:tests? #f
3624 ;; Test command included, should the situation change.
3625 #:test-command
3626 #~(list
3627 "emacs" "--batch"
3628 "-l" "test/nethack-tests.el"
3629 "--eval" "(ert-run-tests-batch-and-exit)")
3630 #:phases
3631 #~(modify-phases %standard-phases
3632 (add-after 'unpack 'set-nethack-program-path
3633 (lambda* (#:key inputs #:allow-other-keys)
3634 (emacs-substitute-variables "nethack.el"
3635 ("nethack-program"
3636 (search-input-file inputs "bin/nethack-lisp"))))))))
3637 (inputs
3638 (list (make-nethack+lisp nethack this-package)))
3639 (home-page "https://github.com/Feyorsh/nethack-el")
3640 (synopsis "Run Nethack inside Emacs")
3641 (description
3642 "This package provides an Emacs Lisp interface for NetHack, the classic
3643single-player dungeon crawling game.")
3644 (license
3645 (list
3646 ;; Emacs Lisp code is under GPL3 or later.
3647 license:gpl3+
3648 ;; Nethack patches are 3-clause BSD.
3649 license:bsd-3)))))
3650
3565(define-public emacs-nftables-mode 3651(define-public emacs-nftables-mode
3566 (package 3652 (package
3567 (name "emacs-nftables-mode") 3653 (name "emacs-nftables-mode")