forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / applications / version-management / sourcehut / man.nix
blobf5cd6be139acdc4c11b04ee69b5c31c7c01ac16b
1 { lib
2 , fetchFromSourcehut
3 , buildGoModule
4 , buildPythonPackage
5 , srht
6 , pygit2
7 , python
8 , unzip
9 , pip
10 , pythonOlder
11 , setuptools
14 let
15   version = "0.16.5";
16   gqlgen = import ./fix-gqlgen-trimpath.nix { inherit unzip; gqlgenVersion = "0.17.43"; };
18   src = fetchFromSourcehut {
19     owner = "~sircmpwn";
20     repo = "man.sr.ht";
21     rev = version;
22     hash = "sha256-JFMtif2kIE/fs5PNcQtkJikAFNszgZTU7BG/8fTncTI=";
23   };
25   mansrht-api = buildGoModule ({
26     inherit src version;
27     pname = "mansrht-api";
28     modRoot = "api";
29     vendorHash = "sha256-GVN11nEJqIHh8MtKvIXe4zcUwJph9eTSkJ2R+ufD+ic=";
30   } // gqlgen);
32 buildPythonPackage rec {
33   inherit src version;
34   pname = "mansrht";
35   pyproject = true;
37   disabled = pythonOlder "3.7";
39   postPatch = ''
40     substituteInPlace Makefile --replace "all: api" ""
41   '';
43   nativeBuildInputs = [
44     pip
45     setuptools
46   ];
48   propagatedBuildInputs = [
49     srht
50     pygit2
51   ];
53   preBuild = ''
54     export PKGVER=${version}
55     export SRHT_PATH=${srht}/${python.sitePackages}/srht
56   '';
58   postInstall = ''
59     ln -s ${mansrht-api}/bin/api $out/bin/mansrht-api
60   '';
62   pythonImportsCheck = [ "mansrht" ];
64   meta = with lib; {
65     homepage = "https://git.sr.ht/~sircmpwn/man.sr.ht";
66     description = "Wiki service for the sr.ht network";
67     license = licenses.agpl3Only;
68     maintainers = with maintainers; [ eadwu christoph-heiss ];
69   };