GNU bug report logs - #63071
[PATCH] gnu: Add emacs-riscv-mode

Previous Next

Package: guix-patches;

Reported by: Gabriel Wicki <gabriel <at> erlikon.ch>

Date: Tue, 25 Apr 2023 17:25:01 UTC

Severity: normal

Tags: patch

Done: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Gabriel Wicki <liliana.prikler <at> gmail.com>
To: 63071 <at> debbugs.gnu.org
Cc: Liliana Marie Prikler <liliana.prikler <at> gmail.com>, andrew <at> trop.in
Subject: [bug#63071] [PATCH] gnu: Add emacs-riscv-mode.
Date: Tue, 25 Apr 2023 17:48:41 +0200
* gnu/packages/emacs-xyz.scm (emacs-riscv-mode): New variable.
---
Hi Gabriel,

your patch didn't apply cleanly thanks to some coding issues, but I got
them to work with a little bit of work.  Below is an expanded patch that
also makes sure that spike actually exists.  It also uses 0.1 as base
version, taken from riscv-mode.el.

Cheers,
Liliana

 gnu/packages/emacs-xyz.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 7c8af093fc..3d4b9998ce 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -127,6 +127,7 @@
 ;;; Copyright © 2023 Dominik Delgado Steuter <d <at> delgado.nrw>
 ;;; Copyright © 2023 Juliana Sims <juli <at> incana.org>
 ;;; Copyright © 2023 Evgeny Pisemsky <evgeny <at> pisemsky.com>
+;;; Copyright © 2023 Gabriel Wicki <gabriel <at> erlikon.ch>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -259,6 +260,7 @@ (define-module (gnu packages emacs-xyz)
   #:use-module (gnu packages erlang)
   #:use-module (gnu packages statistics)
   #:use-module (gnu packages libcanberra)
+  #:use-module (gnu packages virtualization)
   #:use-module (gnu packages web-browsers)
   #:use-module (gnu packages wget)
   #:use-module (guix utils)
@@ -35854,6 +35856,39 @@ (define-public emacs-nasm-mode
 Unlike Emacs' generic ASM mode, it understands NASM-specific syntax.")
     (license license:unlicense)))
 
+(define-public emacs-riscv-mode
+  (let ((commit "8e335b9c93de93ed8dd063d702b0f5ad48eef6d7")
+        (revision "1"))
+    (package
+      (name "emacs-riscv-mode")
+      (version (git-version "0.1" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/AdamNiederer/riscv-mode")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (sha256
+                 (base32
+                  "06jlf84mx49scw3zm1wjj25zinr2yr9abiyh83rli78wb1hdc0l4"))))
+      (build-system emacs-build-system)
+      (arguments
+       (list #:phases
+             #~(modify-phases %standard-phases
+                 (add-after 'unpack 'hardcode-spike
+                   (lambda* (#:key inputs #:allow-other-keys)
+                     (emacs-substitute-variables "riscv-mode.el"
+                       ("riscv-interpreter"
+                        (search-input-file inputs "bin/spike"))))))))
+      (inputs (list spike))
+      (home-page "https://github.com/AdamNiederer/riscv-mode")
+      (synopsis "Emacs major mode for RISC-V assembly")
+      (description
+       "RISC-V mode is a major mode for editing RISC-V assembly programs.
+It includes syntax highlighting, syntactic indentation and code evaluation
+with spike.")
+      (license license:gpl3+))))
+
 (define-public emacs-validate-html
   ;; XXX: Upstream did not tag commits yet.  However, commit below matches the
   ;; last version bump.  Version is extracted from the keyword in main file.
-- 
2.39.2





This bug report was last modified 2 years and 78 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.