1{ stdenv, lib, buildPythonPackage, fetchFromGitHub, augeas, cffi }: 2buildPythonPackage rec { 3 name = "augeas-${version}"; 4 version = "1.0.2"; 5 6 src = fetchFromGitHub { 7 owner = "hercules-team"; 8 repo = "python-augeas"; 9 rev = "v${version}"; 10 sha256 = "1xk51m58ym3qpf0z5y98kzxb5jw7s92rca0v1yflj422977najxh"; 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}