at master 1.2 kB view raw
1{ 2 lib, 3 stdenv, 4 boost, 5 buildPythonPackage, 6 exiv2, 7 fetchPypi, 8 pythonOlder, 9}: 10 11buildPythonPackage rec { 12 pname = "py3exiv2"; 13 version = "0.12.0"; 14 format = "setuptools"; 15 16 disabled = pythonOlder "3.7"; 17 18 src = fetchPypi { 19 inherit pname version; 20 hash = "sha256-crI+X3YMRzPPmpGNsI2U+9bZgwcR0qTowJuPNFY/Ooo="; 21 }; 22 23 # py3exiv2 only checks in `/usr/local/lib` for Boost, which is obviously wrong in nixpkgs. 24 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' 25 substituteInPlace setup.py \ 26 --replace-fail /usr/local/lib/ ${lib.escapeShellArg (lib.getLib boost)}/lib/ 27 ''; 28 29 buildInputs = [ 30 boost 31 exiv2 32 ]; 33 34 # Work around Python distutils compiling C++ with $CC (see issue #26709) 35 env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-I${lib.getInclude stdenv.cc.libcxx}/include/c++/v1"; 36 37 pythonImportsCheck = [ "pyexiv2" ]; 38 39 # Tests are not shipped 40 doCheck = false; 41 42 meta = with lib; { 43 description = "Python binding to the library exiv2"; 44 homepage = "https://launchpad.net/py3exiv2"; 45 license = licenses.gpl3Plus; 46 maintainers = with maintainers; [ vinymeuh ]; 47 platforms = with platforms; linux ++ darwin; 48 }; 49}