From 7a5371683c84574a1bd8dde55c169995a48b0a66 Mon Sep 17 00:00:00 2001 From: pacien Date: Wed, 17 Nov 2021 20:28:43 +0100 Subject: [PATCH 1/6] mercurial: 5.9.3 -> 6.0 --- pkgs/applications/version-management/mercurial/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index eea3e7afb774..9c15bc8016d0 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -13,11 +13,11 @@ let self = python3Packages.buildPythonApplication rec { pname = "mercurial"; - version = "5.9.3"; + version = "6.0"; src = fetchurl { url = "https://mercurial-scm.org/release/mercurial-${version}.tar.gz"; - sha256 = "sha256-O0P2iXetD6dap/HlyPCoO6k1YhqyOWEpq7SY5W0b4I4="; + sha256 = "sha256-U7aLflkq3OOk5CHaO/+qz8dyH0A6rDGebSxRIldN5i8="; }; format = "other"; @@ -27,7 +27,7 @@ let cargoDeps = if rustSupport then rustPlatform.fetchCargoTarball { inherit src; name = "${pname}-${version}"; - sha256 = "sha256:1d911jaawdrcv2mdhlp2ylr10791zj7dhb69aiw5yy7vn7gry82n"; + sha256 = "sha256-gyMwhPVZRezjYeLHfB9WPkc01TzPgOU2dZkmP5dFKks="; sourceRoot = "${pname}-${version}/rust"; } else null; cargoRoot = if rustSupport then "rust" else null; From f50b6821dc48682f0a3f50eec9c383d99972c705 Mon Sep 17 00:00:00 2001 From: pacien Date: Wed, 17 Nov 2021 20:30:11 +0100 Subject: [PATCH 2/6] mercurial: patch shebangs in all scripts --- .../version-management/mercurial/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index 9c15bc8016d0..2e207cacb2b2 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -32,6 +32,15 @@ let } else null; cargoRoot = if rustSupport then "rust" else null; + postPatch = '' + patchShebangs . + + for f in **/*.{py,c,t}; do + # not only used in shebangs + substituteAllInPlace "$f" '/bin/sh' '${stdenv.shell}' + done + ''; + propagatedBuildInputs = lib.optional re2Support fb-re2 ++ lib.optional gitSupport pygit2 ++ lib.optional highlightSupport pygments; From ff98d0e50e55cdb0c5da7ef4dc8617489ead7a0d Mon Sep 17 00:00:00 2001 From: pacien Date: Wed, 17 Nov 2021 20:31:01 +0100 Subject: [PATCH 3/6] mercurial: enable check phase --- .../version-management/mercurial/default.nix | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index 2e207cacb2b2..d7c7da8795fb 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -6,6 +6,12 @@ , guiSupport ? fullBuild, tk , highlightSupport ? fullBuild , ApplicationServices +# test dependencies +, unzip +, which +, sqlite +, git +, gnupg }: let @@ -56,6 +62,25 @@ let makeFlags = [ "PREFIX=$(out)" ] ++ lib.optional rustSupport "PURE=--rust"; + doCheck = true; + checkInputs = [ + unzip + which + sqlite + git + gnupg + ]; + checkPhase = '' + cat << EOF > tests/blacklists/nix + # tests enforcing "/usr/bin/env" shebangs, which are patched for nix + test-run-tests.t + test-check-shbang.t + EOF + + export HGTESTFLAGS="--blacklist blacklists/nix" + make check + ''; + postInstall = (lib.optionalString guiSupport '' mkdir -p $out/etc/mercurial cp contrib/hgk $out/bin From c8ab07a8e1fcee6cad9165b9663377cc409d85c3 Mon Sep 17 00:00:00 2001 From: pacien Date: Wed, 5 Jan 2022 23:17:06 +0100 Subject: [PATCH 4/6] mercurial: 6.0 -> 6.0.1 --- pkgs/applications/version-management/mercurial/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index d7c7da8795fb..ee86cbda6d89 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -19,11 +19,11 @@ let self = python3Packages.buildPythonApplication rec { pname = "mercurial"; - version = "6.0"; + version = "6.0.1"; src = fetchurl { url = "https://mercurial-scm.org/release/mercurial-${version}.tar.gz"; - sha256 = "sha256-U7aLflkq3OOk5CHaO/+qz8dyH0A6rDGebSxRIldN5i8="; + sha256 = "sha256-Bf0LSAOJyWVH9abHaekO4A8dE/esDUZeQKOBxs86VuI="; }; format = "other"; @@ -33,7 +33,7 @@ let cargoDeps = if rustSupport then rustPlatform.fetchCargoTarball { inherit src; name = "${pname}-${version}"; - sha256 = "sha256-gyMwhPVZRezjYeLHfB9WPkc01TzPgOU2dZkmP5dFKks="; + sha256 = "sha256-leyLb6RqntiuEhmJSUkZRUuO8ah0BZI5OhKkGbWRjxs="; sourceRoot = "${pname}-${version}/rust"; } else null; cargoRoot = if rustSupport then "rust" else null; From 3d869b89b0ed87520d7c925ae63d1e0e0929fd3c Mon Sep 17 00:00:00 2001 From: pacien Date: Thu, 6 Jan 2022 07:51:01 +0100 Subject: [PATCH 5/6] mercurial: disable check phase on Darwin The tests seem to be unstable in the Darwin env. --- pkgs/applications/version-management/mercurial/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index ee86cbda6d89..b0d7c26abdd6 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -62,7 +62,7 @@ let makeFlags = [ "PREFIX=$(out)" ] ++ lib.optional rustSupport "PURE=--rust"; - doCheck = true; + doCheck = stdenv.isLinux; # tests seem unstable on Darwin checkInputs = [ unzip which From 8e39c0f750f91c6717f017355de9f381344e9286 Mon Sep 17 00:00:00 2001 From: pacien Date: Thu, 6 Jan 2022 07:51:49 +0100 Subject: [PATCH 6/6] mercurial: extend tests timeout Which otherwise often time out on our busy CI workers. --- pkgs/applications/version-management/mercurial/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index b0d7c26abdd6..8320491758ea 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -77,7 +77,8 @@ let test-check-shbang.t EOF - export HGTESTFLAGS="--blacklist blacklists/nix" + # extended timeout necessary for tests to pass on the busy CI workers + export HGTESTFLAGS="--blacklist blacklists/nix --timeout 600" make check '';