From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id mLzSCiwgImXwZQEA9RJhRA:P1 (envelope-from ) for ; Sun, 08 Oct 2023 05:21:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:478a::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id mLzSCiwgImXwZQEA9RJhRA (envelope-from ) for ; Sun, 08 Oct 2023 05:21:16 +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 93C5645EA2 for ; Sun, 8 Oct 2023 05:21:15 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=ObJjR+B1; 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=1696735275; 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=iQxnZuOHgXTSLLLBl1i/BqmNpx3T4E9rV0VdEFXzfM0=; b=guvYJA/R8OaFKqLYbC4QxQBfhReqgIiFlD6wLBbEtlMyXmbDB4YHpbhAwmLygYU45dNgA5 I1WPinsLDpBSe1Jd2mcU/E/5hdgX2IGNhxlKDMMkV97111w4D+Wh1840/fLWkcKaamG/pC GIjNIEoz3wQ9R/PHQkmc2QQtIGRmiklgEEPSWK1iyyI9BmPGZjyMl1Ff1iqdNvQmLpLcqo /9sWyP8V/htGDR6v7lWcHeEh1b5qaYdocMPFT/dfBB7Ywg90RoaLUBd+E16q8jbYJssHQu 2HqZTC1QronEOzyaJxP4Kd/57l1J+SkPZ9reBe6SwTRWu6jBpw6EO1yvLInzVA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696735275; a=rsa-sha256; cv=none; b=onHkKO82VlFneFq1wefSZjGUTNSA8sF4ybVZQfHMQfVCP/CLbbpz5PCTbHNup1aHuj10Kc bKeszb9wEGXjUi9eOUi+cOPwNl4IGDIfQNL3d88AHJl8q+hSe4utQsPRmeYCK/hQaN8DCe YID8U9kIo4iOjZthx9dI8YndnWPn4kY5O8Po8csGQOAS6qMQls5hZwXSRvbTqJQpfVYNEC TKe3zp6G78tRWZtSA+D6mIoPCqLwHBvDThSkSgpXzDjA7Ky1dmYMeb11+SOUBWg05bQZqV pbZEyDPVkj7d70KibstGMOGdKQjgVsYJGrgGTyKnaY0favZIi9y1+1JL70Ch/A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=ObJjR+B1; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qpKLW-00043w-LN; Sat, 07 Oct 2023 23:20:46 -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-00042u-PW 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 1qpKLT-0003fq-AB; Sat, 07 Oct 2023 23:20:43 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qpKLn-0001aW-1D; Sat, 07 Oct 2023 23:21:03 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#65924: [PATCH core-updates 2/3] gnu: git: Invert inheritance relationship. 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.16967352316035 (code B ref 65924); Sun, 08 Oct 2023 03:21:02 +0000 Received: (at 65924) by debbugs.gnu.org; 8 Oct 2023 03:20:31 +0000 Received: from localhost ([127.0.0.1]:56100 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpKLF-0001Z7-Hj for submit@debbugs.gnu.org; Sat, 07 Oct 2023 23:20:31 -0400 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]:55612) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qpKLC-0001Yp-Vy for 65924@debbugs.gnu.org; Sat, 07 Oct 2023 23:20:28 -0400 Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-774105e8c37so229494985a.3 for <65924@debbugs.gnu.org>; Sat, 07 Oct 2023 20:20:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696735201; x=1697340001; 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=iQxnZuOHgXTSLLLBl1i/BqmNpx3T4E9rV0VdEFXzfM0=; b=ObJjR+B1fnfeyT6tiuwDYuD3RbbT5GwYg7rYuVsxnfNv8PKkNdGFQ5qliMSuETSEmp 0diO2tc4mZjJ5ZY0oSmcjY3SkMJCHda73EEB59rzUbsnKqjvPVVBS0907UWNxUoC3764 UZppol4rh5rzRPEk0XNYEQL5Yvz6vEQ/j3104uWkbm1gRG8AbM/qtUoATl1B3L0HcFPd 7ThJjfNMQm6VSka8n4636xr86U6UMmJEbpS4HfbsTKGoyiZAgm2eQpnKbPbNyHlIh2IV RBSEE8Q6z2vzatXKAf4GZnEf5EJljAmnkNWI9L6QFfhWcJmw9xSwikKiRTl3pfHmyiaH F41g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696735201; x=1697340001; 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=iQxnZuOHgXTSLLLBl1i/BqmNpx3T4E9rV0VdEFXzfM0=; b=jrsvAMjUQn7Ec6ML2c47VdMDuFbnp2JmF6ZQOIBbTtX8n9WD+5/epnyRHmQst70PDO biByRejmtGiYUnBGzmVJY8peoPhR4642h9haoQPeIM7fKSGUyY99neZtj312/6lozi/+ 7SsB5DAZEhLvBEycMXj08JLYvQH2VS57ntg1DizT1DekZ3jhYQBUGtMRfHvd5lPELYd9 ax7mcYlVNsP+XWbfdlRezbMGt2A+RvWz13aYicbXaFii2dJHuBJTtldopwZHlgb/yIvE Y96kO4Eu2WzOV0GMoVqlYP4ltC3qP0mlpyV3hG4J8dqZzy932xdUUlN3RWSiiC1KXfX+ 9U5w== X-Gm-Message-State: AOJu0YzdflGRcoaTZJChq9o2oKvWVjAvRHPOitc2/Ei8vVq069YPKxkk tUOm6+qXCefIG6c7kgPQ8stycIA6W38= X-Google-Smtp-Source: AGHT+IGbN6kdVh0N+pubd4QB8ooxsevEYwGABJ7Xy/pIfwyv4znjI+/aRwhaiFVblVD/IlzuTu0rKg== X-Received: by 2002:a05:620a:24cf:b0:775:c0b9:2a9d with SMTP id m15-20020a05620a24cf00b00775c0b92a9dmr14186714qkn.57.1696735201274; Sat, 07 Oct 2023 20:20:01 -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.20.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 20:20:00 -0700 (PDT) From: Maxim Cournoyer Date: Sat, 7 Oct 2023 23:18:50 -0400 Message-ID: <9f9ecf37a04d6a3d788d247d8fb46f7bd6fabad5.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-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx0.migadu.com X-Migadu-Spam-Score: -0.12 X-Spam-Score: -0.12 X-Migadu-Queue-Id: 93C5645EA2 X-TUID: dxHyPqxOVu+h It's simpler to add features on top of a minimal variant than to remove them, and helps avoiding mistakenly changing git-minimal, which has many dependents. * gnu/packages/version-control.scm (git-minimal): Move above git and severe inheritance. Remove input label. Repatriate most fields from... (git): ... here. Define as package/inherit to inherit from git-minimal. Extend minimal values instead of overriding them whole. --- gnu/packages/version-control.scm | 603 +++++++++++++++---------------- 1 file changed, 292 insertions(+), 311 deletions(-) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 7a3c17efd8..bc647d1538 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -224,13 +224,16 @@ (define-public bazaar (deprecated-package "bazaar" breezy)) (define git-cross-configure-flags - '("ac_cv_fread_reads_directories=yes" - "ac_cv_snprintf_returns_bogus=no" - "ac_cv_iconv_omits_bom=no")) + #~(list "ac_cv_fread_reads_directories=yes" + "ac_cv_snprintf_returns_bogus=no" + "ac_cv_iconv_omits_bom=no")) -(define-public git +;; The size of the closure of 'git-minimal' is two thirds that of 'git'. +;; Its test suite runs slightly faster and most importantly it doesn't +;; depend on packages that are expensive to build such as Subversion. +(define-public git-minimal (package - (name "git") + (name "git-minimal") (version "2.41.0") (source (origin (method url-fetch) @@ -240,60 +243,19 @@ (define-public git (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 - - ;; For PCRE support in git grep (USE_LIBPCRE2). - pcre2 - - ;; For 'gitweb.cgi'. - perl-cgi - - ;; 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 + #:modules `((srfi srfi-1) + (srfi srfi-26) + ((guix build gnu-build-system) #:prefix gnu:) + ,@%gnu-build-system-modules) + ;; Make sure the full bash does not end up in the final closure. + #:disallowed-references (list bash perl) + #:test-target "test" + #:configure-flags + (if (%current-target-system) + git-cross-configure-flags + #~(list)) #:make-flags #~(list "V=1" ;more verbose compilation (string-append "SHELL_PATH=" @@ -305,32 +267,10 @@ (define-public git #$(this-package-native-input "bash") "/bin/bash") - "USE_LIBPCRE2=yes" - ;; 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) - - #:test-target "test" - - ;; 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) @@ -354,6 +294,13 @@ (define-public git (remove (cut string-prefix? bash-full <>) path) ":"))))))) + #$@(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")))) + #~()) ;; Add cross curl-config script to PATH when cross-compiling. #$@(if (%current-target-system) #~((add-before 'configure 'add-cross-curl-config @@ -367,34 +314,11 @@ (define-public git (add-after 'configure 'patch-makefiles (lambda _ (substitute* "Makefile" - (("/usr/bin/perl") (which "perl")) - (("/usr/bin/python") (which "python3"))))) + (("/usr/bin/perl") (which "perl"))))) (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))) @@ -436,16 +360,6 @@ (define-public git '("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 @@ -455,36 +369,34 @@ (define-public git (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 + (add-after 'install 'remove-unusable-perl-commands (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")))) + (let ((bin (string-append #$output "/bin")) + (libexec (string-append #$output "/libexec"))) + (for-each (lambda (file) + (delete-file (string-append libexec + "/git-core/" file))) + '("git-svn" "git-cvsimport" "git-archimport" + "git-cvsserver" "git-request-pull" + + ;; git-add--interactive was removed in Git 2.40 but + ;; this phase is inherited by older versions. + #$@(if (version>=? (package-version this-package) + "2.40.1") + #~() + #~("git-add--interactive")) + + "git-cvsexportcommit" + "git-instaweb" "git-send-email")) + (delete-file (string-append bin "/git-cvsserver")) + + ;; These templates typically depend on Perl. Remove them. + (delete-file-recursively + (string-append #$output "/share/git-core/templates/hooks")) + + ;; Gitweb depends on Perl as well. + (delete-file-recursively + (string-append #$output "/share/gitweb"))))) (add-after 'install 'restore-sample-hooks-shebang (lambda _ (let* ((dir (string-append #$output @@ -493,111 +405,20 @@ (define-public git (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")))) - #~())))) - + (find-files dir ".*")))))))) + (native-inputs + ;; Add bash-minimal explicitly to ensure it comes before bash-for-tests, + ;; see . + (list bash-minimal + bash + gettext-minimal + perl)) + (inputs + (list curl ;for HTTP(S) access + expat ;for 'git push' over HTTP(S) + openssl + perl + zlib)) (native-search-paths ;; For HTTPS access, Git needs a single-file certificate bundle, specified ;; with $GIT_SSL_CAINFO. @@ -610,7 +431,6 @@ (define-public git (variable "GIT_EXEC_PATH") (separator #f) ;single entry (files '("libexec/git-core"))))) - (synopsis "Distributed version control system") (description "Git is a free distributed version control system designed to handle @@ -632,76 +452,237 @@ (define-public git (license license:gpl2) (home-page "https://git-scm.com/"))) -(define-public git-minimal - ;; The size of the closure of 'git-minimal' is two thirds that of 'git'. - ;; Its test suite runs slightly faster and most importantly it doesn't - ;; depend on packages that are expensive to build such as Subversion. - (package - (inherit git) - (name "git-minimal") +(define-public git + (package/inherit git-minimal + (name "git") + (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 - (substitute-keyword-arguments (package-arguments git) - ((#:phases phases) + (substitute-keyword-arguments (package-arguments git-minimal) + ((#:disallowed-references disallowed-refs ''()) + (delete perl disallowed-refs)) + ((#:make-flags flags #~'()) + #~(cons "USE_LIBPCRE2=yes" #$flags)) + ((#:configure-flags flags #~'()) + ;; The explicit --with-tcltk forces the build system to hardcode the + ;; absolute file name to 'wish'. + #~(cons (string-append "--with-tcltk=" + (search-input-file %build-inputs + "bin/wish8.6")) + #$flags)) + ((#:phases phases '%standard-phases) #~(modify-phases #$phases + (delete 'remove-unusable-perl-commands) (replace 'patch-makefiles (lambda _ (substitute* "Makefile" - (("/usr/bin/perl") (which "perl"))))) - (delete 'build-subtree) - (delete 'split) - (delete 'install-man-pages) - (delete 'install-info-manual) - (delete 'install-subtree) - (delete 'install-credential-netrc) - (delete 'install-credential-libsecret) - (add-after 'install 'remove-unusable-perl-commands - (lambda* (#:key outputs #:allow-other-keys) - (let ((bin (string-append #$output "/bin")) - (libexec (string-append #$output "/libexec"))) - (for-each (lambda (file) - (delete-file (string-append libexec - "/git-core/" file))) - '("git-svn" "git-cvsimport" "git-archimport" - "git-cvsserver" "git-request-pull" - - ;; git-add--interactive was removed in Git 2.40 but - ;; this phase is inherited by older versions. - #$@(if (version>=? (package-version this-package) - "2.40.1") - #~() - #~("git-add--interactive")) - - "git-cvsexportcommit" - "git-instaweb" "git-send-email")) - (delete-file (string-append bin "/git-cvsserver")) - - ;; These templates typically depend on Perl. Remove them. - (delete-file-recursively - (string-append #$output "/share/git-core/templates/hooks")) - - ;; Gitweb depends on Perl as well. - (delete-file-recursively - (string-append #$output "/share/gitweb"))))))) - ((#:make-flags flags) - #~(delete "USE_LIBPCRE2=yes" #$flags)) - ((#:configure-flags flags) - #~(list #$@(if (%current-target-system) - git-cross-configure-flags - '()))) - ((#:disallowed-references lst '()) - `(,perl ,@lst)))) - (outputs '("out")) + (("/usr/bin/perl") (which "perl")) + (("/usr/bin/python") (which "python3"))))) + (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-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-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 '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-" (package-version this-package) + ".tar.xz")) + (sha256 + (base32 + "0xsqakgy0s60zpa13ilj6zj420kdh8pf4v3nrp1nziwj8ja4qymw")))))))))))) (native-inputs - `(("bash" ,bash-minimal) - ("bash-for-tests" ,bash) - ("native-perl" ,perl) - ("gettext" ,gettext-minimal))) + (modify-inputs (package-native-inputs git-minimal) + ;; For subtree documentation. + (append asciidoc + docbook2x + docbook-xsl + libxslt + pkg-config + texinfo + xmlto))) (inputs - (list curl ;for HTTP(S) access - expat ;for 'git push' over HTTP(S) - openssl - perl - zlib)))) + (modify-inputs (package-inputs git-minimal) + (append python ;for git-p4 + + ;; For PCRE support in git grep (USE_LIBPCRE2). + pcre2 + + ;; For 'gitweb.cgi'. + perl-cgi + + ;; 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))))) ;;; The symbol git-minimal/fixed should be used when git-minimal needs fixes ;;; (security or else) and this deprecation could be removed. -- 2.41.0