2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromSourcehut
|
2023-11-16 04:20:00 +00:00
|
|
|
, buildGoModule
|
2021-05-20 23:08:51 +00:00
|
|
|
, buildPythonPackage
|
2023-11-16 04:20:00 +00:00
|
|
|
, python
|
2021-05-20 23:08:51 +00:00
|
|
|
, srht
|
2022-11-02 22:02:43 +00:00
|
|
|
, pyyaml
|
2023-11-16 04:20:00 +00:00
|
|
|
, unzip
|
2021-05-20 23:08:51 +00:00
|
|
|
}:
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "hubsrht";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.17.2";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~sircmpwn";
|
|
|
|
repo = "hub.sr.ht";
|
2020-09-25 04:45:31 +00:00
|
|
|
rev = version;
|
2023-11-16 04:20:00 +00:00
|
|
|
sha256 = "sha256-A+lvRsPz5EBnM0gB4PJuxSMpELZTrK14ORxDbTKPXWg=";
|
2020-09-25 04:45:31 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile --replace "all: api" ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
hubsrht-api = buildGoModule ({
|
|
|
|
inherit src version;
|
|
|
|
pname = "hubsrht-api";
|
|
|
|
modRoot = "api";
|
|
|
|
vendorHash = "sha256-K5EmZ4U+xItTR85+SCwhwg5KUGLkKHo9Nr2pkvmJpfo=";
|
|
|
|
} // import ./fix-gqlgen-trimpath.nix { inherit unzip; });
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
srht
|
2022-11-02 22:02:43 +00:00
|
|
|
pyyaml
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
export PKGVER=${version}
|
2023-11-16 04:20:00 +00:00
|
|
|
export SRHT_PATH=${srht}/${python.sitePackages}/srht
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
ln -s ${hubsrht-api}/bin/api $out/bin/hubsrht-api
|
2020-09-25 04:45:31 +00:00
|
|
|
'';
|
|
|
|
|
2021-12-30 13:39:12 +00:00
|
|
|
pythonImportsCheck = [ "hubsrht" ];
|
2021-01-09 10:05:03 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-09-25 04:45:31 +00:00
|
|
|
homepage = "https://git.sr.ht/~sircmpwn/hub.sr.ht";
|
|
|
|
description = "Project hub service for the sr.ht network";
|
2021-12-30 13:39:12 +00:00
|
|
|
license = licenses.agpl3Only;
|
2020-09-25 04:45:31 +00:00
|
|
|
maintainers = with maintainers; [ eadwu ];
|
|
|
|
};
|
|
|
|
}
|