Files
nixpkgs/pkgs/by-name/to/tortoisehg/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

84 lines
2.0 KiB
Nix

{
lib,
fetchurl,
python3Packages,
mercurial,
qt5,
}:
let
version = "7.0.1";
in
python3Packages.buildPythonApplication {
pname = "tortoisehg";
inherit version;
pyproject = true;
src = fetchurl {
url = "https://www.mercurial-scm.org/release/tortoisehg/targz/tortoisehg-${version}.tar.gz";
hash = "sha256-rCDLZ2ppD3Y71c31UNir/1pW1QBJViMP9JdoJiWf0nk=";
};
build-system = with python3Packages; [ setuptools ];
nativeBuildInputs = [
qt5.wrapQtAppsHook
];
dependencies = with python3Packages; [
mercurial
# The one from python3Packages
qscintilla-qt5
iniparse
];
buildInputs = [
# Makes wrapQtAppsHook add these qt libraries to the wrapper search paths
qt5.qtwayland
];
# In order to spare double wrapping, we use:
preFixup = ''
makeWrapperArgs+=("''${qtWrapperArgs[@]}")
'';
# Convenient alias
postInstall = ''
ln -s $out/bin/thg $out/bin/tortoisehg
install -D --mode=0644 contrib/thg.desktop --target-directory $out/share/applications/
'';
# In python3Packages.buildPythonApplication doCheck is always true, and we
# override it to not run the default unittests
checkPhase = ''
runHook preCheck
$out/bin/thg version | grep -q "${version}"
# Detect breakage of thg in case of out-of-sync mercurial update. In that
# case any thg subcommand just opens up an gui dialog with a description of
# version mismatch.
echo "thg smoke test"
$out/bin/thg -h > help.txt &
sleep 1s
grep -q "list of commands" help.txt
runHook postCheck
'';
passthru = {
# If at some point we'll override this argument, it might be useful to have
# access to it here.
inherit mercurial;
};
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
gbtb
];
};
}