2021-04-18 03:15:43 +00:00
|
|
|
{ lib
|
2022-06-02 11:35:20 +00:00
|
|
|
, fetchFromSourcehut
|
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
|
|
|
}:
|
2019-01-22 02:01:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hgsrht";
|
2022-06-02 12:35:27 +00:00
|
|
|
version = "0.31.3";
|
2019-01-22 02:01:52 +00:00
|
|
|
|
2022-06-02 11:35:20 +00:00
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~sircmpwn";
|
|
|
|
repo = "hg.sr.ht";
|
2019-01-22 02:01:52 +00:00
|
|
|
rev = version;
|
2022-06-02 12:35:27 +00:00
|
|
|
sha256 = "4Qe08gqsSTMQVQBchFPEUXuxM8ZAAQGJT1EOcDjkZa0=";
|
2022-06-02 11:35:20 +00:00
|
|
|
vc = "hg";
|
2022-05-05 22:04:22 +00:00
|
|
|
};
|
2022-06-02 11:44:52 +00:00
|
|
|
|
2022-05-05 22:04:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "all: api hgsrht-keys" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
hgsrht-api = buildGoModule ({
|
|
|
|
inherit src version;
|
|
|
|
pname = "hgsrht-api";
|
|
|
|
modRoot = "api";
|
2022-06-02 12:35:27 +00:00
|
|
|
vendorSha256 = "sha256-uIP3W7UJkP68HJUF33kz5xfg/KBiaSwMozFYmQJQkys=";
|
2022-06-02 11:44:52 +00:00
|
|
|
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; });
|
2022-05-05 22:04:22 +00:00
|
|
|
|
|
|
|
hgsrht-keys = buildGoModule {
|
|
|
|
inherit src version;
|
|
|
|
pname = "hgsrht-keys";
|
|
|
|
modRoot = "hgsrht-keys";
|
|
|
|
vendorSha256 = "sha256-7ti8xCjSrxsslF7/1X/GY4FDl+69hPL4UwCDfjxmJLU=";
|
2019-01-22 02:01:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
srht
|
|
|
|
hglib
|
|
|
|
scmsrht
|
|
|
|
unidiff
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export PKGVER=${version}
|
2021-04-18 03:15:43 +00:00
|
|
|
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
2019-01-22 02:01:52 +00:00
|
|
|
'';
|
|
|
|
|
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" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://git.sr.ht/~sircmpwn/hg.sr.ht";
|
2019-01-22 02:01:52 +00:00
|
|
|
description = "Mercurial repository hosting service for the sr.ht network";
|
2021-08-15 20:54:11 +00:00
|
|
|
license = licenses.agpl3Only;
|
2019-01-22 02:01:52 +00:00
|
|
|
maintainers = with maintainers; [ eadwu ];
|
|
|
|
};
|
|
|
|
}
|