2018-08-13 20:06:09 +02:00
|
|
|
|
{ pkgs, haskellLib }:
|
|
|
|
|
|
|
|
|
|
with haskellLib;
|
|
|
|
|
|
|
|
|
|
self: super:
|
|
|
|
|
let
|
2020-04-15 13:00:12 +02:00
|
|
|
|
# This contains updates to the dependencies, without which it would
|
|
|
|
|
# be even more work to get it to build.
|
|
|
|
|
# As of 2020-04, there's no new release in sight, which is why we're
|
|
|
|
|
# pulling from Github.
|
2018-08-13 20:06:09 +02:00
|
|
|
|
tensorflow-haskell = pkgs.fetchFromGitHub {
|
|
|
|
|
owner = "tensorflow";
|
|
|
|
|
repo = "haskell";
|
2020-04-15 13:00:12 +02:00
|
|
|
|
rev = "0f322b2e0611cbe7011c84ba8b6cb822e4725ebc";
|
|
|
|
|
sha256 = "15gn66i547q20sd50ixwm6yk1g00syfgxp8xa6xjd0i3kcsl3gs1";
|
2018-08-13 20:06:09 +02:00
|
|
|
|
fetchSubmodules = true;
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-15 13:00:12 +02:00
|
|
|
|
setTensorflowSourceRoot = dir: drv:
|
|
|
|
|
(overrideCabal drv (drv: { src = tensorflow-haskell; }))
|
|
|
|
|
.overrideAttrs (_oldAttrs: {sourceRoot = "source/${dir}";});
|
2018-08-13 20:06:09 +02:00
|
|
|
|
|
2020-04-15 13:00:12 +02:00
|
|
|
|
proto-lens = self.proto-lens_0_5_1_0;
|
|
|
|
|
proto-lens-protoc = self.proto-lens-protoc_0_5_0_0;
|
|
|
|
|
proto-lens-runtime = self.proto-lens-runtime_0_5_0_0;
|
|
|
|
|
proto-lens-protobuf-types = self.proto-lens-protobuf-types_0_5_0_0;
|
|
|
|
|
proto-lens-setup = self.proto-lens-setup_0_4_0_2;
|
|
|
|
|
lens-family = self.lens-family_1_2_3;
|
2018-08-13 20:06:09 +02:00
|
|
|
|
in
|
|
|
|
|
{
|
2020-04-15 13:00:12 +02:00
|
|
|
|
lens-family_1_2_3 = super.lens-family_1_2_3.override {
|
|
|
|
|
lens-family-core = self.lens-family-core_1_2_3;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
proto-lens_0_5_1_0 = (appendPatch (doJailbreak super.proto-lens_0_5_1_0) ./patches/proto-lens-0.5.1.0.patch).override {
|
|
|
|
|
inherit lens-family;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
proto-lens-runtime_0_5_0_0 = doJailbreak (super.proto-lens-runtime_0_5_0_0.override {
|
|
|
|
|
inherit lens-family proto-lens;
|
2018-08-13 20:06:09 +02:00
|
|
|
|
});
|
2020-04-15 13:00:12 +02:00
|
|
|
|
|
|
|
|
|
proto-lens-protoc_0_5_0_0 = doJailbreak (super.proto-lens-protoc_0_5_0_0.override {
|
|
|
|
|
inherit lens-family proto-lens;
|
|
|
|
|
haskell-src-exts = self.haskell-src-exts_1_19_1;
|
2018-08-13 20:06:09 +02:00
|
|
|
|
});
|
2020-04-15 13:00:12 +02:00
|
|
|
|
proto-lens-setup_0_4_0_2 = appendPatch (doJailbreak (super.proto-lens-setup_0_4_0_2.override {
|
|
|
|
|
inherit proto-lens-protoc;
|
|
|
|
|
})) ./patches/proto-lens-setup-0.4.0.2.patch;
|
2018-08-13 20:06:09 +02:00
|
|
|
|
|
2020-04-15 13:00:12 +02:00
|
|
|
|
proto-lens-protobuf-types_0_5_0_0 = doJailbreak (super.proto-lens-protobuf-types_0_5_0_0.override {
|
|
|
|
|
inherit lens-family proto-lens proto-lens-runtime proto-lens-setup;
|
|
|
|
|
});
|
2018-08-13 20:06:09 +02:00
|
|
|
|
|
2020-04-15 13:00:12 +02:00
|
|
|
|
haskell-src-exts_1_19_1 = appendPatches (doJailbreak super.haskell-src-exts_1_19_1) [
|
2018-08-13 20:06:09 +02:00
|
|
|
|
# Adapt to the Semigroup–Monoid Proposal (enables building on GHC >= 8.4)
|
2020-04-15 13:00:12 +02:00
|
|
|
|
(pkgs.fetchpatch {
|
2020-04-18 13:43:47 +02:00
|
|
|
|
url = "https://github.com/haskell-suite/haskell-src-exts/commit/258e072fe9e37f94360b7488b58ea2832843bbb8.patch";
|
2020-04-15 13:00:12 +02:00
|
|
|
|
sha256 = "0ja6ai41v9plinlhjwja282m6ahn6mw4xi79np0jxqk83cg0z1ff";
|
|
|
|
|
})
|
|
|
|
|
# Adapt to MonadFail proposal (enables building on GHC >= 8.8)
|
|
|
|
|
(pkgs.fetchpatch {
|
2020-04-18 13:43:47 +02:00
|
|
|
|
url = "https://gist.githubusercontent.com/mikesperber/0f2addaf3fbe97ffb4a5234d8711ba41/raw/e09e20998283c7195e82d546ba9266d290eb000d/gistfile1.txt";
|
2020-04-15 13:00:12 +02:00
|
|
|
|
sha256 = "18clvli7vpqsqlf2f3qidn71738j9zdlpana6wha3x0dxwan5ly0";
|
|
|
|
|
}) ];
|
2018-08-13 20:06:09 +02:00
|
|
|
|
|
2020-04-15 13:00:12 +02:00
|
|
|
|
tensorflow-proto = (setTensorflowSourceRoot "tensorflow-proto" super.tensorflow-proto).override {
|
|
|
|
|
inherit proto-lens proto-lens-runtime proto-lens-setup proto-lens-protobuf-types;
|
2018-08-13 20:06:09 +02:00
|
|
|
|
};
|
2020-04-15 13:00:12 +02:00
|
|
|
|
|
|
|
|
|
tensorflow = (setTensorflowSourceRoot "tensorflow" super.tensorflow).override {
|
|
|
|
|
inherit lens-family proto-lens;
|
|
|
|
|
# the "regular" Python package does not seem to include the binary library
|
|
|
|
|
libtensorflow = pkgs.libtensorflow-bin;
|
2018-08-13 20:06:09 +02:00
|
|
|
|
};
|
2020-04-15 13:00:12 +02:00
|
|
|
|
|
|
|
|
|
tensorflow-core-ops = (setTensorflowSourceRoot "tensorflow-core-ops" super.tensorflow-core-ops).override {
|
|
|
|
|
inherit lens-family proto-lens;
|
2018-08-13 20:06:09 +02:00
|
|
|
|
};
|
2020-04-15 13:00:12 +02:00
|
|
|
|
|
|
|
|
|
tensorflow-logging = (setTensorflowSourceRoot "tensorflow-logging" super.tensorflow-logging).override {
|
|
|
|
|
inherit lens-family proto-lens;
|
2018-08-13 20:06:09 +02:00
|
|
|
|
};
|
2020-04-15 13:00:12 +02:00
|
|
|
|
|
|
|
|
|
tensorflow-mnist = (setTensorflowSourceRoot "tensorflow-mnist" super.tensorflow-mnist).override {
|
|
|
|
|
inherit lens-family proto-lens;
|
2018-09-06 08:49:17 +02:00
|
|
|
|
# https://github.com/tensorflow/haskell/issues/215
|
|
|
|
|
tensorflow-mnist-input-data = self.tensorflow-mnist-input-data;
|
2020-04-15 13:00:12 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
tensorflow-mnist-input-data = setTensorflowSourceRoot "tensorflow-mnist-input-data" (super.callPackage (
|
2018-08-13 20:06:09 +02:00
|
|
|
|
{ mkDerivation, base, bytestring, Cabal, cryptonite, directory
|
|
|
|
|
, filepath, HTTP, network-uri, stdenv
|
|
|
|
|
}:
|
2018-09-05 17:11:02 +02:00
|
|
|
|
|
|
|
|
|
let
|
2018-09-06 08:43:04 +02:00
|
|
|
|
fileInfos = {
|
|
|
|
|
"train-images-idx3-ubyte.gz" = "440fcabf73cc546fa21475e81ea370265605f56be210a4024d2ca8f203523609";
|
|
|
|
|
"train-labels-idx1-ubyte.gz" = "3552534a0a558bbed6aed32b30c495cca23d567ec52cac8be1a0730e8010255c";
|
|
|
|
|
"t10k-images-idx3-ubyte.gz" = "8d422c7b0a1c1c79245a5bcf07fe86e33eeafee792b84584aec276f5a2dbc4e6";
|
|
|
|
|
"t10k-labels-idx1-ubyte.gz" = "f7ae60f92e00ec6debd23a6088c31dbd2371eca3ffa0defaefb259924204aec6";
|
|
|
|
|
};
|
|
|
|
|
downloads = with pkgs.lib; flip mapAttrsToList fileInfos (name: sha256:
|
|
|
|
|
pkgs.fetchurl {
|
|
|
|
|
url = "http://yann.lecun.com/exdb/mnist/${name}";
|
|
|
|
|
inherit sha256;
|
|
|
|
|
});
|
2018-09-05 17:11:02 +02:00
|
|
|
|
in
|
2018-08-13 20:06:09 +02:00
|
|
|
|
mkDerivation {
|
|
|
|
|
pname = "tensorflow-mnist-input-data";
|
|
|
|
|
version = "0.1.0.0";
|
|
|
|
|
enableSeparateDataOutput = true;
|
|
|
|
|
setupHaskellDepends = [
|
|
|
|
|
base bytestring Cabal cryptonite directory filepath HTTP
|
|
|
|
|
network-uri
|
|
|
|
|
];
|
2018-09-05 17:11:02 +02:00
|
|
|
|
preConfigure = pkgs.lib.strings.concatStringsSep "\n" (
|
2018-09-06 08:44:19 +02:00
|
|
|
|
map (x: "ln -s ${x} data/$(stripHash ${x})") downloads
|
2018-09-05 17:11:02 +02:00
|
|
|
|
);
|
2018-08-13 20:06:09 +02:00
|
|
|
|
libraryHaskellDepends = [ base ];
|
|
|
|
|
homepage = "https://github.com/tensorflow/haskell#readme";
|
|
|
|
|
description = "Downloader of input data for training MNIST";
|
|
|
|
|
license = stdenv.lib.licenses.asl20;
|
|
|
|
|
}
|
|
|
|
|
) {});
|
2020-04-15 13:00:12 +02:00
|
|
|
|
|
|
|
|
|
tensorflow-opgen = (setTensorflowSourceRoot "tensorflow-opgen" super.tensorflow-opgen).override {
|
|
|
|
|
inherit lens-family proto-lens;
|
2018-08-13 20:06:09 +02:00
|
|
|
|
};
|
2020-04-15 13:00:12 +02:00
|
|
|
|
|
|
|
|
|
tensorflow-ops = (setTensorflowSourceRoot "tensorflow-ops" super.tensorflow-ops).override {
|
|
|
|
|
inherit lens-family proto-lens;
|
2018-08-13 20:06:09 +02:00
|
|
|
|
};
|
|
|
|
|
}
|