jenkins: 2.479.3 -> 2.492.1
[NixPkgs.git] / pkgs / applications / version-management / sourcehut / meta.nix
blobec1893968c1325a6c4b36d74cc2cd80bc0ac0600
2   lib,
3   fetchFromSourcehut,
4   buildPythonPackage,
5   buildGoModule,
6   alembic,
7   bcrypt,
8   dnspython,
9   qrcode,
10   redis,
11   srht,
12   stripe,
13   prometheus-client,
14   zxcvbn,
15   python,
16   unzip,
17   pip,
18   pythonOlder,
19   setuptools,
21 let
22   version = "0.69.8";
23   gqlgen = import ./fix-gqlgen-trimpath.nix {
24     inherit unzip;
25     gqlgenVersion = "0.17.43";
26   };
28   src = fetchFromSourcehut {
29     owner = "~sircmpwn";
30     repo = "meta.sr.ht";
31     rev = version;
32     hash = "sha256-K7p6cytkPYgUuYr7BVfU/+sVbSr2YEmreIDnTatUMyk=";
33   };
35   metasrht-api = buildGoModule (
36     {
37       inherit src version;
38       pname = "metasrht-api";
39       modRoot = "api";
40       vendorHash = "sha256-vIkUK1pigVU8vZL5xpHLeinOga5eXXHTuDkHxwUz6uM=";
41     }
42     // gqlgen
43   );
45 buildPythonPackage rec {
46   pname = "metasrht";
47   inherit version src;
48   pyproject = true;
50   disabled = pythonOlder "3.7";
52   postPatch = ''
53     substituteInPlace Makefile \
54       --replace "all: api" ""
55   '';
57   nativeBuildInputs = [
58     pip
59     setuptools
60   ];
62   propagatedBuildInputs = [
63     alembic
64     bcrypt
65     dnspython
66     qrcode
67     redis
68     srht
69     stripe
70     prometheus-client
71     zxcvbn
72   ];
74   preBuild = ''
75     export PKGVER=${version}
76     export SRHT_PATH=${srht}/${python.sitePackages}/srht
77   '';
79   postInstall = ''
80     mkdir -p $out/bin
81     ln -s ${metasrht-api}/bin/api $out/bin/metasrht-api
82   '';
84   pythonImportsCheck = [ "metasrht" ];
86   meta = with lib; {
87     homepage = "https://git.sr.ht/~sircmpwn/meta.sr.ht";
88     description = "Account management service for the sr.ht network";
89     license = licenses.agpl3Only;
90     maintainers = with maintainers; [
91       eadwu
92       christoph-heiss
93     ];
94   };