1{
2 pkgs,
3 nodejs,
4 lib,
5 python3Packages,
6 fetchFromGitHub,
7 nixosTests,
8 fetchNpmDeps,
9 npmHooks,
10}:
11
12with python3Packages;
13
14buildPythonApplication rec {
15 pname = "isso";
16 version = "0.13.0";
17 format = "setuptools";
18
19 src = fetchFromGitHub {
20 owner = "posativ";
21 repo = pname;
22 tag = version;
23 sha256 = "sha256-kZNf7Rlb1DZtQe4dK1B283OkzQQcCX+pbvZzfL65gsA=";
24 };
25
26 npmDeps = fetchNpmDeps {
27 inherit src;
28 hash = "sha256-RBpuhFI0hdi8bB48Pks9Ac/UdcQ/DJw+WFnNj5f7IYE=";
29 };
30
31 outputs = [
32 "out"
33 "doc"
34 ];
35
36 postPatch = ''
37 # Remove when https://github.com/posativ/isso/pull/973 is available.
38 substituteInPlace isso/tests/test_comments.py \
39 --replace "self.client.delete_cookie('localhost.local', '1')" "self.client.delete_cookie(key='1', domain='localhost')"
40 '';
41
42 propagatedBuildInputs = [
43 itsdangerous
44 jinja2
45 misaka
46 html5lib
47 werkzeug
48 bleach
49 flask-caching
50 ];
51
52 nativeBuildInputs = [
53 cffi
54 sphinxHook
55 sphinx
56 nodejs
57 npmHooks.npmConfigHook
58 ];
59
60 NODE_PATH = "$npmDeps";
61
62 preBuild = ''
63 ln -s ${npmDeps}/node_modules ./node_modules
64 export PATH="${npmDeps}/bin:$PATH"
65
66 make js
67 '';
68
69 nativeCheckInputs = [
70 pytestCheckHook
71 pytest-cov-stub
72 ];
73
74 passthru.tests = { inherit (nixosTests) isso; };
75
76 meta = with lib; {
77 description = "Commenting server similar to Disqus";
78 mainProgram = "isso";
79 homepage = "https://posativ.org/isso/";
80 license = licenses.mit;
81 maintainers = with maintainers; [ fgaz ];
82 };
83}