1{ stdenv
2, buildPythonPackage
3, fetchPypi
4, setuptools
5, nose
6, pkgs
7, isPy27
8}:
9
10buildPythonPackage rec {
11 pname = "pycdio";
12 version = "2.0.0";
13 disabled = !isPy27;
14
15 src = fetchPypi {
16 inherit pname version;
17 sha256 = "1a1h0lmfl56a2a9xqhacnjclv81nv3906vdylalybxrk4bhrm3hj";
18 };
19
20 prePatch = "sed -i -e '/DRIVER_BSDI/d' pycdio.py";
21
22 preConfigure = ''
23 patchShebangs .
24 '';
25
26 nativeBuildInputs = [ pkgs.pkgconfig ];
27 buildInputs = [ setuptools nose pkgs.swig pkgs.libcdio ]
28 ++ stdenv.lib.optional stdenv.isDarwin pkgs.libiconv;
29
30 # Run tests using nosetests but first need to install the binaries
31 # to the root source directory where they can be found.
32 checkPhase = ''
33 ./setup.py install_lib -d .
34 nosetests
35 '';
36
37 meta = with stdenv.lib; {
38 homepage = https://www.gnu.org/software/libcdio/;
39 description = "Wrapper around libcdio (CD Input and Control library)";
40 maintainers = with maintainers; [ rycee ];
41 license = licenses.gpl3Plus;
42 };
43
44}