at master 1.0 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 stdenv, 6 setuptools, 7 boost, 8 freetype, 9 ftgl, 10 libGLU, 11 libGL, 12 python, 13}: 14 15let 16 pythonVersion = with lib.versions; "${major python.version}${minor python.version}"; 17in 18buildPythonPackage rec { 19 pname = "pyftgl"; 20 version = "0.4b"; 21 pyproject = true; 22 23 src = fetchFromGitHub { 24 owner = "umlaeute"; 25 repo = "pyftgl"; 26 tag = version; 27 sha256 = "sha256-mbzXpIPMNe6wfwaAAw/Ri8xaW6Z6kuNUhFFyzsiW7Is="; 28 }; 29 30 build-system = [ setuptools ]; 31 32 postPatch = '' 33 substituteInPlace setup.py \ 34 --replace-fail boost_python boost_python${pythonVersion} 35 '' 36 + lib.optionalString stdenv.hostPlatform.isDarwin '' 37 export NIX_CFLAGS_COMPILE+=" -L$SDKROOT/System/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries" 38 ''; 39 40 buildInputs = [ 41 boost 42 freetype 43 ftgl 44 libGLU 45 libGL 46 ]; 47 48 meta = { 49 description = "Python bindings for FTGL (FreeType for OpenGL)"; 50 license = lib.licenses.gpl2Plus; 51 }; 52}