unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#51914] [PATCH 0/2] Fix asdf-build-system on non-package inputs
@ 2021-11-17  8:29 Pierre Neidhardt
  2021-11-17  8:33 ` [bug#51914] [PATCH 1/2] build-system/asdf: Don't fail in sbcl-package->cl-source-package " Pierre Neidhardt
       [not found] ` <handler.51914.B.16371377731213.ack@debbugs.gnu.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Pierre Neidhardt @ 2021-11-17  8:29 UTC (permalink / raw)
  To: 51914

cl-https-everywhere failed to build because sbcl-cl-https-everywhere had a
non-package input.

This should now be fixed.  This patchset adds the cl-https-everywhere package
as well as a proof-of-work.

Pierre Neidhardt (2):
  build-system/asdf: Don't fail in sbcl-package->cl-source-package on
    non-package inputs.
  gnu: Add cl-https-everywhere.

 gnu/packages/lisp-xyz.scm  | 82 ++++++++++++++++++++++++++++++++++++++
 guix/build-system/asdf.scm |  3 +-
 2 files changed, 84 insertions(+), 1 deletion(-)


base-commit: eb4edd7fde2e596bc2ec36ee773873722df46234
-- 
2.32.0





^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#51914] [PATCH 1/2] build-system/asdf: Don't fail in sbcl-package->cl-source-package on non-package inputs.
  2021-11-17  8:29 [bug#51914] [PATCH 0/2] Fix asdf-build-system on non-package inputs Pierre Neidhardt
@ 2021-11-17  8:33 ` Pierre Neidhardt
       [not found] ` <handler.51914.B.16371377731213.ack@debbugs.gnu.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Pierre Neidhardt @ 2021-11-17  8:33 UTC (permalink / raw)
  To: 51914

Inputs can be non-packages, for instance (origin ...).
sbcl-package->cl-source-package used to fail if such inputs were present in
the parent sbcl-* package.

* guix/build-system/asdf.scm (package-with-build-system): Fix
'has-from-build-system?' function.
---
 guix/build-system/asdf.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm
index b4e40ee8c2..538812d620 100644
--- a/guix/build-system/asdf.scm
+++ b/guix/build-system/asdf.scm
@@ -162,7 +162,8 @@ (define (transform-package-name name)
         name))
 
   (define (has-from-build-system? pkg)
-    (eq? from-build-system (package-build-system pkg)))
+    (when (package? pkg)
+      (eq? from-build-system (package-build-system pkg))))
 
   (define (find-input-package pkg)
     (let* ((name (package-name pkg))
-- 
2.32.0





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#51914] Acknowledgement ([PATCH 0/2] Fix asdf-build-system on non-package inputs)
       [not found] ` <handler.51914.B.16371377731213.ack@debbugs.gnu.org>
@ 2021-11-17  8:38   ` Pierre Neidhardt
  2021-11-17  9:01     ` Pierre Neidhardt
  2021-11-17 10:56     ` Guillaume Le Vaillant
  0 siblings, 2 replies; 9+ messages in thread
From: Pierre Neidhardt @ 2021-11-17  8:38 UTC (permalink / raw)
  To: 51914; +Cc: Guillaume Le Vaillant

[-- Attachment #1: Type: text/plain, Size: 30 bytes --]

Guillaume, what do you think?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#51914] Acknowledgement ([PATCH 0/2] Fix asdf-build-system on non-package inputs)
  2021-11-17  8:38   ` [bug#51914] Acknowledgement ([PATCH 0/2] Fix asdf-build-system on non-package inputs) Pierre Neidhardt
@ 2021-11-17  9:01     ` Pierre Neidhardt
  2021-11-17 10:36       ` zimoun
  2021-11-17 10:56     ` Guillaume Le Vaillant
  1 sibling, 1 reply; 9+ messages in thread
From: Pierre Neidhardt @ 2021-11-17  9:01 UTC (permalink / raw)
  To: 51914


[-- Attachment #1.1: Type: text/plain, Size: 62 bytes --]

`git send-email` failed to send the second patch, here it is.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-gnu-Add-cl-https-everywhere.patch --]
[-- Type: text/x-patch, Size: 4674 bytes --]

From 5b737d764f27124272a56aaeb64231836a16a667 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Tue, 16 Nov 2021 11:53:02 +0100
Subject: [PATCH 2/2] gnu: Add cl-https-everywhere.

* gnu/packages/lisp-xyz.scm (cl-https-everywhere, sbcl-cl-https-everywhere):
New variables.
---
 gnu/packages/lisp-xyz.scm | 82 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 4b17c173c9..da1a08edd7 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -19264,3 +19264,85 @@ (define-public sbcl-vernacular
 
 (define-public cl-vernacular
   (sbcl-package->cl-source-package sbcl-vernacular))
+
+(define-public sbcl-cl-https-everywhere
+  ;; No release.
+  (let ((commit "cbcc73b985a5b1c0ce0d4ec38bc982a0538d4bd8"))
+    (package
+      (name "sbcl-cl-https-everywhere")
+      (version (git-version "0.0.0" "1" commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/ruricolist/cl-https-everywhere/")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1wcvx1icwym1ncd6wl1wxzkyyndrm796caalbklvjd4a2cbl3xxi"))))
+      (build-system asdf-build-system/sbcl)
+      (inputs
+       `(("alexandria" ,sbcl-alexandria)
+         ("global-vars" ,sbcl-global-vars)
+         ("parenscript" ,sbcl-parenscript)
+         ("cl-markdown" ,sbcl-cl-markdown)
+         ("cl-tld" ,sbcl-cl-tld)
+         ("fxml" ,sbcl-fxml)
+         ("overlord" ,sbcl-overlord)
+         ("ppcre" ,sbcl-cl-ppcre)
+         ("serapeum" ,sbcl-serapeum)
+         ("trivial-gray-streams" ,sbcl-trivial-gray-streams)
+         ("vernacular" ,sbcl-vernacular)))
+      (native-inputs
+       `(("fiveam" ,sbcl-fiveam)
+         ("https-everywhere"
+          ,(let ((commit "78d3425aef62d79da2c63c0fcd89ae9837af9a09"))
+             (origin
+               (method git-fetch)
+               (uri (git-reference
+                     (url "https://github.com/EFForg/https-everywhere")
+                     (commit commit)))
+               (file-name (git-file-name "https-everywhere"
+                                         (git-version "2021.7.13" "1" commit)))
+               (sha256
+                (base32
+                 "1bx5895lbsddx449mcvvss4dlvi07xsh4d2qnajsdvais6fpckh8")))))))
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'link-https-everywhere-repo
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((https-everywhere (assoc-ref inputs "https-everywhere")))
+                 (symlink https-everywhere "https-everywhere"))))
+           (add-after 'unpack 'fix-overlord-build
+             ;; Upstream bugs?  See
+             ;; https://github.com/ruricolist/cl-https-everywhere/issues/1.
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (rulesets.xml (string-append out "/share/common-lisp/" (%lisp-type)
+                                                   "/cl-https-everywhere/rulesets.xml")))
+                 (substitute* "build.lisp"
+                   (("\\(depends-on https-everywhere-version\\)") "")
+                   ;; Don't rebuild the rulesets just because the timestamp is epoch.
+                   (("\\(vernacular:require-default :cl-https-everywhere/rulesets-file \"rulesets.xml\"\\)")
+                    (format #f "(if (uiop:file-exists-p ~s)
+      (compile-rulesets ~s)
+      (vernacular:require-default :cl-https-everywhere/rulesets-file \"rulesets.xml\"))"
+                            rulesets.xml
+                            rulesets.xml))
+                   (("\\(uiop:parse-unix-namestring \"https-everywhere/src/chrome/content/rules/\\*\\.xml\")")
+                    "\"https-everywhere/src/chrome/content/rules/*.xml\"")
+                   (("\\(out temp :external-format :utf-8\\)")
+                    "(out temp :external-format :utf-8 :if-exists :supersede)")))
+               #t)))))
+      (home-page "https://github.com/ruricolist/cl-https-everywhere/")
+      (synopsis "Use HTTPS Everywhere rules from Lisp")
+      (description
+       "CL-HTTPS-EVERYWHERE parses HTTPS Everywhere rulesets and makes them
+available for use in Lisp programs.")
+      (license (list license:expat
+                     ;; For the ruleset
+                     license:gpl2+)))))
+
+(define-public cl-https-everywhere
+  (sbcl-package->cl-source-package sbcl-cl-https-everywhere))
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#51914] Acknowledgement ([PATCH 0/2] Fix asdf-build-system on non-package inputs)
  2021-11-17  9:01     ` Pierre Neidhardt
@ 2021-11-17 10:36       ` zimoun
  0 siblings, 0 replies; 9+ messages in thread
From: zimoun @ 2021-11-17 10:36 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 51914

Hi Pierre,

On Wed, 17 Nov 2021 at 10:01, Pierre Neidhardt <mail@ambrevar.xyz> wrote:

> +         ("https-everywhere"
> +          ,(let ((commit "78d3425aef62d79da2c63c0fcd89ae9837af9a09"))
> +             (origin
> +               (method git-fetch)
> +               (uri (git-reference
> +                     (url "https://github.com/EFForg/https-everywhere")
> +                     (commit commit)))
> +               (file-name (git-file-name "https-everywhere"
> +                                         (git-version "2021.7.13" "1" commit)))

Commit 78d3425aef62d79da2c63c0fcd89ae9837af9a09 the most recent on
master.  Is tag 2021.7.13 (commit 79252541) not enough?  Which is the
last release if I understand correctly?

Cheers,
simon




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#51914] Acknowledgement ([PATCH 0/2] Fix asdf-build-system on non-package inputs)
  2021-11-17  8:38   ` [bug#51914] Acknowledgement ([PATCH 0/2] Fix asdf-build-system on non-package inputs) Pierre Neidhardt
  2021-11-17  9:01     ` Pierre Neidhardt
@ 2021-11-17 10:56     ` Guillaume Le Vaillant
  2021-11-17 12:40       ` Pierre Neidhardt
  1 sibling, 1 reply; 9+ messages in thread
From: Guillaume Le Vaillant @ 2021-11-17 10:56 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 51914

[-- Attachment #1: Type: text/plain, Size: 774 bytes --]

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm
> index b4e40ee8c2..538812d620 100644
> --- a/guix/build-system/asdf.scm
> +++ b/guix/build-system/asdf.scm
> @@ -162,7 +162,8 @@ (define (transform-package-name name)
>          name))
>  
>    (define (has-from-build-system? pkg)
> -    (eq? from-build-system (package-build-system pkg)))
> +    (when (package? pkg)
> +      (eq? from-build-system (package-build-system pkg))))
>  
>    (define (find-input-package pkg)
>      (let* ((name (package-name pkg))

Maybe use "(and (package? pkg) (eq? ...))" instead of "(when ...)" so
that the function returns #f instead of returning nothing when pkg is
not a package.
Otherwise LGTM.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#51914] Acknowledgement ([PATCH 0/2] Fix asdf-build-system on non-package inputs)
  2021-11-17 10:56     ` Guillaume Le Vaillant
@ 2021-11-17 12:40       ` Pierre Neidhardt
  2021-11-18  7:57         ` Pierre Neidhardt
  0 siblings, 1 reply; 9+ messages in thread
From: Pierre Neidhardt @ 2021-11-17 12:40 UTC (permalink / raw)
  To: Guillaume Le Vaillant; +Cc: 51914


[-- Attachment #1.1: Type: text/plain, Size: 50 bytes --]

Thank you both for the feedback.
See v2 attached.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-build-system-asdf-Don-t-fail-in-sbcl-package-cl-sour.patch --]
[-- Type: text/x-patch, Size: 1125 bytes --]

From 7386f42a115b29a1603ca6f3887f29fbb927c2bb Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Wed, 17 Nov 2021 09:09:42 +0100
Subject: [v2 1/2] build-system/asdf: Don't fail in
 sbcl-package->cl-source-package on non-package inputs.

Inputs can be non-packages, for instance (origin ...).
sbcl-package->cl-source-package used to fail if such inputs were present in
the parent sbcl-* package.

* guix/build-system/asdf.scm (package-with-build-system): Fix
'has-from-build-system?' function.
---
 guix/build-system/asdf.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/guix/build-system/asdf.scm b/guix/build-system/asdf.scm
index b4e40ee8c2..4edf6857b5 100644
--- a/guix/build-system/asdf.scm
+++ b/guix/build-system/asdf.scm
@@ -162,7 +162,8 @@ (define (transform-package-name name)
         name))
 
   (define (has-from-build-system? pkg)
-    (eq? from-build-system (package-build-system pkg)))
+    (and (package? pkg)
+         (eq? from-build-system (package-build-system pkg))))
 
   (define (find-input-package pkg)
     (let* ((name (package-name pkg))
-- 
2.32.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-gnu-Add-cl-https-everywhere.patch --]
[-- Type: text/x-patch, Size: 4628 bytes --]

From ba935720720aeeaa0f885d04c9879cee43d44c43 Mon Sep 17 00:00:00 2001
From: Pierre Neidhardt <mail@ambrevar.xyz>
Date: Tue, 16 Nov 2021 11:53:02 +0100
Subject: [v2 2/2] gnu: Add cl-https-everywhere.

* gnu/packages/lisp-xyz.scm (cl-https-everywhere, sbcl-cl-https-everywhere):
New variables.
---
 gnu/packages/lisp-xyz.scm | 82 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 82 insertions(+)

diff --git a/gnu/packages/lisp-xyz.scm b/gnu/packages/lisp-xyz.scm
index 4b17c173c9..f9907e84f6 100644
--- a/gnu/packages/lisp-xyz.scm
+++ b/gnu/packages/lisp-xyz.scm
@@ -19264,3 +19264,85 @@ (define-public sbcl-vernacular
 
 (define-public cl-vernacular
   (sbcl-package->cl-source-package sbcl-vernacular))
+
+(define-public sbcl-cl-https-everywhere
+  ;; No release.
+  ;; Don't forget to update the https-everywhere input.
+  (let ((commit "cbcc73b985a5b1c0ce0d4ec38bc982a0538d4bd8"))
+    (package
+      (name "sbcl-cl-https-everywhere")
+      (version (git-version "0.0.0" "1" commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/ruricolist/cl-https-everywhere/")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1wcvx1icwym1ncd6wl1wxzkyyndrm796caalbklvjd4a2cbl3xxi"))))
+      (build-system asdf-build-system/sbcl)
+      (inputs
+       `(("alexandria" ,sbcl-alexandria)
+         ("global-vars" ,sbcl-global-vars)
+         ("parenscript" ,sbcl-parenscript)
+         ("cl-markdown" ,sbcl-cl-markdown)
+         ("cl-tld" ,sbcl-cl-tld)
+         ("fxml" ,sbcl-fxml)
+         ("overlord" ,sbcl-overlord)
+         ("ppcre" ,sbcl-cl-ppcre)
+         ("serapeum" ,sbcl-serapeum)
+         ("trivial-gray-streams" ,sbcl-trivial-gray-streams)
+         ("vernacular" ,sbcl-vernacular)))
+      (native-inputs
+       `(("fiveam" ,sbcl-fiveam)
+         ("https-everywhere"
+          ,(let ((version "2021.7.13"))
+             (origin
+               (method git-fetch)
+               (uri (git-reference
+                     (url "https://github.com/EFForg/https-everywhere")
+                     (commit version)))
+               (file-name (git-file-name "https-everywhere" version))
+               (sha256
+                (base32
+                 "1k5gj29imhxf47sv3d8rxyrgr6k65scp2fm040va3nfshayslzia")))))))
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'link-https-everywhere-repo
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((https-everywhere (assoc-ref inputs "https-everywhere")))
+                 (symlink https-everywhere "https-everywhere"))))
+           (add-after 'unpack 'fix-overlord-build
+             ;; Upstream bugs?  See
+             ;; https://github.com/ruricolist/cl-https-everywhere/issues/1.
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (rulesets.xml (string-append out "/share/common-lisp/" (%lisp-type)
+                                                   "/cl-https-everywhere/rulesets.xml")))
+                 (substitute* "build.lisp"
+                   (("\\(depends-on https-everywhere-version\\)") "")
+                   ;; Don't rebuild the rulesets just because the timestamp is epoch.
+                   (("\\(vernacular:require-default :cl-https-everywhere/rulesets-file \"rulesets.xml\"\\)")
+                    (format #f "(if (uiop:file-exists-p ~s)
+      (compile-rulesets ~s)
+      (vernacular:require-default :cl-https-everywhere/rulesets-file \"rulesets.xml\"))"
+                            rulesets.xml
+                            rulesets.xml))
+                   (("\\(uiop:parse-unix-namestring \"https-everywhere/src/chrome/content/rules/\\*\\.xml\")")
+                    "\"https-everywhere/src/chrome/content/rules/*.xml\"")
+                   (("\\(out temp :external-format :utf-8\\)")
+                    "(out temp :external-format :utf-8 :if-exists :supersede)")))
+               #t)))))
+      (home-page "https://github.com/ruricolist/cl-https-everywhere/")
+      (synopsis "Use HTTPS Everywhere rules from Lisp")
+      (description
+       "CL-HTTPS-EVERYWHERE parses HTTPS Everywhere rulesets and makes them
+available for use in Lisp programs.")
+      (license (list license:expat
+                     ;; For the ruleset
+                     license:gpl2+)))))
+
+(define-public cl-https-everywhere
+  (sbcl-package->cl-source-package sbcl-cl-https-everywhere))
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#51914] Acknowledgement ([PATCH 0/2] Fix asdf-build-system on non-package inputs)
  2021-11-17 12:40       ` Pierre Neidhardt
@ 2021-11-18  7:57         ` Pierre Neidhardt
  2021-11-18 10:06           ` Guillaume Le Vaillant
  0 siblings, 1 reply; 9+ messages in thread
From: Pierre Neidhardt @ 2021-11-18  7:57 UTC (permalink / raw)
  To: Guillaume Le Vaillant; +Cc: 51914

[-- Attachment #1: Type: text/plain, Size: 40 bytes --]

OK to merge then?
On master or staging?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#51914] Acknowledgement ([PATCH 0/2] Fix asdf-build-system on non-package inputs)
  2021-11-18  7:57         ` Pierre Neidhardt
@ 2021-11-18 10:06           ` Guillaume Le Vaillant
  0 siblings, 0 replies; 9+ messages in thread
From: Guillaume Le Vaillant @ 2021-11-18 10:06 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 51914

[-- Attachment #1: Type: text/plain, Size: 128 bytes --]

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> OK to merge then?
> On master or staging?

It think it should be OK on master.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-11-18 10:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-17  8:29 [bug#51914] [PATCH 0/2] Fix asdf-build-system on non-package inputs Pierre Neidhardt
2021-11-17  8:33 ` [bug#51914] [PATCH 1/2] build-system/asdf: Don't fail in sbcl-package->cl-source-package " Pierre Neidhardt
     [not found] ` <handler.51914.B.16371377731213.ack@debbugs.gnu.org>
2021-11-17  8:38   ` [bug#51914] Acknowledgement ([PATCH 0/2] Fix asdf-build-system on non-package inputs) Pierre Neidhardt
2021-11-17  9:01     ` Pierre Neidhardt
2021-11-17 10:36       ` zimoun
2021-11-17 10:56     ` Guillaume Le Vaillant
2021-11-17 12:40       ` Pierre Neidhardt
2021-11-18  7:57         ` Pierre Neidhardt
2021-11-18 10:06           ` Guillaume Le Vaillant

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).