darwin: matplotlib: add needed inputs and set framework flag for darwin

This commit is contained in:
Asko Soukka 2015-06-28 21:25:19 +03:00
parent 99744943a4
commit f933b48a53
3 changed files with 22 additions and 2 deletions

View file

@ -0,0 +1,11 @@
--- a/src/_macosx.m 2015-06-30 12:18:48.000000000 +0300
+++ b/src/_macosx.m 2015-06-30 12:19:12.000000000 +0300
@@ -5,6 +5,8 @@
#include "numpy/arrayobject.h"
#include "path_cleanup.h"
+#define WITH_NEXT_FRAMEWORK 1
+
#if PY_MAJOR_VERSION >= 3
#define PY3K 1
#else

View file

@ -4,6 +4,7 @@
, enableGhostscript ? false, ghostscript ? null, gtk3
, enableGtk2 ? false, pygtk ? null, gobjectIntrospection
, enableGtk3 ? false, cairo
, Cocoa, Foundation, CoreData, cf-private, libobjc, libcxx
}:
assert enableGhostscript -> ghostscript != null;
@ -17,11 +18,15 @@ buildPythonPackage rec {
url = "https://pypi.python.org/packages/source/m/matplotlib/${name}.tar.gz";
sha256 = "67b08b1650a00a6317d94b76a30a47320087e5244920604c5462188cba0c2646";
};
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1";
XDG_RUNTIME_DIR = "/tmp";
buildInputs = [ python which sphinx stdenv ]
++ stdenv.lib.optional enableGhostscript ghostscript;
++ stdenv.lib.optional enableGhostscript ghostscript
++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa Foundation CoreData
cf-private libobjc ];
propagatedBuildInputs =
[ cycler dateutil nose numpy pyparsing tornado freetype
@ -30,6 +35,8 @@ buildPythonPackage rec {
++ stdenv.lib.optional enableGtk2 pygtk
++ stdenv.lib.optionals enableGtk3 [ cairo pycairo gtk3 gobjectIntrospection pygobject3 ];
patches = stdenv.lib.optionals stdenv.isDarwin [ ./darwin-stdenv.patch ];
patchPhase = ''
# Failing test: ERROR: matplotlib.tests.test_style.test_use_url
sed -i 's/test_use_url/fails/' lib/matplotlib/tests/test_style.py

View file

@ -8621,6 +8621,8 @@ let
matplotlib = callPackage ../development/python-modules/matplotlib/default.nix {
stdenv = if stdenv.isDarwin then pkgs.clangStdenv else pkgs.stdenv;
enableGhostscript = true;
inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa Foundation CoreData;
inherit (pkgs.darwin) cf-private libobjc;
};