[PATCH 2/2] gnu: Add sbcl-ciel-repl.

  • Done
  • quality assurance status badge
Details
2 participants
  • Guillaume Le Vaillant
  • Konrad Hinsen
Owner
unassigned
Submitted by
Konrad Hinsen
Severity
normal

Debbugs page

K
K
Konrad Hinsen wrote on 5 Sep 12:43 -0700
(address . guix-patches@gnu.org)
m1ed5xga34.fsf@fastmail.net
* gnu/packages/lisp-xyz.scm (sbcl-ciel-repl): New variable.

Change-Id: I85eabe27d35a6d540a634f4121209b59a6c7085b
---
gnu/packages/lisp-xyz.scm | 69 +++++++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+)

Toggle diff (82 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index c22d5f6565..536b4029dc 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -3563,6 +3563,75 @@ (define-public cl-ciel
(define-public ecl-ciel
(sbcl-package->ecl-package sbcl-ciel))
+(define-public sbcl-ciel-repl
+ (let ((commit "0b26d64dcd91a3a2aa962842629a853261dd30fe")
+ (version "0.2.1"))
+ (package
+ (name "sbcl-ciel-repl")
+ (version version)
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/khinsen/CIEL")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0gm8slnz4jw98rkijnh2dp6x629xdnfk8z7j35g03j6ypr56v06h"))
+ (patches (search-patches "ciel-repl.patch"))))
+ (build-system asdf-build-system/sbcl)
+ (inputs
+ (list sbcl-ciel
+ sbcl-cl-readline
+ sbcl-lisp-critic
+ sbcl-magic-ed))
+ (arguments
+ (list
+ #:asd-systems ''("ciel/repl")
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; The built-in scripts require special care. They are
+ ;; read from src/scripts in the current directory.
+ ;; When the binary is built, the current directory is
+ ;; {out}/bin, so the scripts have to be copied there,
+ ;; but that copy must be deleted after the binary has been
+ ;; built, otherwise it would end up in the package.
+ (add-after 'create-asdf-configuration 'install-scripts
+ (lambda _
+ (let ((dir (string-append #$output "/bin/src/scripts")))
+ (for-each (lambda (file)
+ (install-file file dir))
+ (find-files "src/scripts" "\\.lisp$")))))
+ (add-after 'install-scripts 'build-program
+ (lambda* (#:key outputs #:allow-other-keys)
+ (build-program
+ (string-append #$output "/bin/ciel")
+ outputs
+ #:entry-program '((ciel::main))
+ #:dependencies '("ciel/repl")
+ #:compress? #t)))
+ (add-after 'build-program 'delete-scripts
+ (lambda _
+ (let ((dir (string-append #$output "/bin/src")))
+ (delete-file-recursively dir))))
+ ;; Remove everything except the binary.
+ (add-after 'delete-scripts 'delete-lisp-files
+ (lambda _
+ (let ((dir (string-append #$output "/etc")))
+ (delete-file-recursively dir))
+ (let ((dir (string-append #$output "/lib")))
+ (delete-file-recursively dir))
+ (let ((dir (string-append #$output "/share")))
+ (delete-file-recursively dir))
+ (let ((dir (string-append #$output "/.asd-files")))
+ (delete-file-recursively dir)))))))
+ (home-page "http://ciel-lang.org/")
+ (synopsis "Terminal REPL for CIEL")
+ (description
+ "CIEL as a precompiled binary and a full-featured REPL
+for the terminal.")
+ (license license:expat))))
+
(define-public sbcl-circular-streams
(let ((commit "e770bade1919c5e8533dd2078c93c3d3bbeb38df")
(revision "1"))
--
2.45.2
G
G
Guillaume Le Vaillant wrote on 6 Sep 02:25 -0700
(name . Konrad Hinsen)(address . konrad.hinsen@fastmail.net)(address . 73057@debbugs.gnu.org)
871q1xjfqc.fsf@kitej
Konrad Hinsen <konrad.hinsen@fastmail.net> skribis:

Toggle quote (25 lines)
> diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
> index c22d5f6565..536b4029dc 100644
> --- a/gnu/packages/lisp-xyz.scm
> +++ b/gnu/packages/lisp-xyz.scm
> @@ -3563,6 +3563,75 @@ (define-public cl-ciel
> (define-public ecl-ciel
> (sbcl-package->ecl-package sbcl-ciel))
>
> +(define-public sbcl-ciel-repl
> + (let ((commit "0b26d64dcd91a3a2aa962842629a853261dd30fe")
> + (version "0.2.1"))
> + (package
> + (name "sbcl-ciel-repl")
> + (version version)
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/khinsen/CIEL")
> + (commit commit)))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32 "0gm8slnz4jw98rkijnh2dp6x629xdnfk8z7j35g03j6ypr56v06h"))
> + (patches (search-patches "ciel-repl.patch"))))

Is there a reason to take the sources from
https://github.com/khinsen/CIEL instead of the upstream repository at

The "ciel-repl.patch" referenced in the 'source' field is missing.
Could you send an updated patch?
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCZtrKmw8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j/SoAD/e0frZacerI4eOSsdKqVlsQDIUIPNUYahS9NB
RoiAYosBAKU80lIyEbjJnUDpy1ogTPEXWeezsGfl7hPKNziOhu9C
=xc1P
-----END PGP SIGNATURE-----

K
K
Konrad Hinsen wrote on 6 Sep 05:26 -0700
(name . Guillaume Le Vaillant)(address . glv@posteo.net)(address . 73057@debbugs.gnu.org)
m1le05rms7.fsf@fastmail.net
Guillaume Le Vaillant <glv@posteo.net> writes:

Toggle quote (4 lines)
> Is there a reason to take the sources from
> <https://github.com/khinsen/CIEL> instead of the upstream repository at
> <https://github.com/ciel-lang/CIEL>?

Oops, sorry! I used my own fork for testing, but it is no longer
relevant for the final package version.

Toggle quote (3 lines)
> The "ciel-repl.patch" referenced in the 'source' field is missing.
> Could you send an updated patch?

Oops again...

I'll send a new patch in a few seconds!

Cheers,
Konrad.
K
K
Konrad Hinsen wrote on 6 Sep 05:27 -0700
[PATCH 2/2] gnu: Add sbcl-ciel-repl.
(address . 73057@debbugs.gnu.org)
m1ikv9rmpv.fsf@fastmail.net
* gnu/packages/lisp-xyz.scm (sbcl-ciel-repl): New variable.

Change-Id: I85eabe27d35a6d540a634f4121209b59a6c7085b
---
gnu/packages/lisp-xyz.scm | 69 ++++++++++++++++++++++++++++
gnu/packages/patches/ciel-repl.patch | 31 +++++++++++++
2 files changed, 100 insertions(+)
create mode 100644 gnu/packages/patches/ciel-repl.patch

Toggle diff (119 lines)
diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index c22d5f6565..3427dbec0f 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -3563,6 +3563,75 @@ (define-public cl-ciel
(define-public ecl-ciel
(sbcl-package->ecl-package sbcl-ciel))
+(define-public sbcl-ciel-repl
+ (let ((commit "0b26d64dcd91a3a2aa962842629a853261dd30fe")
+ (version "0.2.1"))
+ (package
+ (name "sbcl-ciel-repl")
+ (version version)
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/ciel-lang/CIEL")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0gm8slnz4jw98rkijnh2dp6x629xdnfk8z7j35g03j6ypr56v06h"))
+ (patches (search-patches "ciel-repl.patch"))))
+ (build-system asdf-build-system/sbcl)
+ (inputs
+ (list sbcl-ciel
+ sbcl-cl-readline
+ sbcl-lisp-critic
+ sbcl-magic-ed))
+ (arguments
+ (list
+ #:asd-systems ''("ciel/repl")
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; The built-in scripts require special care. They are
+ ;; read from src/scripts in the current directory.
+ ;; When the binary is built, the current directory is
+ ;; {out}/bin, so the scripts have to be copied there,
+ ;; but that copy must be deleted after the binary has been
+ ;; built, otherwise it would end up in the package.
+ (add-after 'create-asdf-configuration 'install-scripts
+ (lambda _
+ (let ((dir (string-append #$output "/bin/src/scripts")))
+ (for-each (lambda (file)
+ (install-file file dir))
+ (find-files "src/scripts" "\\.lisp$")))))
+ (add-after 'install-scripts 'build-program
+ (lambda* (#:key outputs #:allow-other-keys)
+ (build-program
+ (string-append #$output "/bin/ciel")
+ outputs
+ #:entry-program '((ciel::main))
+ #:dependencies '("ciel/repl")
+ #:compress? #t)))
+ (add-after 'build-program 'delete-scripts
+ (lambda _
+ (let ((dir (string-append #$output "/bin/src")))
+ (delete-file-recursively dir))))
+ ;; Remove everything except the binary.
+ (add-after 'delete-scripts 'delete-lisp-files
+ (lambda _
+ (let ((dir (string-append #$output "/etc")))
+ (delete-file-recursively dir))
+ (let ((dir (string-append #$output "/lib")))
+ (delete-file-recursively dir))
+ (let ((dir (string-append #$output "/share")))
+ (delete-file-recursively dir))
+ (let ((dir (string-append #$output "/.asd-files")))
+ (delete-file-recursively dir)))))))
+ (home-page "http://ciel-lang.org/")
+ (synopsis "Terminal REPL for CIEL")
+ (description
+ "CIEL as a precompiled binary and a full-featured REPL
+for the terminal.")
+ (license license:expat))))
+
(define-public sbcl-circular-streams
(let ((commit "e770bade1919c5e8533dd2078c93c3d3bbeb38df")
(revision "1"))
diff --git a/gnu/packages/patches/ciel-repl.patch b/gnu/packages/patches/ciel-repl.patch
new file mode 100644
index 0000000000..ab4dfdd793
--- /dev/null
+++ b/gnu/packages/patches/ciel-repl.patch
@@ -0,0 +1,31 @@
+The standard CIEL REPL includes Quicklisp. We remove it for packaging
+with Guix.
+
+The default Quicklisp-based build procedure removes one dependency
+relation from the system definition for ciel/repl and replaces it by
+an explicit load command using Quicklisp, as a workaround to some build
+issue. Fortunately we don't have this issue with Guix, so we go back
+to letting ASDF manage this dependency relation.
+
+--- a/repl.lisp
++++ b/repl.lisp
+@@ -1,8 +1,5 @@
+ ;; #!/usr/bin/sbcl --script
+-(load "~/quicklisp/setup")
+
+-(let ((*standard-output* (make-broadcast-stream)))
+- (ql:quickload "cl-readline"))
+ (uiop:define-package :sbcli
+ (:use :common-lisp :trivial-package-local-nicknames)
+ (:import-from :magic-ed
+--- a/ciel.asd
++++ b/ciel.asd
+@@ -179,7 +179,7 @@
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ (asdf:defsystem "ciel/repl"
+ :description "readline REPL for CIEL with quality of life improvements."
+- :depends-on (;; :ciel ;; let's avoid, it could run side effects twice (like a defparameter set then reset).
++ :depends-on (:ciel
+ ;; deps
+ :cl-readline
+ :lisp-critic ;; it would be nice to integrate it with Slime.
--
2.45.2
G
G
Guillaume Le Vaillant wrote on 7 Sep 04:35 -0700
(name . Konrad Hinsen)(address . konrad.hinsen@fastmail.net)(address . 73057-done@debbugs.gnu.org)
87h6ary9vn.fsf@kitej
I registered the new patch file in "gnu/local.mk" and I applied the
patch as 683cbb283a9fce9ef8ed9ef71ba9a79d0a467670.
Thanks.
-----BEGIN PGP SIGNATURE-----

iIUEAREKAC0WIQTLxZxm7Ce5cXlAaz5r6CCK3yH+PwUCZtw6fA8cZ2x2QHBvc3Rl
by5uZXQACgkQa+ggit8h/j8rMQEAgxiO3y2Oasyd5IbjoLJfsQxyQcIYnhrW14rz
aShGIn4A/j7PutOlrzp0JqHf9n4LrZZxCfPTAVO2nZj4aAzE99Yv
=wYPb
-----END PGP SIGNATURE-----

Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 73057@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 73057
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