Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 21.05 74 lines 2.0 kB view raw
1{ lib 2, stdenv 3, fetchPypi 4, buildPythonPackage 5, which 6, pkg-config 7, python 8, isPy27 9, doxygen 10, cairo 11, ncurses 12, pango 13, wxGTK 14}: 15let 16 dynamic-linker = stdenv.cc.bintools.dynamicLinker; 17in 18buildPythonPackage rec { 19 pname = "wxPython"; 20 version = "4.1.0"; 21 disabled = isPy27; 22 23 src = fetchPypi { 24 inherit pname version; 25 sha256 = "12x4ci5q7qni4rkfiq6lnpn1fk8b0sfc6dck5wyxkj2sfp5pa91f"; 26 }; 27 28 # https://github.com/NixOS/nixpkgs/issues/75759 29 # https://github.com/wxWidgets/Phoenix/issues/1316 30 doCheck = false; 31 32 nativeBuildInputs = [ which doxygen wxGTK pkg-config ]; 33 34 buildInputs = [ 35 wxGTK.gtk 36 ncurses 37 ]; 38 39 DOXYGEN = "${doxygen}/bin/doxygen"; 40 41 preConfigure = lib.optionalString (!stdenv.isDarwin) '' 42 substituteInPlace wx/lib/wxcairo/wx_pycairo.py \ 43 --replace 'cairoLib = None' 'cairoLib = ctypes.CDLL("${cairo}/lib/libcairo.so")' 44 substituteInPlace wx/lib/wxcairo/wx_pycairo.py \ 45 --replace '_dlls = dict()' '_dlls = {k: ctypes.CDLL(v) for k, v in [ 46 ("gdk", "${wxGTK.gtk}/lib/libgtk-x11-3.0.so"), 47 ("pangocairo", "${pango.out}/lib/libpangocairo-1.0.so"), 48 ("appsvc", None) 49 ]}' 50 51 # https://github.com/wxWidgets/Phoenix/pull/1584 52 # It'll be not needed in next version because https://github.com/wxWidgets/Phoenix/pull/1699 53 substituteInPlace build.py --replace "os.environ['PYTHONPATH'] = phoenixDir()" \ 54 "os.environ['PYTHONPATH'] = os.environ['PYTHONPATH'] + os.pathsep + phoenixDir()" 55 ''; 56 57 buildPhase = '' 58 ${python.interpreter} build.py -v --use_syswx dox etg --nodoc build_py 59 ''; 60 61 installPhase = '' 62 ${python.interpreter} setup.py install --skip-build --prefix=$out 63 wrapPythonPrograms 64 ''; 65 66 passthru = { inherit wxGTK; }; 67 68 meta = with lib; { 69 description = "Cross platform GUI toolkit for Python, Phoenix version"; 70 homepage = "http://wxpython.org/"; 71 license = licenses.wxWindows; 72 maintainers = with maintainers; [ tfmoraes ]; 73 }; 74}