1{ stdenv, lib, buildPythonPackage, fetchFromGitHub, augeas, cffi }:
2buildPythonPackage rec {
3 pname = "augeas";
4 version = "1.0.3";
5
6 src = fetchFromGitHub {
7 owner = "hercules-team";
8 repo = "python-augeas";
9 rev = "v${version}";
10 sha256 = "1fb904ym8g8hkd82zlibzk6wrldnfd5v5d0rkynsy1zlhcylq4f6";
11 };
12
13 # TODO: not very nice!
14 postPatch =
15 let libname = if stdenv.isDarwin then "libaugeas.dylib" else "libaugeas.so";
16 in
17 ''
18 substituteInPlace augeas/ffi.py \
19 --replace 'ffi.dlopen("augeas")' \
20 'ffi.dlopen("${lib.makeLibraryPath [augeas]}/${libname}")'
21 '';
22
23 propagatedBuildInputs = [ cffi augeas ];
24
25 doCheck = false;
26
27 meta = with lib; {
28 description = "Pure python bindings for augeas";
29 homepage = https://github.com/hercules-team/python-augeas;
30 license = licenses.lgpl2Plus;
31 platforms = platforms.unix;
32 };
33}