2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchFromSourcehut
|
|
|
|
, buildGoModule
|
2021-05-20 23:08:51 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, srht
|
2023-10-19 13:55:26 +00:00
|
|
|
, python-hglib
|
2021-05-20 23:08:51 +00:00
|
|
|
, scmsrht
|
|
|
|
, unidiff
|
|
|
|
, python
|
2022-06-16 17:23:12 +00:00
|
|
|
, unzip
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hgsrht";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.32.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~sircmpwn";
|
|
|
|
repo = "hg.sr.ht";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = version;
|
2023-11-16 04:20:00 +00:00
|
|
|
sha256 = "mYkA44c9wy/Iy1h1lXkVpc9gN7rQXFm4T3YBlQ1Dj60=";
|
2022-06-16 17:23:12 +00:00
|
|
|
vc = "hg";
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "all: api hgsrht-keys" ""
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
substituteInPlace hgsrht-shell \
|
|
|
|
--replace /var/log/hgsrht-shell /var/log/sourcehut/hgsrht-shell
|
2022-06-16 17:23:12 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
hgsrht-api = buildGoModule ({
|
|
|
|
inherit src version;
|
|
|
|
pname = "hgsrht-api";
|
|
|
|
modRoot = "api";
|
2023-11-16 04:20:00 +00:00
|
|
|
vendorHash = "sha256-vuOYpnF3WjA6kOe9MVSuVMhJBQqCmIex+QUBJrP+VDs=";
|
2022-06-16 17:23:12 +00:00
|
|
|
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; });
|
|
|
|
|
|
|
|
hgsrht-keys = buildGoModule {
|
|
|
|
inherit src version;
|
|
|
|
pname = "hgsrht-keys";
|
|
|
|
modRoot = "hgsrht-keys";
|
2023-10-09 19:29:22 +00:00
|
|
|
vendorHash = "sha256-7ti8xCjSrxsslF7/1X/GY4FDl+69hPL4UwCDfjxmJLU=";
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace hgsrht-keys/main.go \
|
|
|
|
--replace /var/log/hgsrht-keys /var/log/sourcehut/hgsrht-keys
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2023-10-19 13:55:26 +00:00
|
|
|
python-hglib
|
2020-04-24 23:36:52 +00:00
|
|
|
scmsrht
|
2023-11-16 04:20:00 +00:00
|
|
|
srht
|
2020-04-24 23:36:52 +00:00
|
|
|
unidiff
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export PKGVER=${version}
|
2021-05-20 23:08:51 +00:00
|
|
|
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-06-16 17:23:12 +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-12-30 13:39:12 +00:00
|
|
|
pythonImportsCheck = [ "hgsrht" ];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://git.sr.ht/~sircmpwn/hg.sr.ht";
|
|
|
|
description = "Mercurial repository hosting service for the sr.ht network";
|
2021-12-30 13:39:12 +00:00
|
|
|
license = licenses.agpl3Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ eadwu ];
|
|
|
|
};
|
|
|
|
}
|