summary refs log tree commit diff
path: root/pkgs/applications/version-management/tortoisehg/default.nix
blob: 66f3b9a0aaf33858e7a512c0bb5e6ae9178c6a70 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{ lib
, fetchurl
, python3Packages
, mercurial
, qt5
}:

python3Packages.buildPythonApplication rec {
  pname = "tortoisehg";
  version = "6.0";

  src = fetchurl {
    url = "https://www.mercurial-scm.org/release/tortoisehg/targz/tortoisehg-${version}.tar.gz";
    sha256 = "sha256-25uQ2llF/+wqdGpun/nzlvAf286OIRmlZUISZ0szH6Y=";
  };

  # Extension point for when thg's mercurial is lagging behind mainline.
  tortoiseMercurial = mercurial;

  propagatedBuildInputs = with python3Packages; [
    tortoiseMercurial
    qscintilla-qt5
    iniparse
  ];
  nativeBuildInputs = [ qt5.wrapQtAppsHook ];

  doCheck = true;
  postInstall = ''
    mkdir -p $out/share/doc/tortoisehg
    cp COPYING.txt $out/share/doc/tortoisehg/Copying.txt
    # convenient alias
    ln -s $out/bin/thg $out/bin/tortoisehg
    wrapQtApp $out/bin/thg
  '';

  checkPhase = ''
    export QT_QPA_PLATFORM=offscreen
    echo "test: thg smoke test"
    $out/bin/thg -h > help.txt &
    sleep 1s
    if grep "list of commands" help.txt; then
      echo "thg help output was captured. Seems like package in a working state."
      exit 0
    else
      echo "thg help output was not captured. Seems like package is broken."
      exit 1
    fi
  '';

  passthru.mercurial = tortoiseMercurial;

  meta = {
    description = "Qt based graphical tool for working with Mercurial";
    homepage = "https://tortoisehg.bitbucket.io/";
    license = lib.licenses.gpl2Only;
    platforms = lib.platforms.linux;
    maintainers = with lib.maintainers; [ danbst ];
  };
}