jenkins: 2.479.3 -> 2.492.1
[NixPkgs.git] / pkgs / applications / version-management / sourcehut / hub.nix
blob5a800275e4ca80fd603fce458c32a9fee7631e2e
2   lib,
3   fetchFromSourcehut,
4   buildGoModule,
5   buildPythonPackage,
6   python,
7   srht,
8   setuptools,
9   pip,
10   pyyaml,
11   pythonOlder,
12   unzip,
15 let
16   version = "0.17.7";
17   gqlgen = import ./fix-gqlgen-trimpath.nix {
18     inherit unzip;
19     gqlgenVersion = "0.17.43";
20   };
22   src = fetchFromSourcehut {
23     owner = "~sircmpwn";
24     repo = "hub.sr.ht";
25     rev = version;
26     hash = "sha256-IyY7Niy/vZSAXjYZMlxY6uuQ8nH/4yT4+MaRjHtl6G4=";
27   };
29   hubsrht-api = buildGoModule (
30     {
31       inherit src version;
32       pname = "hubsrht-api";
33       modRoot = "api";
34       vendorHash = "sha256-GVN11nEJqIHh8MtKvIXe4zcUwJph9eTSkJ2R+ufD+ic=";
35     }
36     // gqlgen
37   );
39 buildPythonPackage rec {
40   inherit src version;
41   pname = "hubsrht";
42   pyproject = true;
44   disabled = pythonOlder "3.7";
46   postPatch = ''
47     substituteInPlace Makefile --replace "all: api" ""
48   '';
50   nativeBuildInputs = [
51     pip
52     setuptools
53   ];
55   propagatedBuildInputs = [
56     srht
57     pyyaml
58   ];
60   preBuild = ''
61     export PKGVER=${version}
62     export SRHT_PATH=${srht}/${python.sitePackages}/srht
63   '';
65   postInstall = ''
66     ln -s ${hubsrht-api}/bin/api $out/bin/hubsrht-api
67   '';
69   # Module has no tests
70   doCheck = false;
72   pythonImportsCheck = [
73     "hubsrht"
74   ];
76   meta = with lib; {
77     homepage = "https://git.sr.ht/~sircmpwn/hub.sr.ht";
78     description = "Project hub service for the sr.ht network";
79     license = licenses.agpl3Only;
80     maintainers = with maintainers; [
81       eadwu
82       christoph-heiss
83     ];
84   };