diff mbox series

[bug#72001,v2] gnu: Add icon.

Message ID 87zfqqprdv.fsf@antr.me
State New
Headers show
Series [bug#72001,v2] gnu: Add icon. | expand

Commit Message

Antero Mejr July 9, 2024, 2:33 p.m. UTC
* gnu/packages/esolangs.scm (icon): New variable.

Change-Id: Ibd61e5431a2a57b89b94391be87a9ca36a40c58b
Changes in v2:
- use #:test-target instead of replacing test phase.
- patch Makefile more to avoid phase modifications.
- use #:make-flags argument.
- organize output directory hierachy correctly.

Oleg: bash-minimal is required at runtime because icon does an unusual
thing where it embeds code into a shell script.

Also please merge the mailmap patch sent earlier along with this one.

 gnu/packages/esolangs.scm | 57 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)

base-commit: 13f0f52314244f08eb9fdd626d907c0c3976e06a
prerequisite-patch-id: f51bc060af7f806eb590f28f45d1f06c26b02812
diff mbox series


diff --git a/gnu/packages/esolangs.scm b/gnu/packages/esolangs.scm
index 0651dda1b0..f89bc875b9 100644
--- a/gnu/packages/esolangs.scm
+++ b/gnu/packages/esolangs.scm
@@ -4,6 +4,7 @@ 
 ;;; Copyright © 2020 Hendursaga <hendursaga@yahoo.com>
 ;;; Copyright © 2020 Liliana Marie Prikler <liliana.prikler@gmail.com>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
+;;; Copyright © 2024 Antero Mejr <mail@antr.me>
 ;;; This file is part of GNU Guix.
@@ -22,16 +23,19 @@ 
 (define-module (gnu packages esolangs)
   #:use-module (gnu packages)
+  #:use-module (gnu packages bash)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages python)
   #:use-module (gnu packages readline)
+  #:use-module (gnu packages xorg)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (guix download)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages))
@@ -156,3 +160,56 @@  (define-public shakespeare-spl
 If you want to assign a character, let's say Juliet, a positive value, you put
 her and another character on the stage and let that character praise Juliet.")
     (license license:gpl2+)))
+(define-public icon
+  (package
+    (name "icon")
+    (version "9.5.24a")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/gtownsend/icon")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0im1ikjyg14qvn4d31lpkhynaspws25m6whhb5xqwscq7xh4dy4p"))))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:make-flags #~(list "name=linux" (string-append "dest=" #$output))
+           #:parallel-build? #f ;non-deterministic errors
+           #:test-target "Test"
+           #:phases #~(modify-phases %standard-phases
+                        (add-before 'configure 'patch
+                          (lambda _
+                            (substitute* "Makefile"
+                              (("Install:") "install:")
+                              (("mkdir \\$D$") "")
+                              (("mkdir \\$D/bin") "mkdir -p $D/bin")
+                              (("\\$D/doc") "$D/share/doc/icon")
+                              (("cp README \\$D")
+                               "cp README $D/share/doc/icon"))
+                            (substitute* "tests/general/Test-opts"
+                              (("/usr/bin/env icon")
+                               "../../bin/icon"))
+                            (substitute* '("ipl/progs/shar.icn"
+                                           "ipl/progs/ipatch.icn"
+                                           "src/icont/link.c")
+                              (("/bin/sh")
+                               (string-append
+                                #$(this-package-input "bash-minimal")
+                                "/bin/bash")))))
+                        (replace 'configure
+                          (lambda* (#:key make-flags #:allow-other-keys)
+                            (apply invoke "make" "X-Configure"
+                                   make-flags))))))
+    (inputs (list bash-minimal libx11 libxpm libxt libxaw))
+    (home-page "https://www2.cs.arizona.edu/icon/")
+    (synopsis "String-processing programming language")
+    (description
+     "Icon is a high-level programming language with facilities for processing
+strings and structures, expressions that may produce sequences of results,
+goal-directed evaluation that automatically searches for a successful result,
+and string scanning that allows operations on strings to be formulated at a
+conceptual level.  Icon also provides high-level graphics facilities.")
+    (license license:public-domain)))