@@ -0,0 +1,52 @@
1+{
2+ lib,
3+ buildPythonApplication,
4+ fetchFromGitHub,
5+ fetchpatch,
6+
7+ cpyparsing,
8+ ipykernel,
9+ mypy,
10+ pygments,
11+ pytest,
12+ prompt_toolkit,
13+ tkinter,
14+ watchdog
15+}:
16+
17+buildPythonApplication rec {
18+ pname = "coconut";
19+ version = "1.4.3";
20+
21+ src = fetchFromGitHub {
22+ owner = "evhub";
23+ repo = "coconut";
24+ rev = "v${version}";
25+ sha256 = "1pz13vza3yy95dbylnq89fzc3mwgcqr7ds096wy25k6vxd9dp9c3";
26+ };
27+
28+ propagatedBuildInputs = [ cpyparsing pygments prompt_toolkit ipykernel mypy watchdog ];
29+
30+ patches = [
31+ (fetchpatch {
32+ name = "fix-setuptools-version-check.patch";
33+ url = "https://github.com/LibreCybernetics/coconut/commit/2916a087da1e063cc4438b68d4077347fd1ea4a2.patch";
34+ sha256 = "136jbd2rvnifw30y73vv667002nf7sbkm5qyihshj4db7ngysr6q";
35+ })
36+ ];
37+
38+ checkInputs = [ pytest tkinter ];
39+ # Currently most tests do not work on Hydra due to external fetches.
40+ checkPhase = ''
41+ pytest tests/constants_test.py
42+ pytest tests/main_test.py::TestShell::test_compile_to_file
43+ pytest tests/main_test.py::TestShell::test_convenience
44+ '';
45+
46+ meta = with lib; {
47+ homepage = "http://coconut-lang.org/";
48+ description = "Simple, elegant, Pythonic functional programming";
49+ license = licenses.asl20;
50+ maintainers = with maintainers; [ fabianhjr ];
51+ };
52+}