[PATCH 1/2] gnu: Add icon.

  • Open
  • quality assurance status badge
Details
2 participants
  • Antero Mejr
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Antero Mejr
Severity
normal
A
A
Antero Mejr wrote on 9 Jul 01:04 +0200
(address . guix-patches@gnu.org)
87v81fjxj9.fsf@antr.me
* gnu/packages/esolangs.scm (icon): New variable.

Change-Id: Ibd61e5431a2a57b89b94391be87a9ca36a40c58b
---
gnu/packages/esolangs.scm | 60 +++++++++++++++++++++++++++++++++++++++
1 file changed, 60 insertions(+)

Toggle diff (96 lines)
diff --git a/gnu/packages/esolangs.scm b/gnu/packages/esolangs.scm
index 0651dda1b0..59790812f0 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,59 @@ (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 #:parallel-build? #f ;non-deterministic errors
+ #:phases #~(modify-phases %standard-phases
+ (add-before 'configure 'patch
+ (lambda _
+ (substitute* "Makefile"
+ (("mkdir \\$D$") ""))
+ (substitute* "tests/general/Test-opts"
+ (("/usr/bin/env icon")
+ "../../bin/icon"))
+ (for-each
+ (lambda (x)
+ (substitute* x
+ (("/bin/sh")
+ (string-append
+ #$(this-package-input "bash-minimal")
+ "/bin/bash"))))
+ '("ipl/progs/shar.icn"
+ "ipl/progs/ipatch.icn"
+ "src/icont/link.c"))))
+ (replace 'configure
+ (lambda _
+ (invoke "make" "X-Configure" "name=linux")))
+ (replace 'install
+ (lambda _
+ (invoke "make" "Install"
+ (string-append "dest=" #$output))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "make" "Test")))))))
+ (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)))

base-commit: 13f0f52314244f08eb9fdd626d907c0c3976e06a
--
2.45.2
A
A
Antero Mejr wrote on 9 Jul 01:07 +0200
[PATCH 2/2] mailmap: Add alias for Antero Mejr.
(address . 72001@debbugs.gnu.org)
87r0c3jxdc.fsf@antr.me
* .mailmap: Map old emails for Antero Mejr to current address.

Change-Id: Ifb4a3b9ad2e08b9d6ddbab7508586e8ece75fda8
---
.mailmap | 2 ++
1 file changed, 2 insertions(+)

Toggle diff (15 lines)
diff --git a/.mailmap b/.mailmap
index 39b01335ee..833976fe79 100644
--- a/.mailmap
+++ b/.mailmap
@@ -11,6 +11,8 @@ Amirouche Boubekki <amirouche@hypermove.net>
Andreas Enge <andreas@enge.fr> <andreas.enge@inria.fr>
Andreas Enge <andreas@enge.fr> <privat@xobs-novena>
Andy Wingo <wingo@igalia.com> <wingo@pobox.com>
+Antero Mejr <mail@antr.me> <antero@kodmin.com>
+Antero Mejr <mail@antr.me> <antero@mailbox.org>
Ben Woodcroft <donttrustben@gmail.com>
Ben Woodcroft <donttrustben@gmail.com> <b.woodcroft@uq.edu.au>
Ben Woodcroft <donttrustben@gmail.com> <donttrustben near gmail.com>
--
2.45.2
S
S
Sharlatan Hellseher wrote on 9 Jul 11:02 +0200
[PATCH 1/2] gnu: Add icon.
(address . 72001@debbugs.gnu.org)
87bk376ir3.fsf@gmail.com
Hi,

Thank you for the patches.

QA looks happy on most systems. There are some adjustment which may be
applied:

Toggle snippet (12 lines)
+ (for-each
+ (lambda (x)
+ (substitute* x
+ (("/bin/sh")
+ (string-append
+ #$(this-package-input "bash-minimal")
+ "/bin/bash"))))
+ '("ipl/progs/shar.icn"
+ "ipl/progs/ipatch.icn"
+ "src/icont/link.c"))))

SUBSTITUTE* supports a list of files and this part may be simplified e.g.

Toggle snippet (7 lines)
(substitute* '("ipl/progs/shar.icn"
"ipl/progs/ipatch.icn"
"src/icont/link.c")
(("/bin/sh")
(string-append #$(this-package-input "bash-minimal") "/bin/bash")))

It looks like upstream prefers esoteric approach in Makefile as well,
IMHO the standard phases may be preserved with patching Makefile targets
while providing <#:configure-flags> or <#:make-flags>:

Toggle snippet (13 lines)
+ (replace 'configure
+ (lambda _
+ (invoke "make" "X-Configure" "name=linux")))
+ (replace 'install
+ (lambda _
+ (invoke "make" "Install"
+ (string-append "dest=" #$output))))
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ (invoke "make" "Test")))))))

Is Bash required during runtime as well? If not we may place it in
NATIVE-INPUTS:

Toggle snippet (3 lines)
+ (inputs (list bash-minimal libx11 libxpm libxt libxaw))

Looking forward for v2!

--
Oleg
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEmEeB3micIcJkGAhndtcnv/Ys0rUFAmaM/JAACgkQdtcnv/Ys
0rXq0Q//RoP6hasNx+VSDrOZZC6oqWDc194m79r7B5I76mLZrz5+sPshxPTXz8xp
niECu075iLTdWdZQgWe6BWbpClsYagYyr7dbHZXAma1PMiRzWLybEUcGUlM6rNob
/MBb2muKcGrRJ4mxMeo9vxrzU0Pz1r+v+V8yRbJcBosgW+Q7jVk0So8jAwIcALzt
SxgIySGIK3lDJaix4mHUu+QhvY2rOymxIboxNdzAOVM3XkEYa3E6mPR7ch9fXrvE
tHaftqf/hUQ+7tlRwoH+T1qK/kuN7zMm7rmG2tOLhYL7QoRz34jn6JcFZjLYvB1p
PeZJ42bbIxXpgmm/fHzRaHF9p5ho7TkFGDplTbYavghy5IA14Ys/XZH5bQn6+gK8
4J3vvNV/9idePinn+Y2yYq7d3wR3Fxmh5Fsqt2l2xg6uE8nuxkypHcNJzTjLQJST
lUzDbb+OAMM6+W8OeXBAGxSRdlRsmGf6owfMVJFpMPgAJoyggge5+20OUL9/5YKs
1a37uRUfp8TO0s7lBxOw0h/06hxvu7uqmKzzolQbv8vansXpFk5HJWiFHJTwClcQ
gmquMnsBkNAp/nPSywJwcFZoOGqLO8cMWiwbWbTduhWSPFqt2mKZ/gh8vLni9N7p
OTMHQyGp5hVTmTEamMUh182wJAgSCyVacSCVpLbw2PHMN81achQ=
=voCM
-----END PGP SIGNATURE-----

A
A
Antero Mejr wrote on 9 Jul 16:33 +0200
[PATCH v2] gnu: Add icon.
(address . 72001@debbugs.gnu.org)(address . sharlatanus@gmail.com)
87zfqqprdv.fsf@antr.me
* 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.
Thanks.

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

Toggle diff (94 lines)
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)))

base-commit: 13f0f52314244f08eb9fdd626d907c0c3976e06a
prerequisite-patch-id: f51bc060af7f806eb590f28f45d1f06c26b02812
--
2.45.2
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 72001@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 72001
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch