Skip to content

Instantly share code, notes, and snippets.

@whacked
Created December 16, 2018 22:37
Show Gist options
  • Select an option

  • Save whacked/d198953c56dd97cb981e285c30e62f2b to your computer and use it in GitHub Desktop.

Select an option

Save whacked/d198953c56dd97cb981e285c30e62f2b to your computer and use it in GitHub Desktop.
installing numpy on darwin with UCS4 with nix -- the missing link
# 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