summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyev/default.nix
blob: db06fedd68cc1487e734921d0f407fd66f5f21c8 (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
{ stdenv, fetchurl, buildPythonPackage, libev }:

buildPythonPackage rec {
  name = "pyev-0.9.0";

  src = fetchurl {
    url = "mirror://pypi/p/pyev/${name}.tar.gz";
    sha256 = "0rf603lc0s6zpa1nb25vhd8g4y337wg2wyz56i0agsdh7jchl0sx";
  };

  buildInputs = [ libev ];

  libEvSharedLibrary =
    if !stdenv.isDarwin
    then "${libev}/lib/libev.so.4"
    else "${libev}/lib/libev.4.dylib";

  postPatch = ''
    test -f "${libEvSharedLibrary}" || { echo "ERROR: File ${libEvSharedLibrary} does not exist, please fix nix expression for pyev"; exit 1; }
    sed -i -e "s|libev_dll_name = find_library(\"ev\")|libev_dll_name = \"${libEvSharedLibrary}\"|" setup.py
  '';

  meta = with stdenv.lib; {
    description = "Python bindings for libev";
    homepage = https://code.google.com/p/pyev/;
    license = licenses.gpl3;
    maintainers = [ maintainers.bjornfor ];
  };
}