From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id yHsqMiMqImXnSwAAG6o9tA:P1 (envelope-from ) for ; Sun, 08 Oct 2023 06:03:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id yHsqMiMqImXnSwAAG6o9tA (envelope-from ) for ; Sun, 08 Oct 2023 06:03:47 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4B5B15D95E for ; Sun, 8 Oct 2023 06:03:47 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=D7hsdNgi; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1696737827; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=YkFIbHwHJdjNoqs31ZCH2JoTHStLNwgNddUMWDELWJQ=; b=i1xjSmkaVTBI+z4F7Mjoako4fNphbfxEtjbF7TL8vp8jkiPhXz6Q5HDXxcp98zycUKP07I zNkByL8FDABQKQkVPfoaXsJqV4sPeaJoOnfLr9uWzdjbyZUvHdBPCcEL4agpSTNmVz2c0T pvlhikYJzMQFq5vvS+U4EVSo2JGia0+5dDSmyvrXSJjkrPK3I4r5G1+DeWqi+Tjx3sJ9W9 iuURlfgnd167FO12tLrqkUzgA5bL2DwTwL+rXniDhCrfua7VurTA+suC+aqKuUuyUtbYJf c+sGSI+EyLoxvEFsF1yDvnG5+S/IAGR8QMXu5wqAsXnAYpByQTw+F4fDxFGTzg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=D7hsdNgi; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696737827; a=rsa-sha256; cv=none; b=Z4rB+m2SzteYIslxAsnx/CJXiQ6JxYbjDxBHQQWooVzszwdzKRJXNuf6al2qvm0V01nTRw 650weRmoKNEv9lzSLWEIVb7G0wb3Bmpj/GYbVlPSRJt0EU5sJqR5t9S/CLq0ejeRYUjI1O xtAmPAhDxql4UtC9sUBdFMJhyQqrAvdzUMOKT0kWwmXJ81x0Xd6u9sX4DKv17DRFJaIJyA 48WxBEJe2B0Ztk0MsLfdhlruG+465zr3tNzLmtqqa3S7xKXz/mmP6hcdtOMKeatIhm44e8 wYtwkblvDBKpr5Ga1M39flUnpirt3SKqgVvQl8MZ4QJ3mPMgixW9GStdHSz7ig== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpKLV-00043R-1Y; Sat, 07 Oct 2023 23:20:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qpKLT-00042l-5Y for bug-guix@gnu.org; Sat, 07 Oct 2023 23:20:43 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qpKLS-0003fi-RH; Sat, 07 Oct 2023 23:20:42 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qpKLm-0001aN-He; Sat, 07 Oct 2023 23:21:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#65924: [PATCH core-updates 1/3] gnu: git: Remove labels and use gexps. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: maxim.cournoyer@gmail.com, zimon.toutoune@gmail.com, ludo@gnu.org, bug-guix@gnu.org Resent-Date: Sun, 08 Oct 2023 03:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65924 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 65924@debbugs.gnu.org Cc: Maxim Cournoyer , Maxim Cournoyer , Simon Tournier , Ludovic =?UTF-8?Q?Court=C3=A8s?= X-Debbugs-Original-Xcc: Maxim Cournoyer , Simon Tournier , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 65924-submit@debbugs.gnu.org id=B65924.16967352215996 (code B ref 65924); Sun, 08 Oct 2023 03:21:02 +0000 Received: (at 65924) by debbugs.gnu.org; 8 Oct 2023 03:20:21 +0000 Received: from localhost ([127.0.0.1]:56097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpKL5-0001YY-GE for submit@debbugs.gnu.org; Sat, 07 Oct 2023 23:20:21 -0400 Received: from mail-qv1-xf30.google.com ([2607:f8b0:4864:20::f30]:62718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpKL0-0001YH-CM for 65924@debbugs.gnu.org; Sat, 07 Oct 2023 23:20:18 -0400 Received: by mail-qv1-xf30.google.com with SMTP id 6a1803df08f44-66b024d26e2so12642606d6.0 for <65924@debbugs.gnu.org>; Sat, 07 Oct 2023 20:19:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696735189; x=1697339989; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YkFIbHwHJdjNoqs31ZCH2JoTHStLNwgNddUMWDELWJQ=; b=D7hsdNgik7k9OFkqpfQ8/SE3hKx7TW0xc2A5qoA4ruJ9m4F6MRCXxknMhBGJoDBBBl Gznkv2xJs8AJtHcnQCKR0vlB6abHVvRmVJTEnwUT/ZE9QmFEd1XUZEBo/bRkznnuSEtf NEIkfii95dfmVDz1XH5xps1fyEVB6jvNI31bHrjEavAg+qQRjiqMaW6mU1vSfJXZ2Tvo y6yHsuv7hox4bk4R5cGb2S7Ewrtwz/5iX8kzIsYOtXw97C5byzBjNeKcpemJKiq4MLZR G4ol2q9bC0qJab5eaaX2uMmzPBiOMESn2RAwbs/zUHhW8GOk+z3SamOdy7Ip3kBV7Pq5 3w/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696735189; x=1697339989; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YkFIbHwHJdjNoqs31ZCH2JoTHStLNwgNddUMWDELWJQ=; b=jiR50Q/pu6NL/cBDEIRhVuYmFigoJM5S+w/+gZaHlqafI3yZgQKVgR4YWMXPe8qE2z Wkr313uQaWJMrBpkCP4FXKzboMeuCf/ltJiNl3gdvyKKIPM3gHGH6kO65yvXcXs3kwGM J+T0n5poWuliN8oSBMouXOMYt9ecxHW89+Va77ZbXKnJgijgsAZpnQ3YsrXB7u6bKGKr 32LuNW8A6+mqYzJdQgkHerT9rZ5QzkhTs5QITXZnnHcKFy7+NZZq6FnB34XP/1xk8Hle vYl9KssNd/9M0nHcGpGiwT9uwvNNdxBvnwtHSE6+7VUu4QeFJrdpsV7NTJZ9Wr0kTItS 8lTA== X-Gm-Message-State: AOJu0Yy5WT6Yy6XQ0kj+Bez+LPDAKv+OaBueAXIq5rcbGqPx/8P9pHnH yysEtOfyuLeL3Di31/xH9y+GBnaYOR0= X-Google-Smtp-Source: AGHT+IHB8xGDvbIYxnSOqc86AQ+76iEm0XuWXYJIuzCPgc4A3F9W88p2xiSrrG4qLNEG06LEGIqd6w== X-Received: by 2002:a0c:aadc:0:b0:65b:92c:3eee with SMTP id g28-20020a0caadc000000b0065b092c3eeemr15084689qvb.15.1696735188417; Sat, 07 Oct 2023 20:19:48 -0700 (PDT) Received: from localhost.localdomain (dsl-158-21.b2b2c.ca. [66.158.158.21]) by smtp.gmail.com with ESMTPSA id o10-20020a0cf4ca000000b0065b129ec0e8sm2748304qvm.57.2023.10.07.20.19.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 20:19:48 -0700 (PDT) From: Maxim Cournoyer Date: Sat, 7 Oct 2023 23:18:49 -0400 Message-ID: <1090d01a7ba277090c84cf66bc7bfaf22521f0e3.1696734901.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Queue-Id: 4B5B15D95E X-Spam-Score: 7.76 X-Migadu-Spam-Score: 7.76 X-Migadu-Scanner: mx1.migadu.com X-TUID: kUDnVeyyQWks * gnu/packages/version-control.scm (git) [native-inputs, inputs]: Remove labels. [arguments]: Use gexps. Use gexp variables input searching procedures where it makes sense. --- gnu/packages/version-control.scm | 706 ++++++++++++++++--------------- 1 file changed, 360 insertions(+), 346 deletions(-) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index d9c53af71c..7a3c17efd8 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -230,358 +230,373 @@ (define git-cross-configure-flags (define-public git (package - (name "git") - (version "2.41.0") - (source (origin - (method url-fetch) - (uri (string-append "mirror://kernel.org/software/scm/git/git-" - version ".tar.xz")) - (sha256 - (base32 - "0h40arw08xbpi2cbf7pvc947v963rjxz3inb2ar81zjc8byvlj77")))) - (build-system gnu-build-system) - (native-inputs - `(("native-perl" ,perl) - ;; Add bash-minimal explicitly to ensure it comes before bash-for-tests, - ;; see . - ("bash" ,bash-minimal) - ("bash-for-tests" ,bash) - ("gettext" ,gettext-minimal) - ;; To build the man pages from the git sources, we would need a dependency - ;; on a full XML tool chain, and building it actually takes ages. So we - ;; use this lazy approach and use released tarball. - ("git-manpages" - ,(origin - (method url-fetch) - (uri (string-append - "mirror://kernel.org/software/scm/git/git-manpages-" - version ".tar.xz")) - (sha256 - (base32 - "0xsqakgy0s60zpa13ilj6zj420kdh8pf4v3nrp1nziwj8ja4qymw")))) - ;; For subtree documentation. - ("asciidoc" ,asciidoc) - ("docbook2x" ,docbook2x) - ("docbook-xsl" ,docbook-xsl) - ("libxslt" ,libxslt) - ("pkg-config" ,pkg-config) - ("texinfo" ,texinfo) - ("xmlto" ,xmlto))) - (inputs - `(("curl" ,curl) - ("expat" ,expat) - ("openssl" ,openssl) - ("perl" ,perl) - ("python" ,python) ; for git-p4 - ("zlib" ,zlib) - - ;; For PCRE support in git grep (USE_LIBPCRE2). - ("pcre" ,pcre2) - - ;; For 'gitweb.cgi'. - ("perl-cgi" ,perl-cgi) - - ;; For 'git-svn'. - ("subversion" ,subversion) - ("perl-term-readkey" ,perl-term-readkey) - - ;; For 'git-send-email'. - ("perl-authen-sasl" ,perl-authen-sasl) - ("perl-net-smtp-ssl" ,perl-net-smtp-ssl) - ("perl-io-socket-ssl" ,perl-io-socket-ssl) - - ;; For 'git gui', 'gitk', and 'git citool'. - ("tcl" ,tcl) - ("tk" ,tk) - - ;; For 'git-credential-libsecret' - ("glib" ,glib) - ("libsecret" ,libsecret))) - (outputs '("out" ; the core - "send-email" ; for git-send-email - "svn" ; git-svn - "credential-netrc" ; git-credential-netrc - "credential-libsecret" ; git-credential-libsecret - "subtree" ; git-subtree - "gui")) ; gitk, git gui - (arguments - `(#:make-flags `("V=1" ;more verbose compilation + (name "git") + (version "2.41.0") + (source (origin + (method url-fetch) + (uri (string-append "mirror://kernel.org/software/scm/git/git-" + version ".tar.xz")) + (sha256 + (base32 + "0h40arw08xbpi2cbf7pvc947v963rjxz3inb2ar81zjc8byvlj77")))) + (build-system gnu-build-system) + (native-inputs + (list perl + ;; Add bash-minimal explicitly to ensure it comes before bash-for-tests, + ;; see . + bash-minimal + bash + gettext-minimal + ;; For subtree documentation. + asciidoc + docbook2x + docbook-xsl + libxslt + pkg-config + texinfo + xmlto)) + (inputs + (list curl + expat + openssl + perl + python ;for git-p4 + zlib - ,(string-append "SHELL_PATH=" - (assoc-ref %build-inputs "bash") - "/bin/sh") + ;; For PCRE support in git grep (USE_LIBPCRE2). + pcre2 - ;; Tests require a bash with completion support. - ,(string-append "TEST_SHELL_PATH=" - (assoc-ref %build-inputs "bash-for-tests") - "/bin/bash") + ;; For 'gitweb.cgi'. + perl-cgi - "USE_LIBPCRE2=yes" + ;; For 'git-svn'. + subversion + perl-term-readkey + + ;; For 'git-send-email'. + perl-authen-sasl + perl-net-smtp-ssl + perl-io-socket-ssl + + ;; For 'git gui', 'gitk', and 'git citool'. + tcl + tk + + ;; For 'git-credential-libsecret' + glib + libsecret)) + (outputs '("out" ;the core + "send-email" ;for git-send-email + "svn" ;git-svn + "credential-netrc" ;git-credential-netrc + "credential-libsecret" ;git-credential-libsecret + "subtree" ;git-subtree + "gui")) ;gitk, git gui + (arguments + (list + #:make-flags + #~(list "V=1" ;more verbose compilation + (string-append "SHELL_PATH=" + #$(this-package-native-input "bash-minimal") + "/bin/sh") - ;; By default 'make install' creates hard links for - ;; things in 'libexec/git-core', which leads to huge - ;; nars; see . - "NO_INSTALL_HARDLINKS=indeed") + ;; Tests require a bash with completion support. + (string-append "TEST_SHELL_PATH=" + #$(this-package-native-input "bash") + "/bin/bash") - ;; Make sure the full bash does not end up in the final closure. - #:disallowed-references (,bash) + "USE_LIBPCRE2=yes" - #:test-target "test" + ;; By default 'make install' creates hard links for + ;; things in 'libexec/git-core', which leads to huge + ;; nars; see . + "NO_INSTALL_HARDLINKS=indeed") + + ;; Make sure the full bash does not end up in the final closure. + #:disallowed-references (list bash) - ;; The explicit --with-tcltk forces the build system to hardcode the - ;; absolute file name to 'wish'. - #:configure-flags (list (string-append "--with-tcltk=" - (assoc-ref %build-inputs "tk") - "/bin/wish8.6") ; XXX - ,@(if (%current-target-system) - git-cross-configure-flags - '())) + #:test-target "test" - #:modules ((srfi srfi-1) + ;; The explicit --with-tcltk forces the build system to hardcode the + ;; absolute file name to 'wish'. + #:configure-flags + #~(list (string-append "--with-tcltk=" + (search-input-file %build-inputs + "bin/wish8.6")) + #$@(if (%current-target-system) + git-cross-configure-flags + #~())) + + #:modules `((srfi srfi-1) (srfi srfi-26) ((guix build gnu-build-system) #:prefix gnu:) ,@%gnu-build-system-modules) - #:phases - (modify-phases %standard-phases - ,@(if (%current-target-system) - ;; The git build system assumes build == host - `((add-after 'unpack 'use-host-uname_S - (lambda _ - (substitute* "config.mak.uname" - (("uname_S := .*" all) - (if (equal? ,(%current-target-system) "i586-pc-gnu") - "uname_S := GNU\n" - all)))))) - ;; We do not have bash-for-tests when cross-compiling. - `((add-after 'unpack 'modify-PATH - (lambda* (#:key inputs #:allow-other-keys) - (let ((path (string-split (getenv "PATH") #\:)) - (bash-full (assoc-ref inputs "bash-for-tests"))) - ;; Drop the test bash from PATH so that (which "sh") and - ;; similar does the right thing. - (setenv "PATH" (string-join - (remove (cut string-prefix? bash-full <>) path) - ":"))))))) - ;; Add cross curl-config script to PATH when cross-compiling. - ,@(if (%current-target-system) - '((add-before 'configure 'add-cross-curl-config - (lambda* (#:key inputs #:allow-other-keys) - (setenv "PATH" - (string-append (assoc-ref inputs "curl") "/bin:" - (getenv "PATH")))))) - '()) - (add-after 'configure 'patch-makefiles - (lambda _ - (substitute* "Makefile" - (("/usr/bin/perl") (which "perl")) - (("/usr/bin/python") (which "python3"))))) - (add-after 'configure 'add-PM.stamp - (lambda _ - ;; Add the "PM.stamp" to avoid "no rule to make target". - (call-with-output-file "perl/PM.stamp" (const #t)))) - (add-after 'build 'build-subtree - (lambda* (#:key inputs #:allow-other-keys) - (with-directory-excursion "contrib/subtree" - (substitute* "Makefile" - ;; Apparently `xmlto' does not bother to looks up the stylesheets - ;; specified in the XML, unlike the above substitution. Instead it - ;; uses a hard-coded URL. Work around it here, but if this is - ;; common perhaps we should hardcode this path in xmlto itself. - (("\\$\\(XMLTO\\) -m \\$\\(MANPAGE_XSL\\)") - (string-append "$(XMLTO) -x " - (string-append (assoc-ref inputs "docbook-xsl") - "/xml/xsl/docbook-xsl-" - ,(package-version docbook-xsl)) - "/manpages/docbook.xsl -m $(MANPAGE_XSL)"))) - (invoke "make") - (invoke "make" "install") - (invoke "make" "install-doc") - (substitute* "git-subtree" - (("/bin/sh") (which "sh")))))) - (add-before 'check 'patch-tests - (lambda _ - (let ((store-directory (%store-directory))) - ;; These files contain some funny bytes that Guile is unable - ;; to decode for shebang patching. Just delete them. - (for-each delete-file '("t/t4201-shortlog.sh" - "t/t7813-grep-icase-iso.sh")) - ;; Many tests contain inline shell scripts (hooks etc). - (substitute* (find-files "t" "\\.sh$") - (("#!/bin/sh") (string-append "#!" (which "sh")))) - ;; Un-do shebang patching here to prevent checksum mismatch. - (substitute* '("t/t4034/perl/pre" "t/t4034/perl/post") - (("^#!.*/bin/perl") "#!/usr/bin/perl")) - (substitute* "t/t5003-archive-zip.sh" - (("cp /bin/sh") (string-append "cp " (which "sh")))) - (substitute* "t/t6030-bisect-porcelain.sh" - (("\"/bin/sh\"") (string-append "\"" (which "sh") "\""))) - ;; FIXME: This test runs `git commit` with a bogus EDITOR - ;; and empty commit message, but does not fail the way it's - ;; expected to. The test passes when invoked interactively. - (substitute* "t/t7508-status.sh" - (("\tcommit_template_commented") "\ttrue")) - ;; More checksum mismatches due to odd shebangs. - (substitute* "t/t9100-git-svn-basic.sh" - (((string-append "\"#!" store-directory ".*/bin/sh")) "\"#!/bin/sh") ) - (substitute* "t/t9300-fast-import.sh" - (((string-append "\t#!" store-directory ".*/bin/sh")) "\t#!/bin/sh") - (((string-append "'#!" store-directory ".*/bin/sh")) "'#!/bin/sh")) - ;; FIXME: Some hooks fail with "basename: command not found". - ;; See 't/trash directory.t9164.../svn-hook.log'. - (delete-file "t/t9164-git-svn-dcommit-concurrent.sh") - - ;; XXX: These tests fail intermittently for unknown reasons: - ;; . - (for-each delete-file - '("t/t9128-git-svn-cmd-branch.sh" - "t/t9167-git-svn-cmd-branch-subproject.sh" - "t/t9141-git-svn-multiple-branches.sh"))))) - (add-after 'install 'install-info-manual - (lambda* (#:key parallel-build? #:allow-other-keys) - (define job-count (if parallel-build? - (number->string (parallel-job-count)) - "1")) - (invoke "make" "-C" "Documentation" "install-info" - "-j" job-count - ;; The Makefile refer to 'docbook2x-texi', but our binary - ;; is named 'docbook2texi'. - "DOCBOOK2X_TEXI=docbook2texi" "PERL_PATH=perl"))) - (add-after 'install 'install-shell-completion - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (completions (string-append out "/etc/bash_completion.d"))) - ;; TODO: Install the tcsh and zsh completions in the right place. - (mkdir-p completions) - (copy-file "contrib/completion/git-completion.bash" - (string-append completions "/git"))))) - (add-after 'install 'install-credential-netrc - (lambda* (#:key outputs #:allow-other-keys) - (let* ((netrc (assoc-ref outputs "credential-netrc"))) - (install-file "contrib/credential/netrc/git-credential-netrc.perl" - (string-append netrc "/bin")) - (rename-file (string-append netrc "/bin/git-credential-netrc.perl") - (string-append netrc "/bin/git-credential-netrc")) - ;; Previously, Git.pm was automatically found by netrc. - ;; Perl 5.26 changed how it locates modules so that @INC no - ;; longer includes the current working directory (the Perl - ;; community calls this "dotless @INC"). - (wrap-program (string-append netrc "/bin/git-credential-netrc") - `("PERL5LIB" ":" prefix - (,(string-append (assoc-ref outputs "out") "/share/perl5"))))))) - (add-after 'install 'install-credential-libsecret - (lambda* (#:key outputs #:allow-other-keys) - (let* ((libsecret (assoc-ref outputs "credential-libsecret"))) - (with-directory-excursion "contrib/credential/libsecret" - ((assoc-ref gnu:%standard-phases 'build)) - (install-file "git-credential-libsecret" - (string-append libsecret "/bin")))))) - (add-after 'install 'install-subtree - (lambda* (#:key outputs #:allow-other-keys) - (let ((subtree (assoc-ref outputs "subtree"))) - (install-file "contrib/subtree/git-subtree" - (string-append subtree "/bin")) - (install-file "contrib/subtree/git-subtree.1" - (string-append subtree "/share/man/man1"))))) - (add-after 'install 'restore-sample-hooks-shebang - (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (dir (string-append out "/share/git-core/templates/hooks"))) - (for-each (lambda (file) - (format #t "restoring shebang on `~a'~%" file) - (substitute* file - (("^#!.*/bin/sh") "#!/bin/sh"))) - (find-files dir ".*"))))) - (add-after 'install 'split - (lambda* (#:key inputs outputs #:allow-other-keys) - ;; Split the binaries to the various outputs. - (let* ((out (assoc-ref outputs "out")) - (se (assoc-ref outputs "send-email")) - (svn (assoc-ref outputs "svn")) - (gui (assoc-ref outputs "gui")) - (gitk (string-append out "/bin/gitk")) - (gitk* (string-append gui "/bin/gitk")) - (git-gui (string-append out "/libexec/git-core/git-gui")) - (git-gui* (string-append gui "/libexec/git-core/git-gui")) - (git-cit (string-append out "/libexec/git-core/git-citool")) - (git-cit* (string-append gui "/libexec/git-core/git-citool")) - (git-se (string-append out "/libexec/git-core/git-send-email")) - (git-se* (string-append se "/libexec/git-core/git-send-email")) - (git-svn (string-append out "/libexec/git-core/git-svn")) - (git-svn* (string-append svn "/libexec/git-core/git-svn")) - (git-sm (string-append out - "/libexec/git-core/git-submodule"))) - (mkdir-p (string-append gui "/bin")) - (mkdir-p (string-append gui "/libexec/git-core")) - (mkdir-p (string-append se "/libexec/git-core")) - (mkdir-p (string-append svn "/libexec/git-core")) - - (for-each (lambda (old new) - (copy-file old new) - (delete-file old) - (chmod new #o555)) - (list gitk git-gui git-cit git-se git-svn) - (list gitk* git-gui* git-cit* git-se* git-svn*)) - - ;; Tell 'git-svn' where Subversion and perl-term-readkey are. - (wrap-program git-svn* - `("PATH" ":" prefix - (,(string-append (assoc-ref inputs "subversion") - "/bin"))) - `("PERL5LIB" ":" prefix - ,(map (lambda (i) (string-append (assoc-ref inputs i) - "/lib/perl5/site_perl")) - '("subversion" "perl-term-readkey"))) - - ;; XXX: The .so for SVN/Core.pm lacks a RUNPATH, so - ;; help it find 'libsvn_client-1.so'. - `("LD_LIBRARY_PATH" ":" prefix - (,(string-append (assoc-ref inputs "subversion") - "/lib")))) - - ;; Tell 'git-send-email' where perl modules are. - (wrap-program git-se* - `("PERL5LIB" ":" prefix - ,(map (lambda (o) (string-append o "/lib/perl5/site_perl")) - (list - ,@(transitive-input-references - 'inputs - (map (lambda (l) - (assoc l (package-inputs this-package))) - '("perl-authen-sasl" - "perl-net-smtp-ssl" - "perl-io-socket-ssl"))))))) - - ;; Tell 'gitweb.cgi' where perl modules are. - (wrap-program (string-append out "/share/gitweb/gitweb.cgi") - `("PERL5LIB" ":" prefix - ,(map (lambda (o) (string-append o "/lib/perl5/site_perl")) - (list - ,@(transitive-input-references - 'inputs - (map (lambda (l) - (assoc l (package-inputs this-package))) - '("perl-cgi"))))))) - - ;; Tell 'git-submodule' where Perl is. - (wrap-program git-sm - `("PATH" ":" prefix - (,(string-append (assoc-ref inputs "perl") - "/bin"))))))) - (add-after 'split 'install-man-pages - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (man (string-append out "/share/man")) - (manpages (assoc-ref inputs "git-manpages"))) - (mkdir-p man) - (with-directory-excursion man - (invoke "tar" "xvf" manpages))))) - ,@(if (system-hurd?) - '((add-after 'unpack 'delete-tests/hurd - (lambda _ - (delete-file "t/t0052-simple-ipc.sh") - (delete-file "t/t5562-http-backend-content-length.sh") - (delete-file "t/t9902-completion.sh")))) - '())))) + #:phases + #~(modify-phases %standard-phases + #$@(if (%current-target-system) + ;; The git build system assumes build == host + #~((add-after 'unpack 'use-host-uname_S + (lambda _ + (substitute* "config.mak.uname" + (("uname_S := .*" all) + (if (equal? #$(%current-target-system) "i586-pc-gnu") + "uname_S := GNU\n" + all)))))) + ;; We do not have a full bash when cross-compiling. + #~((add-after 'unpack 'modify-PATH + (lambda* (#:key inputs #:allow-other-keys) + (let ((path (string-split (getenv "PATH") #\:)) + (bash-full #$(this-package-native-input "bash"))) + ;; Drop the test bash from PATH so that (which "sh") + ;; and similar does the right thing. + (setenv "PATH" + (string-join + (remove (cut string-prefix? bash-full <>) + path) + ":"))))))) + ;; Add cross curl-config script to PATH when cross-compiling. + #$@(if (%current-target-system) + #~((add-before 'configure 'add-cross-curl-config + (lambda* (#:key inputs #:allow-other-keys) + (setenv "PATH" + (string-append + (dirname (search-input-file + inputs "bin/curl-config")) + ":" (getenv "PATH")))))) + #~()) + (add-after 'configure 'patch-makefiles + (lambda _ + (substitute* "Makefile" + (("/usr/bin/perl") (which "perl")) + (("/usr/bin/python") (which "python3"))))) + (add-after 'configure 'add-PM.stamp + (lambda _ + ;; Add the "PM.stamp" to avoid "no rule to make target". + (call-with-output-file "perl/PM.stamp" (const #t)))) + (add-after 'build 'build-subtree + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "contrib/subtree" + (substitute* "Makefile" + ;; Apparently `xmlto' does not bother to looks up the + ;; stylesheets specified in the XML, unlike the above + ;; substitution. Instead it uses a hard-coded URL. Work + ;; around it here, but if this is common perhaps we should + ;; hardcode this path in xmlto itself. + (("\\$\\(XMLTO\\) -m \\$\\(MANPAGE_XSL\\)") + (string-append "$(XMLTO) -x " + (search-input-directory + (or native-inputs inputs) + (string-append + "xml/xsl/docbook-xsl-" + #$(package-version docbook-xsl))) + "/manpages/docbook.xsl -m $(MANPAGE_XSL)"))) + (invoke "make") + (invoke "make" "install") + (invoke "make" "install-doc") + (substitute* "git-subtree" + (("/bin/sh") (which "sh")))))) + (add-before 'check 'patch-tests + (lambda _ + (let ((store-directory (%store-directory))) + ;; These files contain some funny bytes that Guile is unable + ;; to decode for shebang patching. Just delete them. + (for-each delete-file '("t/t4201-shortlog.sh" + "t/t7813-grep-icase-iso.sh")) + ;; Many tests contain inline shell scripts (hooks etc). + (substitute* (find-files "t" "\\.sh$") + (("#!/bin/sh") (string-append "#!" (which "sh")))) + ;; Un-do shebang patching here to prevent checksum mismatch. + (substitute* '("t/t4034/perl/pre" "t/t4034/perl/post") + (("^#!.*/bin/perl") "#!/usr/bin/perl")) + (substitute* "t/t5003-archive-zip.sh" + (("cp /bin/sh") (string-append "cp " (which "sh")))) + (substitute* "t/t6030-bisect-porcelain.sh" + (("\"/bin/sh\"") (string-append "\"" (which "sh") "\""))) + ;; FIXME: This test runs `git commit` with a bogus EDITOR + ;; and empty commit message, but does not fail the way it's + ;; expected to. The test passes when invoked interactively. + (substitute* "t/t7508-status.sh" + (("\tcommit_template_commented") "\ttrue")) + ;; More checksum mismatches due to odd shebangs. + (substitute* "t/t9100-git-svn-basic.sh" + (((string-append "\"#!" store-directory ".*/bin/sh")) + "\"#!/bin/sh") ) + (substitute* "t/t9300-fast-import.sh" + (((string-append "\t#!" store-directory ".*/bin/sh")) + "\t#!/bin/sh") + (((string-append "'#!" store-directory ".*/bin/sh")) + "'#!/bin/sh")) + ;; FIXME: Some hooks fail with "basename: command not found". + ;; See 't/trash directory.t9164.../svn-hook.log'. + (delete-file "t/t9164-git-svn-dcommit-concurrent.sh") + + ;; XXX: These tests fail intermittently for unknown reasons: + ;; . + (for-each delete-file + '("t/t9128-git-svn-cmd-branch.sh" + "t/t9167-git-svn-cmd-branch-subproject.sh" + "t/t9141-git-svn-multiple-branches.sh"))))) + (add-after 'install 'install-info-manual + (lambda* (#:key parallel-build? #:allow-other-keys) + (define job-count (if parallel-build? + (number->string (parallel-job-count)) + "1")) + (invoke "make" "-C" "Documentation" "install-info" + "-j" job-count + ;; The Makefile refer to 'docbook2x-texi', but our binary + ;; is named 'docbook2texi'. + "DOCBOOK2X_TEXI=docbook2texi" "PERL_PATH=perl"))) + (add-after 'install 'install-shell-completion + (lambda _ + (let ((completions (string-append #$output + "/etc/bash_completion.d"))) + ;; TODO: Install the tcsh and zsh completions in the right + ;; place. + (mkdir-p completions) + (copy-file "contrib/completion/git-completion.bash" + (string-append completions "/git"))))) + (add-after 'install 'install-credential-netrc + (lambda _ + (install-file "contrib/credential/netrc/git-credential-netrc.perl" + (string-append #$output:credential-netrc "/bin")) + (rename-file (string-append #$output:credential-netrc + "/bin/git-credential-netrc.perl") + (string-append #$output:credential-netrc + "/bin/git-credential-netrc")) + ;; Previously, Git.pm was automatically found by netrc. + ;; Perl 5.26 changed how it locates modules so that @INC no + ;; longer includes the current working directory (the Perl + ;; community calls this "dotless @INC"). + (wrap-program (string-append #$output:credential-netrc + "/bin/git-credential-netrc") + `("PERL5LIB" ":" prefix + (,(string-append #$output "/share/perl5")))))) + (add-after 'install 'install-credential-libsecret + (lambda _ + (with-directory-excursion "contrib/credential/libsecret" + ((assoc-ref gnu:%standard-phases 'build)) + (install-file "git-credential-libsecret" + (string-append #$output:credential-libsecret + "/bin"))))) + (add-after 'install 'install-subtree + (lambda _ + (install-file "contrib/subtree/git-subtree" + (string-append #$output:subtree "/bin")) + (install-file "contrib/subtree/git-subtree.1" + (string-append #$output:subtree + "/share/man/man1")))) + (add-after 'install 'restore-sample-hooks-shebang + (lambda _ + (let* ((dir (string-append #$output + "/share/git-core/templates/hooks"))) + (for-each (lambda (file) + (format #t "restoring shebang on `~a'~%" file) + (substitute* file + (("^#!.*/bin/sh") "#!/bin/sh"))) + (find-files dir ".*"))))) + (add-after 'install 'split + (lambda* (#:key inputs #:allow-other-keys) + ;; Split the binaries to the various outputs. + (let* ((out #$output) + (se #$output:send-email) + (svn #$output:svn) + (gui #$output:gui) + (gitk (string-append out "/bin/gitk")) + (gitk* (string-append gui "/bin/gitk")) + (git-gui (string-append + out "/libexec/git-core/git-gui")) + (git-gui* (string-append gui "/libexec/git-core/git-gui")) + (git-cit (string-append + out "/libexec/git-core/git-citool")) + (git-cit* (string-append + gui "/libexec/git-core/git-citool")) + (git-se (string-append + out "/libexec/git-core/git-send-email")) + (git-se* (string-append + se "/libexec/git-core/git-send-email")) + (git-svn (string-append out "/libexec/git-core/git-svn")) + (git-svn* (string-append svn "/libexec/git-core/git-svn")) + (git-sm (string-append + out "/libexec/git-core/git-submodule"))) + (mkdir-p (string-append gui "/bin")) + (mkdir-p (string-append gui "/libexec/git-core")) + (mkdir-p (string-append se "/libexec/git-core")) + (mkdir-p (string-append svn "/libexec/git-core")) + + (for-each (lambda (old new) + (copy-file old new) + (delete-file old) + (chmod new #o555)) + (list gitk git-gui git-cit git-se git-svn) + (list gitk* git-gui* git-cit* git-se* git-svn*)) + + ;; Tell 'git-svn' where Subversion and perl-term-readkey are. + + ;; FIXME: Old school 'assoc-ref' is used to retrieve + ;; subversion here, as #$(this-package-input "subversion") + ;; causes a dependency cycle for unknown reasons. + (wrap-program git-svn* + `("PATH" ":" prefix + (,(dirname (search-input-file inputs "bin/perl")))) + `("PERL5LIB" ":" prefix + ,(search-path-as-list + '("lib/perl5/site_perl") + (list (assoc-ref inputs "subversion") + #$(this-package-input "perl-term-readkey")))) + + ;; XXX: The .so for SVN/Core.pm lacks a RUNPATH, so + ;; help it find 'libsvn_client-1.so'. + `("LD_LIBRARY_PATH" ":" prefix + (,(string-append (assoc-ref inputs "subversion") + "/lib")))) + + ;; Tell 'git-send-email' where perl modules are. + (wrap-program git-se* + `("PERL5LIB" ":" prefix + ,(search-path-as-list + '("lib/perl5/site_perl") + '#$(delete-duplicates + (append-map + (compose last package-transitive-propagated-inputs) + (list (this-package-input "perl-authen-sasl") + (this-package-input "perl-net-smtp-ssl") + (this-package-input "perl-io-socket-ssl"))))))) + ;; Tell 'gitweb.cgi' where perl modules are. + (wrap-program (string-append out "/share/gitweb/gitweb.cgi") + `("PERL5LIB" ":" prefix + ,(search-path-as-list + '("lib/perl5/site_perl") + '#$(delete-duplicates + (append-map + (compose last package-transitive-propagated-inputs) + (list (this-package-input "perl-cgi"))))))) + + ;; Tell 'git-submodule' where Perl is. + (wrap-program git-sm + `("PATH" ":" prefix + (,(dirname (search-input-file inputs "bin/perl")))))))) + (add-after 'split 'install-man-pages + (lambda _ + (let ((man (string-append #$output "/share/man"))) + (mkdir-p man) + (with-directory-excursion man + (invoke + "tar" "xvf" + #$(origin + (method url-fetch) + (uri (string-append + "mirror://kernel.org/software/scm/git/" + "git-manpages-" version ".tar.xz")) + (sha256 + (base32 + "0xsqakgy0s60zpa13ilj6zj420kdh8pf4v3nrp1nziwj8ja4qymw")))))))) + #$@(if (system-hurd?) + #~((add-after 'unpack 'delete-tests/hurd + (lambda _ + (delete-file "t/t0052-simple-ipc.sh") + (delete-file "t/t5562-http-backend-content-length.sh") + (delete-file "t/t9902-completion.sh")))) + #~())))) (native-search-paths ;; For HTTPS access, Git needs a single-file certificate bundle, specified @@ -641,9 +656,8 @@ (define-public git-minimal (delete 'install-credential-libsecret) (add-after 'install 'remove-unusable-perl-commands (lambda* (#:key outputs #:allow-other-keys) - (let* ((out (assoc-ref outputs "out")) - (bin (string-append out "/bin")) - (libexec (string-append out "/libexec"))) + (let ((bin (string-append #$output "/bin")) + (libexec (string-append #$output "/libexec"))) (for-each (lambda (file) (delete-file (string-append libexec "/git-core/" file))) @@ -663,11 +677,11 @@ (define-public git-minimal ;; These templates typically depend on Perl. Remove them. (delete-file-recursively - (string-append out "/share/git-core/templates/hooks")) + (string-append #$output "/share/git-core/templates/hooks")) ;; Gitweb depends on Perl as well. (delete-file-recursively - (string-append out "/share/gitweb"))))))) + (string-append #$output "/share/gitweb"))))))) ((#:make-flags flags) #~(delete "USE_LIBPCRE2=yes" #$flags)) ((#:configure-flags flags) -- 2.41.0