Skip to content

Commit

Permalink
tortoisehg: untie from mercurial and update to 5.0.2 (#66173)
Browse files Browse the repository at this point in the history
* tortoisehg: untie from mercurial

When I've added `tortoisehg` package, it turned out that mercurial updates
sometimes broke thg. I've added a comment to `mercurial/default.nix` to
update torotisehg version during mercurial updates, but this worked the other way round:
mercurial stopped to be updated regularly (#60993).

And sadly it didn't solve the issue - #61759.

Here I'm trying to untie them. Tortoisehg will build a custom mercurial package
if versions don't match. This makes updating tortoisehg more complicated,
but it is still better than current situation.

* expose custom mercurial from thg package
  • Loading branch information
danbst committed Aug 18, 2019
1 parent 2ca09a9 commit a2ea2a1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 19 deletions.
25 changes: 14 additions & 11 deletions pkgs/applications/version-management/mercurial/default.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
{ stdenv, fetchurl, python2Packages, makeWrapper, unzip
, guiSupport ? false, tk ? null
, ApplicationServices }:
, ApplicationServices
, mercurialSrc ? fetchurl rec {
meta.name = "mercurial-${meta.version}";
meta.version = "4.9.1";
url = "https://mercurial-scm.org/release/${meta.name}.tar.gz";
sha256 = "0iybbkd9add066729zg01kwz5hhc1s6lhp9rrnsmzq6ihyxj3p8v";
}
}:

let
# if you bump version, update pkgs.tortoisehg too or ping maintainer
version = "4.9.1";
name = "mercurial-${version}";
inherit (python2Packages) docutils hg-git dulwich python;

in python2Packages.buildPythonApplication {
inherit name;
format = "other";

src = fetchurl {
url = "https://mercurial-scm.org/release/${name}.tar.gz";
sha256 = "0iybbkd9add066729zg01kwz5hhc1s6lhp9rrnsmzq6ihyxj3p8v";
};
inherit (mercurialSrc.meta) name version;
src = mercurialSrc;

format = "other";

inherit python; # pass it so that the same version can be used in hg2git

Expand Down Expand Up @@ -55,7 +58,7 @@ in python2Packages.buildPythonApplication {
'';

meta = {
inherit version;
inherit (mercurialSrc.meta) version;
description = "A fast, lightweight SCM system for very large distributed projects";
homepage = https://www.mercurial-scm.org;
downloadPage = https://www.mercurial-scm.org/release/;
Expand Down
35 changes: 27 additions & 8 deletions pkgs/applications/version-management/tortoisehg/default.nix
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
{lib, fetchurl, mercurial, python2Packages}:
{ lib, fetchurl, python2Packages
, mercurial
}@args:
let
tortoisehgSrc = fetchurl rec {
meta.name = "tortoisehg-${meta.version}";
meta.version = "5.0.2";
url = "https://bitbucket.org/tortoisehg/targz/downloads/${meta.name}.tar.gz";
sha256 = "1fkawx4ymaacah2wpv2w7rxmv1mx08mg4x4r4fxh41jz1njjb8sz";
};

python2Packages.buildPythonApplication rec {
name = "tortoisehg-${version}";
version = "5.0.2";
mercurial =
if args.mercurial.meta.version == tortoisehgSrc.meta.version
then args.mercurial
else args.mercurial.override {
mercurialSrc = fetchurl rec {
meta.name = "mercurial-${meta.version}";
meta.version = tortoisehgSrc.meta.version;
url = "https://mercurial-scm.org/release/${meta.name}.tar.gz";
sha256 = "1y60hfc8gh4ha9sw650qs7hndqmvbn0qxpmqwpn4q18z5xwm1f19";
};
};

src = fetchurl {
url = "https://bitbucket.org/tortoisehg/targz/downloads/${name}.tar.gz";
sha256 = "1fkawx4ymaacah2wpv2w7rxmv1mx08mg4x4r4fxh41jz1njjb8sz";
};
in python2Packages.buildPythonApplication rec {

inherit (tortoisehgSrc.meta) name version;
src = tortoisehgSrc;

pythonPath = with python2Packages; [ pyqt4 mercurial qscintilla iniparse ];

Expand All @@ -28,6 +45,8 @@ python2Packages.buildPythonApplication rec {
$out/bin/thg version
'';

passthru.mercurial = mercurial;

meta = {
description = "Qt based graphical tool for working with Mercurial";
homepage = https://tortoisehg.bitbucket.io/;
Expand Down

0 comments on commit a2ea2a1

Please sign in to comment.