Skip to content

Commit

Permalink
moinmoin: refactor and fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
abbradar committed Feb 18, 2018
1 parent 96ac692 commit 3957b6b
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 18 deletions.
32 changes: 32 additions & 0 deletions pkgs/development/python-modules/moinmoin/default.nix
@@ -0,0 +1,32 @@
{ lib, buildPythonPackage, fetchurl, fetchpatch
, pytest, werkzeug, pygments
}:

buildPythonPackage rec {
name = "moinmoin-${ver}";
ver = "1.9.9";

src = fetchurl {
url = "http://static.moinmo.in/files/moin-${ver}.tar.gz";
sha256 = "197ga41qghykmir80ik17f9hjpmixslv3zjgj7bj9qvs1dvdg5s3";
};

patches = [
# Recommended to install on their download page.
(fetchpatch {
url = "https://bitbucket.org/thomaswaldmann/moin-1.9/commits/561b7a9c2bd91b61d26cd8a5f39aa36bf5c6159e/raw";
sha256 = "1nscnl9nspnrwyf3n95ig0ihzndryinq9kkghliph6h55cncfc65";
})
./fix_tests.patch
];

checkInputs = [ pytest werkzeug pygments ];

meta = with lib; {
description = "Advanced, easy to use and extensible WikiEngine";

homepage = "http://moinmo.in/";

license = licenses.gpl2Plus;
};
}
16 changes: 16 additions & 0 deletions 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))

20 changes: 2 additions & 18 deletions pkgs/top-level/python-packages.nix
Expand Up @@ -10372,24 +10372,8 @@ in {
};
};

moinmoin = buildPythonPackage (rec {
name = "moinmoin-${ver}";
disabled = isPy3k;
ver = "1.9.8";

src = pkgs.fetchurl {
url = "http://static.moinmo.in/files/moin-${ver}.tar.gz";
sha256 = "19hi16iy75lpx9ch799djc4hr4gai5rmvi542n29x6zhikysfjx7";
};

meta = {
description = "Advanced, easy to use and extensible WikiEngine";

homepage = http://moinmo.in/;

license = licenses.gpl2Plus;
};
});
# Needed here because moinmoin is loaded as a Python library.
moinmoin = callPackage ../development/python-modules/moinmoin { };

moretools = callPackage ../development/python-modules/moretools { };

Expand Down

0 comments on commit 3957b6b

Please sign in to comment.