unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: 65924@debbugs.gnu.org
Cc: "Maxim Cournoyer" <maxim.cournoyer@gmail.com>,
	"Maxim Cournoyer" <maxim.cournoyer@gmail.com>,
	"Simon Tournier" <zimon.toutoune@gmail.com>,
	"Ludovic Courtès" <ludo@gnu.org>
Subject: bug#65924: [PATCH core-updates 3/3] gnu: git-minimal: Add coreutils and sed to PATH.
Date: Sat,  7 Oct 2023 23:18:51 -0400	[thread overview]
Message-ID: <9e15a3ab5f8d4f44b834e1fc90464312c60fac9e.1696734901.git.maxim.cournoyer@gmail.com> (raw)
In-Reply-To: <cover.1696734901.git.maxim.cournoyer@gmail.com>

Fixes <https://issues.guix.gnu.org/65924>.

* gnu/packages/version-control.scm (git-minimal)
[arguments] <imported-modules>: New field.
<modules>: Augment with (ice-9 match), (ice-9 textual-ports) and (guix
search-paths).
<phases>: Add patch-commands phase.
[inputs]: Add coreutils-minimal and sed.
---
 gnu/packages/version-control.scm | 57 ++++++++++++++++++++++++++++++--
 1 file changed, 55 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm
index bc647d1538..b0997db5da 100644
--- a/gnu/packages/version-control.scm
+++ b/gnu/packages/version-control.scm
@@ -82,6 +82,7 @@ (define-module (gnu packages version-control)
   #:use-module (guix build-system python)
   #:use-module (guix build-system qt)
   #:use-module (guix build-system trivial)
+  #:use-module (guix modules)
   #:use-module (gnu packages apr)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages documentation)
@@ -245,9 +246,14 @@ (define-public git-minimal
     (build-system gnu-build-system)
     (arguments
      (list
-      #:modules `((srfi srfi-1)
+      #:imported-modules `(,@%gnu-build-system-modules
+                           ,@(source-module-closure '((guix search-paths))))
+      #:modules `((ice-9 match)
+                  (ice-9 textual-ports)
+                  (srfi srfi-1)
                   (srfi srfi-26)
                   ((guix build gnu-build-system) #:prefix gnu:)
+                  (guix search-paths)
                   ,@%gnu-build-system-modules)
       ;; Make sure the full bash does not end up in the final closure.
       #:disallowed-references (list bash perl)
@@ -311,6 +317,51 @@ (define-public git-minimal
                                            inputs "bin/curl-config"))
                                  ":" (getenv "PATH"))))))
                  #~())
+          (add-after 'unpack 'patch-commands
+            (lambda* (#:key inputs #:allow-other-keys)
+              (define (prepend-string-to-file text file)
+                "Prepend TEXT to FILE."
+                (let ((content (call-with-input-file file
+                                 (cut get-string-all <>))))
+                  (call-with-output-file file
+                    (lambda (port)
+                      (display text port)
+                      (display content port)))))
+
+              (define PATH-variable-definition
+                (let ((value
+                       (match (evaluate-search-paths
+                               (list $PATH)
+                               (list #$(this-package-input "coreutils-minimal")
+                                     #$(this-package-input "sed")))
+                         (((spec . value))
+                          value))))
+                  (string-append
+                   (search-path-definition $PATH value
+                                           #:kind 'prefix) "\n\n")))
+
+              ;; Ensure that coreutils (for basename) and sed are on PATH
+              ;; for any script that sources the 'git-sh-setup.sh' file.
+              (prepend-string-to-file PATH-variable-definition
+                                      "git-sh-setup.sh")
+
+              ;; Avoid depending on util-linux; it's only used to detect
+              ;; whether the system is MinGW, which we can detect at build
+              ;; time.
+              (substitute* "git-sh-setup.sh"
+                (("\\$\\(uname -s)")
+                 (if #$(target-mingw?)
+                     "MINGW"
+                     "GNU")))           ;matched against '*'
+
+              ;; git-submodule sources 'git-sh-setup.sh', but not before
+              ;; invoking the basename and sed commands... patch them to their
+              ;; absolute location.
+              (substitute* "git-submodule.sh"
+                (("\\$\\(basename")
+                 (string-append "$(" (search-input-file inputs "bin/basename")))
+                (("sed -e")
+                 (string-append (search-input-file inputs "bin/sed") " -e")))))
           (add-after 'configure 'patch-makefiles
             (lambda _
               (substitute* "Makefile"
@@ -414,10 +465,12 @@ (define-public git-minimal
            gettext-minimal
            perl))
     (inputs
-     (list curl                         ;for HTTP(S) access
+     (list coreutils-minimal
+           curl                         ;for HTTP(S) access
            expat                        ;for 'git push' over HTTP(S)
            openssl
            perl
+           sed
            zlib))
     (native-search-paths
      ;; For HTTPS access, Git needs a single-file certificate bundle, specified
-- 
2.41.0





  parent reply	other threads:[~2023-10-08  3:21 UTC|newest]

Thread overview: 98+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-13 18:00 bug#65924: git searches coreutils and util-linux commands in PATH Maxim Cournoyer
2023-09-13 22:27 ` Simon Tournier
2023-09-14  3:14   ` Maxim Cournoyer
2023-09-14  6:12     ` Simon Tournier
2023-10-04 16:14 ` Ludovic Courtès
2023-10-04 16:52   ` Simon Tournier
2023-10-05  3:41   ` Maxim Cournoyer
2023-10-05 16:21     ` Simon Tournier
2023-10-08  3:18 ` bug#65924: [PATCH core-updates 0/3] Fix 'git submodule' in pure environments Maxim Cournoyer
2023-10-08  3:18   ` bug#65924: [PATCH core-updates 1/3] gnu: git: Remove labels and use gexps Maxim Cournoyer
2023-10-08  7:09     ` Liliana Marie Prikler
2023-10-14 16:51     ` Ludovic Courtès
2023-10-15 19:55       ` Maxim Cournoyer
2023-10-08  3:18   ` bug#65924: [PATCH core-updates 2/3] gnu: git: Invert inheritance relationship Maxim Cournoyer
2023-10-08  7:03     ` Liliana Marie Prikler
2023-10-09 14:21       ` bug#65924: git searches coreutils and util-linux commands in PATH Maxim Cournoyer
2023-10-09 16:49         ` Liliana Marie Prikler
2023-10-09 18:21           ` Maxim Cournoyer
2023-10-09 18:33             ` Liliana Marie Prikler
2023-10-09 19:25               ` Maxim Cournoyer
2023-10-09 19:28                 ` Liliana Marie Prikler
2023-10-09 19:44                   ` Maxim Cournoyer
2023-10-09 21:03               ` bokr
2023-10-10  4:28                 ` Liliana Marie Prikler
2023-10-09 19:17           ` Maxim Cournoyer
2023-10-14 16:54     ` bug#65924: [PATCH core-updates 2/3] gnu: git: Invert inheritance relationship Ludovic Courtès
2023-10-08  3:18   ` Maxim Cournoyer [this message]
2023-10-14 17:01     ` bug#65924: [PATCH core-updates 3/3] gnu: git-minimal: Add coreutils and sed to PATH Ludovic Courtès
2023-10-15 20:03       ` Maxim Cournoyer
2023-10-17 15:15       ` Maxim Cournoyer
2023-10-09 16:28 ` bug#65924: [PATCH 00/65] Export %default-gnu-imported-modules and %default-gnu-modules Maxim Cournoyer
2023-10-09 16:28   ` bug#65924: [PATCH core-updates 02/65] gnu: acl: Remove labels and trailing #t Maxim Cournoyer
2023-10-09 16:28   ` bug#65924: [PATCH core-updates 03/65] gnu: acl: Import the correct set of modules Maxim Cournoyer
2023-10-09 16:28   ` bug#65924: [PATCH core-updates 04/65] gnu: dirvish: " Maxim Cournoyer
2023-10-09 16:28   ` bug#65924: [PATCH core-updates 05/65] gnu: fio: " Maxim Cournoyer
2023-10-09 16:28   ` bug#65924: [PATCH core-updates 06/65] gnu: ccwl: " Maxim Cournoyer
2023-10-09 16:28   ` bug#65924: [PATCH core-updates 07/65] gnu: boost: " Maxim Cournoyer
2023-10-09 16:28   ` bug#65924: [PATCH core-updates 08/65] gnu: gcc-final: " Maxim Cournoyer
2023-10-09 16:28   ` bug#65924: [PATCH core-updates 09/65] gnu: epson-inkjet-printer-escpr: " Maxim Cournoyer
2023-10-09 16:28   ` bug#65924: [PATCH core-updates 10/65] gnu: splix: " Maxim Cournoyer
2023-10-09 16:37     ` Maxim Cournoyer
2023-10-09 16:36   ` bug#65924: git searches coreutils and util-linux commands in PATH Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 01/65] build-systems: gnu: Export %default-gnu-imported-modules and %default-gnu-modules Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 11/65] gnu: guile-curl: Import the correct set of modules Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 12/65] gnu: dpkg: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 13/65] gnu: dezyne: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 14/65] gnu: fastcap: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 15/65] gnu: fasthenry: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 16/65] gnu: seabios-qemu: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 17/65] gnu: font-amiri: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 18/65] gnu: xdg-utils: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 19/65] gnu: tsukundere: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 20/65] gnu: gcc-4.9: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 21/65] gnu: make-libstdc++: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 22/65] gnu: custom-gcc: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 23/65] gnu: gdb: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 24/65] gnu: genimage: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 25/65] gnu: gimp: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 26/65] gnu: pinentry-rofi: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 27/65] gnu: mozjs: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 28/65] gnu: icecat-minimal: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 29/65] gnu: icedove-minimal: " Maxim Cournoyer
2023-10-09 16:37   ` bug#65924: [PATCH core-updates 30/65] gnu: python-graph-tool: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 31/65] gnu: artanis: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 32/65] gnu: guilescript: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 33/65] gnu: guile-dsv: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 34/65] gnu: guile-di: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 35/65] gnu: guile-hall: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 36/65] gnu: haunt: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 37/65] gnu: guile-studio: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 38/65] gnu: guile-libyaml: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 39/65] gnu: guile-gitlab: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 40/65] gnu: guile-smc: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 41/65] gnu: rime-data: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 42/65] gnu: jbigkit: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 43/65] gnu: uftrace: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 44/65] gnu: mdadm-static: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 45/65] gnu: ecryptfs-utils: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 46/65] gnu: ghmm: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 47/65] gnu: %gcc-static: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 48/65] gnu: mumps: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 49/65] gnu: hypre: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 50/65] gnu: lingeling: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 51/65] gnu: guix-build-coordinator: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 52/65] gnu: nar-herder: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 53/65] gnu: python-sip-4: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 54/65] gnu: ratpoison: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 55/65] gnu: stklos: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 56/65] gnu: python-sepolgen: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 57/65] gnu: boxes: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 58/65] gnu: simh: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 59/65] gnu: stb: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 60/65] gnu: info-reader: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 61/65] gnu: git: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 62/65] gnu: ffmpeg-3.4: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 63/65] gnu: qemu: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 64/65] gnu: ganeti: " Maxim Cournoyer
2023-10-09 16:38   ` bug#65924: [PATCH core-updates 65/65] gnu: criu: " Maxim Cournoyer

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=9e15a3ab5f8d4f44b834e1fc90464312c60fac9e.1696734901.git.maxim.cournoyer@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=65924@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /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).