nixpkgs/pkgs/applications/version-management/sourcehut/hg.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

69 lines
1.5 KiB
Nix
Raw Normal View History

2021-04-18 03:15:43 +00:00
{ lib
, fetchhg
2022-05-05 22:04:22 +00:00
, buildGoModule
2021-04-18 03:15:43 +00:00
, buildPythonPackage
, srht
, hglib
, scmsrht
, unidiff
, python
2022-05-05 22:04:22 +00:00
, unzip
2021-04-18 03:15:43 +00:00
}:
buildPythonPackage rec {
pname = "hgsrht";
2022-05-05 22:04:22 +00:00
version = "0.31.2";
src = fetchhg {
url = "https://hg.sr.ht/~sircmpwn/hg.sr.ht";
rev = version;
2022-05-05 22:04:22 +00:00
sha256 = "F0dBykSSrlis+mumULLxvKNxD75DWR9+IDTYbmhkMDI=";
};
postPatch = ''
substituteInPlace Makefile \
--replace "all: api hgsrht-keys" ""
'';
hgsrht-api = buildGoModule ({
inherit src version;
pname = "hgsrht-api";
modRoot = "api";
vendorSha256 = "sha256-W7A22qSIgJgcfS7xYNrmbYKaZBXbDtPilM9I6DxmTeU=";
} // import ./fix-gqlgen-trimpath.nix {inherit unzip;});
hgsrht-keys = buildGoModule {
inherit src version;
pname = "hgsrht-keys";
modRoot = "hgsrht-keys";
vendorSha256 = "sha256-7ti8xCjSrxsslF7/1X/GY4FDl+69hPL4UwCDfjxmJLU=";
};
nativeBuildInputs = srht.nativeBuildInputs;
propagatedBuildInputs = [
srht
hglib
scmsrht
unidiff
];
preBuild = ''
export PKGVER=${version}
2021-04-18 03:15:43 +00:00
export SRHT_PATH=${srht}/${python.sitePackages}/srht
'';
2022-05-05 22:04:22 +00:00
postInstall = ''
ln -s ${hgsrht-api}/bin/api $out/bin/hgsrht-api
ln -s ${hgsrht-keys}/bin/hgsrht-keys $out/bin/hgsrht-keys
'';
2021-08-15 21:11:47 +00:00
pythonImportsCheck = [ "hgsrht" ];
meta = with lib; {
homepage = "https://git.sr.ht/~sircmpwn/hg.sr.ht";
description = "Mercurial repository hosting service for the sr.ht network";
2021-08-15 20:54:11 +00:00
license = licenses.agpl3Only;
maintainers = with maintainers; [ eadwu ];
};
}