unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Guillaume Le Vaillant <glv@posteo.net>
To: Pierre Neidhardt <mail@ambrevar.xyz>
Cc: 45017@debbugs.gnu.org
Subject: bug#45017: asdf-build-system packages have priority over user ones
Date: Thu, 03 Dec 2020 15:29:10 +0100	[thread overview]
Message-ID: <87ft4n2cax.fsf@yamatai> (raw)
In-Reply-To: <87360nm5b1.fsf@ambrevar.xyz>


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


Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> Alternately, we could simply move the patch from
> user-source-registry-directory to system-source-registry-directory; same
> for the output translation.

What do you think of the attached patch? Does it work for you?

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-cl-asdf-Improve-priorities-of-configuration-file.patch --]
[-- Type: text/x-patch, Size: 5827 bytes --]

From cb8d52ec606bb8984622f6b117346b4772bf0d16 Mon Sep 17 00:00:00 2001
From: Guillaume Le Vaillant <glv@posteo.net>
Date: Thu, 3 Dec 2020 14:52:02 +0100
Subject: [PATCH] gnu: cl-asdf: Improve priorities of configuration file
 search.

* gnu/packages/patches/cl-asdf-config-directories.patch: New file.
* gnu/local.mk (dist_PATCH_DATA): Add it.
* gnu/packages/lisp.scm (cl-asdf)[native-inputs]: Add it.
  [arguments]: Apply the new patch.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/lisp.scm                         | 28 +++++----------
 .../patches/cl-asdf-config-directories.patch  | 36 +++++++++++++++++++
 3 files changed, 45 insertions(+), 20 deletions(-)
 create mode 100644 gnu/packages/patches/cl-asdf-config-directories.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 28ad119846..f838ebe1fa 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -868,6 +868,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/cdrtools-3.01-mkisofs-isoinfo.patch 	\
   %D%/packages/patches/ceph-disable-cpu-optimizations.patch	\
   %D%/packages/patches/chmlib-inttypes.patch			\
+  %D%/packages/patches/cl-asdf-config-directories.patch		\
   %D%/packages/patches/clamav-config-llvm-libs.patch		\
   %D%/packages/patches/clamav-system-tomsfastmath.patch		\
   %D%/packages/patches/clang-3.5-libc-search-path.patch		\
diff --git a/gnu/packages/lisp.scm b/gnu/packages/lisp.scm
index e4c963070e..0038cb0dca 100644
--- a/gnu/packages/lisp.scm
+++ b/gnu/packages/lisp.scm
@@ -90,6 +90,9 @@
        (sha256
         (base32 "1hpx30f6yrak15nw992k7x3pn75ahvjs04n4f134k68mhgs62km2"))))
     (build-system trivial-build-system)
+    (native-inputs
+     `(("config-patch" ,@(search-patches "cl-asdf-config-directories.patch"))
+       ("patch" ,patch)))
     (arguments
      `(#:modules ((guix build utils)
                   (guix build lisp-utils))
@@ -101,28 +104,13 @@
                 (asdf-install (string-append out %source-install-prefix
                                              "/source/asdf/"))
                 (src-asdf (string-append (assoc-ref %build-inputs "source")))
-                (dst-asdf (string-append asdf-install "asdf.lisp")))
+                (dst-asdf (string-append asdf-install "asdf.lisp"))
+                (patch (string-append (assoc-ref %build-inputs "patch")
+                                      "/bin/patch"))
+                (config-patch (assoc-ref %build-inputs "config-patch")))
            (mkdir-p asdf-install)
            (copy-file src-asdf dst-asdf)
-           ;; Patch ASDF to make it read the configuration files in all
-           ;; the direcories listed in '$XDG_CONFIG_DIRS' instead of just
-           ;; the first.
-           (substitute* dst-asdf
-             (("\\(xdg-config-pathname \\*source-registry-directory\\* direction\\)")
-              "`(:source-registry
-                 ,@(loop
-                      for dir in (xdg-config-dirs
-                                  \"common-lisp/source-registry.conf.d/\")
-                      collect `(:include ,dir))
-                 :inherit-configuration)")
-             (("\\(xdg-config-pathname \\*output-translations-directory\\* direction\\)")
-              "`(:output-translations
-                 ,@(loop
-                      for dir in (xdg-config-dirs
-                                  \"common-lisp/asdf-output-translations.conf.d/\")
-                      collect `(:include ,dir))
-                 :inherit-configuration)")))
-         #t)))
+           (invoke patch "-p1" "-i" config-patch dst-asdf)))))
     (home-page "https://common-lisp.net/project/asdf/")
     (synopsis "Another System Definition Facility")
     (description
diff --git a/gnu/packages/patches/cl-asdf-config-directories.patch b/gnu/packages/patches/cl-asdf-config-directories.patch
new file mode 100644
index 0000000000..04ec67c9a0
--- /dev/null
+++ b/gnu/packages/patches/cl-asdf-config-directories.patch
@@ -0,0 +1,36 @@
+Search for ASDF configuration files first in user directories, and then in
+Guix profiles.
+
+diff -ru a/asdf-3.3.4.lisp b/asdf-3.3.4.lisp
+--- a/asdf-3.3.4.lisp	2020-02-14 20:16:22.000000000 +0100
++++ b/asdf-3.3.4.lisp	2020-12-03 13:57:54.843428936 +0100
+@@ -12537,8 +12537,12 @@
+   (defun user-output-translations-directory-pathname (&key (direction :input))
+     (xdg-config-pathname *output-translations-directory* direction))
+   (defun system-output-translations-directory-pathname (&key (direction :input))
+-    (find-preferred-file (system-config-pathnames *output-translations-directory*)
+-                         :direction direction))
++    `(:output-translations
++      ,@(loop :for dir :in (filter-pathname-set
++                            (xdg-config-dirs
++                             "common-lisp/asdf-output-translations.conf.d/"))
++              :collect `(:include ,dir))
++      :inherit-configuration))
+   (defun environment-output-translations ()
+     (getenv "ASDF_OUTPUT_TRANSLATIONS"))
+ 
+@@ -12923,8 +12927,12 @@
+   (defun user-source-registry-directory (&key (direction :input))
+     (xdg-config-pathname *source-registry-directory* direction))
+   (defun system-source-registry-directory (&key (direction :input))
+-    (find-preferred-file (system-config-pathnames *source-registry-directory*)
+-                         :direction direction))
++    `(:source-registry
++      ,@(loop :for dir :in (filter-pathname-set
++                            (xdg-config-dirs
++                             "common-lisp/source-registry.conf.d/"))
++              :collect `(:include ,dir))
++      :inherit-configuration))
+   (defun environment-source-registry ()
+     (getenv "CL_SOURCE_REGISTRY"))
+ 
-- 
2.29.2


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

  reply	other threads:[~2020-12-03 14:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03  9:42 bug#45017: asdf-build-system packages have priority over user ones Pierre Neidhardt
2020-12-03 12:04 ` Guillaume Le Vaillant
2020-12-03 12:40   ` Pierre Neidhardt
2020-12-03 14:29     ` Guillaume Le Vaillant [this message]
2020-12-04  8:51       ` Pierre Neidhardt
2020-12-04  9:12         ` Guillaume Le Vaillant
2020-12-04 12:46           ` Pierre Neidhardt
2020-12-04 13:53             ` Guillaume Le Vaillant
2020-12-04 17:30               ` Guillaume Le Vaillant
2020-12-05  8:18               ` Pierre Neidhardt
2020-12-05  9:42                 ` Guillaume Le Vaillant
2020-12-05  9:17       ` Pierre Neidhardt
2020-12-05 10:03         ` Guillaume Le Vaillant
2020-12-05 10:52           ` Guillaume Le Vaillant
2020-12-05 14:42             ` Pierre Neidhardt
2020-12-05 15:17               ` Guillaume Le Vaillant
2020-12-05 15:19                 ` Pierre Neidhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ft4n2cax.fsf@yamatai \
    --to=glv@posteo.net \
    --cc=45017@debbugs.gnu.org \
    --cc=mail@ambrevar.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).