polkit: fix building with clang (#376893)
[NixPkgs.git] / pkgs / applications / version-management / sourcehut / paste.nix
blob3e0800f6b0149c9d9505ee645c556a9364d3a520
2   lib,
3   fetchFromSourcehut,
4   buildGoModule,
5   buildPythonPackage,
6   srht,
7   pip,
8   pyyaml,
9   python,
10   pythonOlder,
11   setuptools,
12   unzip,
15 let
16   version = "0.15.4";
17   gqlgen = import ./fix-gqlgen-trimpath.nix {
18     inherit unzip;
19     gqlgenVersion = "0.17.45";
20   };
22   src = fetchFromSourcehut {
23     owner = "~sircmpwn";
24     repo = "paste.sr.ht";
25     rev = version;
26     hash = "sha256-M38hAMRdMzcqxJv7j7foOIYEImr/ZYz/lbYOF9R9g2M=";
27   };
29   pastesrht-api = buildGoModule (
30     {
31       inherit src version;
32       pname = "pastesrht-api";
33       modRoot = "api";
34       vendorHash = "sha256-vt5nSPcx+Y/SaWcqjV38DTL3ZtzmdjbkJYMv5Fhhnq4=";
35     }
36     // gqlgen
37   );
39 buildPythonPackage rec {
40   inherit src version;
41   pname = "pastesrht";
42   pyproject = true;
44   disabled = pythonOlder "3.7";
46   postPatch = ''
47     substituteInPlace Makefile \
48       --replace "all: api" ""
49   '';
51   nativeBuildInputs = [
52     pip
53     setuptools
54   ];
56   propagatedBuildInputs = [
57     srht
58     pyyaml
59   ];
61   preBuild = ''
62     export PKGVER=${version}
63     export SRHT_PATH=${srht}/${python.sitePackages}/srht
64   '';
66   postInstall = ''
67     mkdir -p $out/bin
68     ln -s ${pastesrht-api}/bin/api $out/bin/pastesrht-api
69   '';
71   pythonImportsCheck = [ "pastesrht" ];
73   meta = with lib; {
74     homepage = "https://git.sr.ht/~sircmpwn/paste.sr.ht";
75     description = "Ad-hoc text file hosting service for the sr.ht network";
76     license = licenses.agpl3Only;
77     maintainers = with maintainers; [
78       eadwu
79       nessdoor
80       christoph-heiss
81     ];
82   };