1{ stdenv, lib, buildPythonPackage, fetchFromGitHub, augeas, cffi }:
2buildPythonPackage rec {
3 pname = "augeas";
4 version = "1.1.0";
5
6 src = fetchFromGitHub {
7 owner = "hercules-team";
8 repo = "python-augeas";
9 rev = "v${version}";
10 sha256 = "12q52ilcx059rn544x3712xq6myn99niz131l0fs3xx67456pajh";
11 };
12
13 # TODO: not very nice!
14 postPatch =
15 let libname = "libaugeas${stdenv.hostPlatform.extensions.sharedLibrary}";
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}