summary refs log tree commit diff
path: root/pkgs/development/python-modules/augeas/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/augeas/default.nix')
-rw-r--r--pkgs/development/python-modules/augeas/default.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/augeas/default.nix b/pkgs/development/python-modules/augeas/default.nix
new file mode 100644
index 00000000000..8934e1b81a8
--- /dev/null
+++ b/pkgs/development/python-modules/augeas/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, lib, buildPythonPackage, fetchFromGitHub, augeas, cffi }:
+buildPythonPackage rec {
+    name = "augeas-${version}";
+    version = "1.0.2";
+
+    src = fetchFromGitHub {
+      owner = "hercules-team";
+      repo = "python-augeas";
+      rev = "v${version}";
+      sha256 = "1xk51m58ym3qpf0z5y98kzxb5jw7s92rca0v1yflj422977najxh";
+    };
+
+    # TODO: not very nice!
+    postPatch =
+      let libname = if stdenv.isDarwin then "libaugeas.dylib" else "libaugeas.so";
+      in
+      ''
+        substituteInPlace augeas/ffi.py \
+          --replace 'ffi.dlopen("augeas")' \
+                    'ffi.dlopen("${lib.makeLibraryPath [augeas]}/${libname}")'
+      '';
+
+    propagatedBuildInputs = [ cffi augeas ];
+
+    doCheck = false;
+
+    meta = with lib; {
+      description = "Pure python bindings for augeas";
+      homepage = https://github.com/hercules-team/python-augeas;
+      license = licenses.lgpl2Plus;
+      platforms = platforms.unix;
+    };
+}