Created
December 16, 2018 22:37
-
-
Save whacked/d198953c56dd97cb981e285c30e62f2b to your computer and use it in GitHub Desktop.
installing numpy on darwin with UCS4 with nix -- the missing link
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # see https://github.com/NixOS/nixpkgs/blob/master/pkgs/os-specific/darwin/apple-sdk/frameworks.nix | |
| let | |
| pkgs = import <nixpkgs> {}; | |
| # MONEY LINE 1/2 | |
| frameworks = pkgs.darwin.apple_sdk.frameworks; | |
| stdenv = pkgs.stdenv; | |
| in stdenv.mkDerivation rec { | |
| name = "env"; | |
| env = pkgs.buildEnv { name = name; paths = buildInputs; }; | |
| buildInputs = [ | |
| # NOTE: do NOT include pkgs.python27Packages.pip; | |
| # it will interfere with the virtualenv pip | |
| pkgs.python27Packages.virtualenv | |
| # MONEY LINE 2/2 | |
| # this provides Accelerate, needed for numpy build | |
| frameworks.CoreGraphics | |
| ]; | |
| shellHook = '' | |
| if [ ! -e $PWD/venv ]; then | |
| virtualenv venv | |
| fi | |
| source venv/bin/activate | |
| ''; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment