about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/moinmoin
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/moinmoin')
-rw-r--r--nixpkgs/pkgs/development/python-modules/moinmoin/default.nix35
-rw-r--r--nixpkgs/pkgs/development/python-modules/moinmoin/fix_tests.patch16
2 files changed, 51 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/moinmoin/default.nix b/nixpkgs/pkgs/development/python-modules/moinmoin/default.nix
new file mode 100644
index 000000000000..8090ac199da8
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/moinmoin/default.nix
@@ -0,0 +1,35 @@
+{ lib, buildPythonPackage, fetchurl, fetchpatch, isPy3k
+, pytest, werkzeug, pygments
+}:
+
+buildPythonPackage rec {
+  pname = "moinmoin";
+  version = "1.9.10";
+
+  # SyntaxError in setup.py
+  disabled = isPy3k;
+
+  src = fetchurl {
+    url = "http://static.moinmo.in/files/moin-${version}.tar.gz";
+    sha256 = "0g05lnl1s8v61phi3z1g3b6lfj4g98grj9kw8nyjl246x0c489ja";
+  };
+
+  patches = [
+    # Recommended to install on their download page.
+    ./fix_tests.patch
+  ];
+
+  prePatch = ''
+    sed -i "s/\xfc/ΓΌ/" setup.cfg
+  '';
+
+  checkInputs = [ pytest werkzeug pygments ];
+
+  meta = with lib; {
+    description = "Advanced, easy to use and extensible WikiEngine";
+
+    homepage = "https://moinmo.in/";
+
+    license = licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/python-modules/moinmoin/fix_tests.patch b/nixpkgs/pkgs/development/python-modules/moinmoin/fix_tests.patch
new file mode 100644
index 000000000000..e9856eeffca6
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/moinmoin/fix_tests.patch
@@ -0,0 +1,16 @@
+diff -ru3 moin-1.9.9-old/MoinMoin/conftest.py moin-1.9.9-new/MoinMoin/conftest.py
+--- moin-1.9.9-old/MoinMoin/conftest.py	2016-10-31 23:44:02.000000000 +0300
++++ moin-1.9.9-new/MoinMoin/conftest.py	2018-02-18 12:13:19.551929093 +0300
+@@ -22,10 +22,11 @@
+ 
+ import atexit
+ import sys
++import os
+ 
+ import py
+ 
+-rootdir = py.magic.autopath().dirpath()
++rootdir = os.path.abspath(os.path.dirname(__file__))
+ moindir = rootdir.join("..")
+ sys.path.insert(0, str(moindir))
+