wxPython: fix on darwin
This commit is contained in:
parent
c34a52bf5d
commit
c2a5733654
@ -1,8 +1,11 @@
|
|||||||
{ fetchurl
|
{ fetchurl
|
||||||
, lib
|
, lib
|
||||||
|
, stdenv
|
||||||
|
, darwin
|
||||||
, openglSupport ? true
|
, openglSupport ? true
|
||||||
, libX11
|
, libX11
|
||||||
, wxGTK
|
, wxGTK
|
||||||
|
, wxmac
|
||||||
, pkgconfig
|
, pkgconfig
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, pyopengl
|
, pyopengl
|
||||||
@ -27,15 +30,27 @@ buildPythonPackage rec {
|
|||||||
|
|
||||||
hardeningDisable = [ "format" ];
|
hardeningDisable = [ "format" ];
|
||||||
|
|
||||||
propagatedBuildInputs = [ pkgconfig wxGTK (wxGTK.gtk) libX11 ] ++ lib.optional openglSupport pyopengl;
|
propagatedBuildInputs = [ pkgconfig ]
|
||||||
preConfigure = "cd wxPython";
|
++ (lib.optional openglSupport pyopengl)
|
||||||
|
++ (lib.optionals (!stdenv.isDarwin) [ wxGTK (wxGTK.gtk) libX11 ])
|
||||||
|
++ (lib.optionals stdenv.isDarwin [ wxmac darwin.apple_sdk.frameworks.Cocoa ])
|
||||||
|
;
|
||||||
|
preConfigure = ''
|
||||||
|
cd wxPython
|
||||||
|
# remove wxPython's darwin hack that interference with python-2.7-distutils-C++.patch
|
||||||
|
substituteInPlace config.py \
|
||||||
|
--replace "distutils.unixccompiler.UnixCCompiler = MyUnixCCompiler" ""
|
||||||
|
# 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;"
|
||||||
|
'';
|
||||||
|
|
||||||
NIX_LDFLAGS = "-lX11 -lgdk-x11-2.0";
|
NIX_LDFLAGS = lib.optionalString (!stdenv.isDarwin) "-lX11 -lgdk-x11-2.0";
|
||||||
|
|
||||||
buildPhase = "";
|
buildPhase = "";
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
${python.interpreter} setup.py install WXPORT=gtk2 NO_HEADERS=1 BUILD_GLCANVAS=${if openglSupport then "1" else "0"} UNICODE=1 --prefix=$out
|
${python.interpreter} setup.py install WXPORT=${if stdenv.isDarwin then "osx_cocoa" else "gtk2"} NO_HEADERS=1 BUILD_GLCANVAS=${if openglSupport then "1" else "0"} UNICODE=1 --prefix=$out
|
||||||
wrapPythonPrograms
|
wrapPythonPrograms
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user