btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / be / bepasty / package.nix
blob8e67cbab6111159cf8f4268b2b2150098e35d46f
1 { lib
2 , python3
3 , fetchPypi
4 }:
6 let
7   # bepasty 1.2 needs xstatic-font-awesome < 5, see
8   # https://github.com/bepasty/bepasty-server/issues/305
9   bepastyPython = python3.override {
10     self = bepastyPython;
11     packageOverrides = self: super: {
12       xstatic-font-awesome = super.xstatic-font-awesome.overridePythonAttrs(oldAttrs: rec {
13         version = "4.7.0.0";
14         src = oldAttrs.src.override {
15           inherit version;
16           hash = "sha256-4B+0gMqqfHlj3LMyikcA5jG+9gcNsOi2hYFtIg5oX2w=";
17         };
18       });
19     };
20   };
23 # We need to use buildPythonPackage here to get the PYTHONPATH build correctly.
24 # This is needed for services.bepasty
25 # https://github.com/NixOS/nixpkgs/pull/38300
27 bepastyPython.pkgs.buildPythonPackage rec {
28   pname = "bepasty";
29   version = "1.2.1";
30   format = "pyproject";
32   propagatedBuildInputs = with bepastyPython.pkgs; [
33     flask
34     markupsafe
35     pygments
36     setuptools
37     xstatic
38     xstatic-asciinema-player
39     xstatic-bootbox
40     xstatic-bootstrap
41     xstatic-font-awesome
42     xstatic-jquery
43     xstatic-jquery-file-upload
44     xstatic-jquery-ui
45     xstatic-pygments
46   ];
48   buildInputs = with bepastyPython.pkgs; [ setuptools-scm ];
50   src = fetchPypi {
51     inherit pname version;
52     hash = "sha256-08cyr2AruGAfHAwHHS8WMfJh7DBKymaYyz4AxI/ubkE=";
53   };
55   nativeCheckInputs = with bepastyPython.pkgs; [
56     build
57     flake8
58     pytestCheckHook
59     pytest-cov
60     selenium
61     tox
62     twine
63   ];
65   disabledTestPaths = [
66     # Can be enabled when werkzeug is updated to >2.2, see #245145
67     # and https://github.com/bepasty/bepasty-server/pull/303
68     "src/bepasty/tests/test_rest_server.py"
70     # These require a web browser
71     "src/bepasty/tests/screenshots.py"
72     "src/bepasty/tests/test_website.py"
73   ];
75   meta = with lib; {
76     homepage = "https://github.com/bepasty/bepasty-server";
77     description = "Binary pastebin server";
78     license = licenses.bsd2;
79     maintainers = with maintainers; [ aither64 makefu ];
80   };