Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 libdiscid, 5 buildPythonPackage, 6 fetchPypi, 7}: 8 9buildPythonPackage rec { 10 pname = "discid"; 11 version = "1.2.0"; 12 format = "setuptools"; 13 14 src = fetchPypi { 15 inherit pname version; 16 sha256 = "1fc6kvnqwaz9lrs2qgsp8wh0nabf49010r0r53wnsmpmafy315nd"; 17 }; 18 19 patchPhase = 20 let 21 extension = stdenv.hostPlatform.extensions.sharedLibrary; 22 in 23 '' 24 substituteInPlace discid/libdiscid.py \ 25 --replace "_open_library(_LIB_NAME)" \ 26 "_open_library('${libdiscid}/lib/libdiscid${extension}')" 27 ''; 28 29 meta = with lib; { 30 description = "Python binding of libdiscid"; 31 homepage = "https://python-discid.readthedocs.org/"; 32 license = licenses.lgpl3Plus; 33 }; 34}