diff options
author | Will Dietz <github@wdtz.org> | 2018-04-26 08:49:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-26 08:49:04 -0500 |
commit | 6e623fb07b6d0642b10f878148dea14ad8ff4d74 (patch) | |
tree | 225f2a86e1fc3b3b65887e1bd40b9a9b6bc0103b | |
parent | bdf390f9959d64de5300d9d3a2bf1625c0ba4c1f (diff) | |
parent | 6dda53ad223686ae39d8e073f92b129a4aa688c1 (diff) | |
download | nixlib-6e623fb07b6d0642b10f878148dea14ad8ff4d74.tar nixlib-6e623fb07b6d0642b10f878148dea14ad8ff4d74.tar.gz nixlib-6e623fb07b6d0642b10f878148dea14ad8ff4d74.tar.bz2 nixlib-6e623fb07b6d0642b10f878148dea14ad8ff4d74.tar.lz nixlib-6e623fb07b6d0642b10f878148dea14ad8ff4d74.tar.xz nixlib-6e623fb07b6d0642b10f878148dea14ad8ff4d74.tar.zst nixlib-6e623fb07b6d0642b10f878148dea14ad8ff4d74.zip |
Merge pull request #39461 from dtzWill/update/git-2.17.0-again
git: 2.16.3 -> 2.17.0, again, installCheck
-rw-r--r-- | pkgs/applications/version-management/git-and-tools/git/default.nix | 73 | ||||
-rw-r--r-- | pkgs/applications/version-management/git-and-tools/git/installCheck-path.patch | 12 |
2 files changed, 73 insertions, 12 deletions
diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix index fe9f3136e58f..21e9a805c108 100644 --- a/pkgs/applications/version-management/git-and-tools/git/default.nix +++ b/pkgs/applications/version-management/git-and-tools/git/default.nix @@ -18,7 +18,7 @@ assert sendEmailSupport -> perlSupport; assert svnSupport -> perlSupport; let - version = "2.16.3"; + version = "2.17.0"; svn = subversionClient.override { perlBindings = perlSupport; }; in @@ -27,19 +27,24 @@ stdenv.mkDerivation { src = fetchurl { url = "https://www.kernel.org/pub/software/scm/git/git-${version}.tar.xz"; - sha256 = "0j1dwvg5llnj3g0fp8hdgpms4hp90qw9f6509vqw30dhwplrjpfn"; + sha256 = "1ismz7nsz8dgjmk782xr9s0mr2qh06f72pdcgbxfmnw1bvlya5p9"; }; outputs = [ "out" ] ++ stdenv.lib.optional perlSupport "gitweb"; hardeningDisable = [ "format" ]; + enableParallelBuilding = true; + + ## Patch + patches = [ ./docbook2texi.patch ./symlinks-in-bin.patch ./git-sh-i18n.patch ./ssh-path.patch ./git-send-email-honor-PATH.patch + ./installCheck-path.patch ]; postPatch = '' @@ -47,6 +52,10 @@ stdenv.mkDerivation { substituteInPlace "$x" \ --subst-var-by ssh "${openssh}/bin/ssh" done + + # Fix references to gettext introduced by ./git-sh-i18n.patch + substituteInPlace git-sh-i18n.sh \ + --subst-var-by gettext ${gettext} ''; nativeBuildInputs = [ gettext perl ] @@ -58,7 +67,6 @@ stdenv.mkDerivation { ++ stdenv.lib.optionals withpcre2 [ pcre2 ] ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.Security ]; - # required to support pthread_cancel() NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.cc.isClang) "-lgcc_s" + stdenv.lib.optionalString (stdenv.isFreeBSD) "-lthr"; @@ -90,15 +98,17 @@ stdenv.mkDerivation { popd ''; - # FIXME: "make check" requires Sparse; the Makefile must be tweaked - # so that `SPARSE_FLAGS' corresponds to the current architecture... - #doCheck = true; + + ## Install + + # WARNING: Do not `rm` or `mv` files from the source tree; use `cp` instead. + # We need many of these files during the installCheckPhase. installFlags = "NO_INSTALL_HARDLINKS=1"; preInstall = stdenv.lib.optionalString stdenv.isDarwin '' mkdir -p $out/bin - mv $PWD/contrib/credential/osxkeychain/git-credential-osxkeychain $out/bin + cp -a $PWD/contrib/credential/osxkeychain/git-credential-osxkeychain $out/bin ''; postInstall = @@ -116,7 +126,7 @@ stdenv.mkDerivation { # Install contrib stuff. mkdir -p $out/share/git - mv contrib $out/share/git/ + cp -a contrib $out/share/git/ ln -s "$out/share/git/contrib/credential/netrc/git-credential-netrc" $out/bin/ mkdir -p $out/share/emacs/site-lisp ln -s "$out/share/git/contrib/emacs/"*.el $out/share/emacs/site-lisp/ @@ -149,9 +159,6 @@ stdenv.mkDerivation { perl -0777 -i -pe "$SCRIPT" \ $out/libexec/git-core/git-{sh-setup,filter-branch,merge-octopus,mergetool,quiltimport,request-pull,stash,submodule,subtree,web--browse} - # Fix references to gettext. - substituteInPlace $out/libexec/git-core/git-sh-i18n \ - --subst-var-by gettext ${gettext} # Also put git-http-backend into $PATH, so that we can use smart # HTTP(s) transports for pushing @@ -229,7 +236,49 @@ EOF ''; - enableParallelBuilding = true; + ## InstallCheck + + doInstallCheck = true; + + installCheckTarget = "test"; + + # see also installCheckFlagsArray + installCheckFlags = "DEFAULT_TEST_TARGET=prove"; + + preInstallCheck = '' + installCheckFlagsArray+=( + GIT_PROVE_OPTS="--jobs $NIX_BUILD_CORES --failures --state=failed,save" + GIT_TEST_INSTALLED=$out/bin + ${stdenv.lib.optionalString (!svnSupport) "NO_SVN_TESTS=y"} + ) + + function disable_test { + local test=$1 pattern=$2 + if [ $# -eq 1 ]; then + mv t/{,skip-}$test.sh || true + else + sed -i t/$test.sh \ + -e "/^ *test_expect_.*$pattern/,/^ *' *\$/{s/^/#/}" + fi + } + + # Shared permissions are forbidden in sandbox builds. + disable_test t0001-init shared + disable_test t1301-shared-repo + + # Our patched gettext never fallbacks + disable_test t0201-gettext-fallbacks + + ${stdenv.lib.optionalString (!sendEmailSupport) '' + # Disable sendmail tests + disable_test t9001-send-email + ''} + + # XXX: I failed to understand why this one fails. + # Could someone try to re-enable it on the next release ? + disable_test t1700-split-index "null sha1" + ''; + meta = { homepage = https://git-scm.com/; diff --git a/pkgs/applications/version-management/git-and-tools/git/installCheck-path.patch b/pkgs/applications/version-management/git-and-tools/git/installCheck-path.patch new file mode 100644 index 000000000000..8c68fb9f186b --- /dev/null +++ b/pkgs/applications/version-management/git-and-tools/git/installCheck-path.patch @@ -0,0 +1,12 @@ +diff --git a/t/test-lib.sh b/t/test-lib.sh +--- a/t/test-lib.sh ++++ b/t/test-lib.sh +@@ -923,7 +923,7 @@ + then + GIT_EXEC_PATH=$($GIT_TEST_INSTALLED/git --exec-path) || + error "Cannot run git from $GIT_TEST_INSTALLED." +- PATH=$GIT_TEST_INSTALLED:$GIT_BUILD_DIR:$PATH ++ PATH=$GIT_TEST_INSTALLED:$GIT_BUILD_DIR/t/helper:$GIT_BUILD_DIR:$PATH + GIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH} + else # normal case, use ../bin-wrappers only unless $with_dashes: + git_bin_dir="$GIT_BUILD_DIR/bin-wrappers" |