summary refs log tree commit diff
path: root/pkgs/development/python-modules/pycdio/default.nix
blob: f7a64b9bde4853a435590cc0fa090fa2be6bdf7a (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
34
35
36
37
38
39
40
41
42
43
44
{ stdenv
, buildPythonPackage
, fetchPypi
, setuptools
, nose
, pkgs
, isPy27
}:

buildPythonPackage rec {
  pname = "pycdio";
  version = "2.1.0";
  disabled = !isPy27;

  src = fetchPypi {
    inherit pname version;
    sha256 = "01b7vqqfry071p60sabydym7r3m3rxszyqpdbs1qi5rk2sfyblnn";
  };

  prePatch = "sed -i -e '/DRIVER_BSDI/d' pycdio.py";

  preConfigure = ''
    patchShebangs .
  '';

  nativeBuildInputs = [ nose pkgs.pkgconfig pkgs.swig ];
  buildInputs = [ setuptools pkgs.libcdio ]
    ++ stdenv.lib.optional stdenv.isDarwin pkgs.libiconv;

  # Run tests using nosetests but first need to install the binaries
  # to the root source directory where they can be found.
  checkPhase = ''
    ./setup.py install_lib -d .
    nosetests
  '';

  meta = with stdenv.lib; {
    homepage = https://www.gnu.org/software/libcdio/;
    description = "Wrapper around libcdio (CD Input and Control library)";
    maintainers = with maintainers; [ rycee ];
    license = licenses.gpl3Plus;
  };

}