Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 136c249e0ba8
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7864782d71b3
Choose a head ref
  • 5 commits
  • 8 files changed
  • 1 contributor

Commits on Feb 27, 2017

  1. Copy the full SHA
    fa367c2 View commit details
  2. protobuf3_2: init at 3.2

    edwtjo committed Feb 27, 2017

    Verified

    This commit was signed with the committer’s verified signature.
    Copy the full SHA
    5e44b5e View commit details
  3. Copy the full SHA
    421db29 View commit details
  4. Copy the full SHA
    a331662 View commit details
  5. Copy the full SHA
    7864782 View commit details
7 changes: 4 additions & 3 deletions nixos/modules/services/networking/dhcpd.nix
Original file line number Diff line number Diff line change
@@ -60,8 +60,9 @@ let
};
};

machineOpts = {...}: {
config = {
machineOpts = { ... }: {

options = {

hostName = mkOption {
type = types.str;
@@ -156,7 +157,7 @@ let
};

machines = mkOption {
type = types.listOf (types.submodule machineOpts);
type = with types; listOf (submodule machineOpts);
default = [];
example = [
{ hostName = "foo";
6 changes: 6 additions & 0 deletions pkgs/development/libraries/protobuf/3.2.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{ callPackage, lib, ... }:

lib.overrideDerivation (callPackage ./generic-v3.nix {
version = "3.2.0";
sha256 = "120g0bg7ichry74allgmqnh7k0z2sdnrrfklb58b7szzn4zcdz14";
}) (attrs: { NIX_CFLAGS_COMPILE = "-Wno-error"; })
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/protobuf.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, python, buildPythonPackage
, protobuf, google_apputils
, protobuf, google_apputils, pyext
, disabled, doCheck ? true }:

with stdenv.lib;
@@ -9,7 +9,7 @@ buildPythonPackage rec {
inherit disabled doCheck;

propagatedBuildInputs = [ protobuf google_apputils ];
buildInputs = [ google_apputils ];
buildInputs = [ google_apputils pyext ];

prePatch = ''
while [ ! -d python ]; do
19 changes: 19 additions & 0 deletions pkgs/development/python-modules/pyext/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{ stdenv, buildPythonPackage, fetchPypi }:

buildPythonPackage rec {
name = pname + "-" + version;
pname = "pyext";
version = "0.7";

src = fetchPypi {
inherit pname version;
sha256 = "1pvwjkrjqajzh4wiiw1mzqp0bb81cqc2gk23nj24m32fpqssc676";
};

meta = with stdenv.lib; {
description = "Simple Python extensions.";
homepage = "https://github.com/kirbyfan64/PyExt";
license = licenses.mit;
maintainers = with maintainers; [ edwtjo ];
};
}
52 changes: 0 additions & 52 deletions pkgs/development/python-modules/tensorflow/cuda.nix

This file was deleted.

110 changes: 94 additions & 16 deletions pkgs/development/python-modules/tensorflow/default.nix
Original file line number Diff line number Diff line change
@@ -1,48 +1,126 @@
{ stdenv
, fetchurl
, buildPythonPackage
, isPy35, isPy27
, cudaSupport ? false
, cudatoolkit75 ? null
, cudnn5_cudatoolkit75 ? null
, gcc49 ? null
, linuxPackages ? null
, numpy
, six
, protobuf3_0_0b2
, protobuf3_2
, swig
, mock
, gcc
, zlib
}:

assert cudaSupport -> cudatoolkit75 != null
&& cudnn5_cudatoolkit75 != null
&& gcc49 != null
&& linuxPackages != null;

# unsupported combination
assert ! (stdenv.isDarwin && cudaSupport);

# tensorflow is built from a downloaded wheel, because the upstream
# project's build system is an arcane beast based on
# bazel. Untangling it and building the wheel from source is an open
# problem.

buildPythonPackage rec {
pname = "tensorflow";
version = "0.10.0";
version = "1.0.0";
name = "${pname}-${version}";
format = "wheel";
disabled = ! (isPy35 || isPy27);

src = fetchurl {
url = if stdenv.isDarwin then
"https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-${version}-py2-none-any.whl" else
"https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-${version}-cp27-none-linux_x86_64.whl";
sha256 = if stdenv.isDarwin then
"1gjybh3j3rn34bzhsxsfdbqgsr4jh50qyx2wqywvcb24fkvy40j9" else
"0g05pa4z6kdy0giz7hjgjgwf4zzr5l8cf1zh247ymixlikn3fnpx";
};
src = let
tfurl = sys: proc: pykind:
let
tfpref = if proc == "gpu"
then "gpu/tensorflow_gpu"
else "cpu/tensorflow";
in
"https://storage.googleapis.com/tensorflow/${sys}/${tfpref}-${version}-${pykind}.whl";
dls =
{
darwin.cpu = {
py2 = {
url = tfurl "mac" "cpu" "py2-none-any" ;
sha256 = "15ayil28p20wkgpwkr4mz0imjxnf049xx4117jspg1qkjg2bn1b2";
};
py3 = {
url = tfurl "mac" "cpu" "py3-none-any" ;
sha256 = "1ynyhbm7yrp421364s49a1r3p83zxy74iiy5c4hx2xm5c4gs29an";
};
};
linux-x86_64.cpu = {
py2 = {
url = tfurl "linux" "cpu" "cp27-none-linux_x86_64";
sha256 = "1hwhq1qhjrfkqfkxpsrq6mdmdibnqr3n7xvzkxp6gaqj73vn5ch2";
};
py3 = {
url = tfurl "linux" "cpu" "cp35-cp35m-linux_x86_64";
sha256 = "0jx2mmlw0nxah9l25r46i7diqiv31qcz7855n250lsxfwcppy7y3";
};
};
linux-x86_64.cuda = {
py2 = {
url = tfurl "linux" "gpu" "cp27-none-linux_x86_64";
sha256 = "0l8f71x3ama5a6idj05jrswlmp4yg37fxhz8lx2xmgk14aszbcy5";
};
py3 = {
url = tfurl "linux" "gpu" "cp35-cp35m-linux_x86_64";
sha256 = "12q7s0yk0h3r4glh0fhl1fcdx7jl8xikwwp04a1lcagasr51s36m";
};
};
};
in
fetchurl (
if stdenv.isDarwin then
if isPy35 then
dls.darwin.cpu.py3
else
dls.darwin.cpu.py2
else if isPy35 then
if cudaSupport then
dls.linux-x86_64.cuda.py3
else dls.linux-x86_64.cpu.py3
else
if cudaSupport then
dls.linux-x86_64.cuda.py2
else
dls.linux-x86_64.cpu.py2
);

propagatedBuildInputs = [ numpy six protobuf3_0_0b2 swig mock];
propagatedBuildInputs = with stdenv.lib;
[ numpy six protobuf3_2 swig mock ]
++ optionals cudaSupport [ cudatoolkit75 cudnn5_cudatoolkit75 gcc49 ];

preFixup = ''
RPATH="${stdenv.lib.makeLibraryPath [ gcc.cc.lib zlib ]}"
find $out -name '*.so' -exec patchelf --set-rpath "$RPATH" {} \;
# Note that we need to run *after* the fixup phase because the
# libraries are loaded at runtime. If we run in preFixup then
# patchelf --shrink-rpath will remove the cuda libraries.
postFixup = let
rpath = stdenv.lib.makeLibraryPath
(if cudaSupport then
[ gcc49.cc.lib zlib cudatoolkit75 cudnn5_cudatoolkit75
linuxPackages.nvidia_x11 ]
else
[ gcc.cc.lib zlib ]
);
in
''
find $out -name '*.so' -exec patchelf --set-rpath "${rpath}" {} \;
'';

doCheck = false;

meta = with stdenv.lib; {
description = "TensorFlow helps the tensors flow (no gpu support)";
description = "TensorFlow helps the tensors flow";
homepage = http://tensorflow.org;
license = licenses.asl20;
platforms = with platforms; linux ++ darwin;
platforms = with platforms; if cudaSupport then linux else linux ++ darwin;
};
}
1 change: 1 addition & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -9229,6 +9229,7 @@ with pkgs;
# 3.0.0-beta-2 is only introduced for tensorflow. remove this version when tensorflow is moved to 3.0.
protobuf3_0_0b2 = lowPrio (callPackage ../development/libraries/protobuf/3.0.0-beta-2.nix { });
protobuf3_1 = callPackage ../development/libraries/protobuf/3.1.nix { };
protobuf3_2 = callPackage ../development/libraries/protobuf/3.2.nix { };
protobuf2_6 = callPackage ../development/libraries/protobuf/2.6.nix { };
protobuf2_5 = callPackage ../development/libraries/protobuf/2.5.nix { };

15 changes: 9 additions & 6 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
@@ -19316,12 +19316,11 @@ in {

protobuf = self.protobuf2_6;
# only required by tensorflow
protobuf3_0_0b2 = callPackage ../development/python-modules/protobuf.nix {
disabled = isPyPy || isPy3k;
doCheck = isPy3k;
protobuf = pkgs.protobuf3_0_0b2;
protobuf3_2 = callPackage ../development/python-modules/protobuf.nix {
disabled = isPyPy;
doCheck = !isPy3k;
protobuf = pkgs.protobuf3_2;
};

protobuf3_0 = callPackage ../development/python-modules/protobuf.nix {
disabled = isPyPy;
doCheck = isPy3k;
@@ -20185,6 +20184,8 @@ in {
};
};

pyext = callPackage ../development/python-modules/pyext { };

pyfantom = buildPythonPackage rec {
name = "pyfantom-${version}";
version = "unstable-2013-12-18";
@@ -31253,7 +31254,9 @@ EOF

tensorflowWithoutCuda = callPackage ../development/python-modules/tensorflow { };

tensorflowWithCuda = callPackage ../development/python-modules/tensorflow/cuda.nix { };
tensorflowWithCuda = callPackage ../development/python-modules/tensorflow {
cudaSupport = true;
};

tflearn = buildPythonPackage rec {
name = "tflearn-0.2.1";