1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-20 12:42:24 +00:00

pythonPackages.wxPython: inject Cairo, Pango and GDK library paths

This commit is contained in:
obadz 2017-04-21 23:35:34 +01:00
parent cfcceaee27
commit a5cb00e884

View file

@ -12,6 +12,8 @@
, isPy3k
, isPyPy
, python
, cairo
, pango
}:
assert wxGTK.unicode;
@ -43,6 +45,15 @@ buildPythonPackage rec {
# this check is supposed to only return false on older systems running non-framework python
substituteInPlace src/osx_cocoa/_core_wrap.cpp \
--replace "return wxPyTestDisplayAvailable();" "return true;"
'' + lib.optionalString (!stdenv.isDarwin) ''
substituteInPlace wx/lib/wxcairo.py \
--replace 'cairoLib = None' 'cairoLib = ctypes.CDLL("${cairo}/lib/libcairo.so")'
substituteInPlace wx/lib/wxcairo.py \
--replace '_dlls = dict()' '_dlls = {k: ctypes.CDLL(v) for k, v in [
("gdk", "${wxGTK.gtk}/lib/libgtk-x11-2.0.so"),
("pangocairo", "${pango.out}/lib/libpangocairo-1.0.so"),
("appsvc", None)
]}'
'';
NIX_LDFLAGS = lib.optionalString (!stdenv.isDarwin) "-lX11 -lgdk-x11-2.0";