1{
2 lib,
3 python3Packages,
4 fetchFromGitHub,
5 uglify-js,
6}:
7
8python3Packages.buildPythonApplication rec {
9 pname = "zerobin";
10 version = "1.0.5";
11 format = "setuptools";
12
13 src = fetchFromGitHub {
14 owner = "Tygs";
15 repo = "0bin";
16 rev = "v${version}";
17 sha256 = "1dfy3h823ylz4w2vv3mrmnmiyvf6rvyvsp4j3llr074w9id0zy16";
18 };
19
20 disabled = python3Packages.pythonOlder "3.7";
21
22 nativeBuildInputs = [
23 python3Packages.doit
24 python3Packages.pyscss
25 uglify-js
26 ];
27
28 propagatedBuildInputs = with python3Packages; [
29 appdirs
30 beaker
31 bleach
32 bottle
33 clize
34 lockfile
35 paste
36 ];
37
38 prePatch = ''
39 # replace /bin/bash in compress.sh
40 patchShebangs .
41
42 # relax version constraints of some dependencies
43 substituteInPlace setup.cfg \
44 --replace "clize==4.1.1" "clize" \
45 --replace "bleach==3.1.5" "bleach>=3.1.5,<6" \
46 --replace "bottle==0.12.18" "bottle>=0.12.18,<1" \
47 --replace "Paste==3.4.3" "Paste>=3.4.3,<4"
48 '';
49
50 buildPhase = ''
51 runHook preBuild
52 doit build
53 runHook postBuild
54 '';
55
56 # zerobin has no check, but checking would fail with:
57 # nix_run_setup runserver: Received extra arguments: test
58 # See https://github.com/NixOS/nixpkgs/pull/98734#discussion_r495823510
59 doCheck = false;
60
61 pythonImportsCheck = [ "zerobin" ];
62
63 meta = with lib; {
64 description = "Client side encrypted pastebin";
65 homepage = "https://0bin.net/";
66 license = licenses.wtfpl;
67 platforms = platforms.all;
68 maintainers = with maintainers; [ julm ];
69 };
70}