summary refs log tree commit diff
path: root/pkgs/development/python-modules/augeas/default.nix
blob: cf1d4544e4adcebeba1ebc93b13ade33b5c454a2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ stdenv, lib, buildPythonPackage, fetchFromGitHub, augeas, cffi }:
buildPythonPackage rec {
    pname = "augeas";
    version = "1.1.0";

    src = fetchFromGitHub {
      owner = "hercules-team";
      repo = "python-augeas";
      rev = "v${version}";
      sha256 = "12q52ilcx059rn544x3712xq6myn99niz131l0fs3xx67456pajh";
    };

    # 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;
    };
}