Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at release-18.03 26 lines 739 B view raw
1{ stdenv, libdiscid, buildPythonPackage, fetchPypi }: 2 3buildPythonPackage rec { 4 pname = "discid"; 5 version = "1.1.1"; 6 name = "${pname}-${version}"; 7 8 src = fetchPypi { 9 inherit pname version; 10 sha256 = "78a3bf6c8377fdbe3d85e914a209ff97aa43e35605779639847b510ced31f7b9"; 11 }; 12 13 patchPhase = 14 let extension = stdenv.hostPlatform.extensions.sharedLibrary; in 15 '' 16 substituteInPlace discid/libdiscid.py \ 17 --replace "_open_library(_LIB_NAME)" \ 18 "_open_library('${libdiscid}/lib/libdiscid${extension}')" 19 ''; 20 21 meta = with stdenv.lib; { 22 description = "Python binding of libdiscid"; 23 homepage = "https://python-discid.readthedocs.org/"; 24 license = licenses.lgpl3Plus; 25 }; 26}