about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/machine-learning
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/science/machine-learning')
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/fasttext/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/labelimg/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/default.nix61
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/maps.nix63
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/shogun/default.nix65
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/torch/default.nix10
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/torch/torch-distro.nix336
7 files changed, 584 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/fasttext/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/fasttext/default.nix
new file mode 100644
index 000000000000..0ae9a74d0d0a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/fasttext/default.nix
@@ -0,0 +1,23 @@
+{stdenv, fetchFromGitHub, cmake}:
+
+stdenv.mkDerivation rec {
+  pname = "fasttext";
+  version = "0.2.0";
+
+  src = fetchFromGitHub {
+    owner = "facebookresearch";
+    repo = "fastText";
+    rev = version;
+    sha256 = "1fcrz648r2s80bf7vc0l371xillz5jk3ldaiv9jb7wnsyri831b4";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with stdenv.lib; {
+    description = "Library for text classification and representation learning";
+    homepage = https://fasttext.cc/;
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.danieldk ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/labelimg/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/labelimg/default.nix
new file mode 100644
index 000000000000..340073b016e3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/labelimg/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, python2Packages, fetchurl }:
+  python2Packages.buildPythonApplication rec {
+    name = "labelImg-${version}";
+    version = "1.6.0";
+    src = fetchurl {
+      url = "https://github.com/tzutalin/labelImg/archive/v${version}.tar.gz";
+      sha256 = "126kc4r7xm9170kh7snqsfkkc868m5bcnswrv7b4cq9ivlrdwbm4";
+    };
+    nativeBuildInputs = with python2Packages; [
+      pyqt4
+    ];
+    propagatedBuildInputs = with python2Packages; [
+      pyqt4
+      lxml
+    ];
+    preBuild = ''
+      make qt4py2
+    '';
+    meta = with stdenv.lib; {
+      description = "LabelImg is a graphical image annotation tool and label object bounding boxes in images";
+      homepage = https://github.com/tzutalin/labelImg;
+      license = licenses.mit;
+      platforms = platforms.linux;
+      maintainers = [ maintainers.cmcdragonkai ];
+    };
+  }
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/default.nix
new file mode 100644
index 000000000000..c0536b36cfe3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/default.nix
@@ -0,0 +1,61 @@
+{ config, stdenv
+, callPackage
+, lib
+, fetchurl
+, unzip
+, licenseAccepted ? config.sc2-headless.accept_license or false
+}:
+
+if !licenseAccepted then throw ''
+    You must accept the Blizzard® Starcraft® II AI and Machine Learning License at
+    https://blzdistsc2-a.akamaihd.net/AI_AND_MACHINE_LEARNING_LICENSE.html
+    by setting nixpkgs config option 'sc2-headless.accept_license = true;'
+  ''
+else assert licenseAccepted;
+let maps = callPackage ./maps.nix {};
+in stdenv.mkDerivation rec {
+  version = "4.7.1";
+  name = "sc2-headless-${version}";
+
+  src = fetchurl {
+    url = "https://blzdistsc2-a.akamaihd.net/Linux/SC2.${version}.zip";
+    sha256 = "0q1ry9bd3dm8y4hvh57yfq7s05hl2k2sxi2wsl6h0r3w690v1kdd";
+  };
+
+  unpackCmd = ''
+    unzip -P 'iagreetotheeula' $curSrc
+  '';
+
+  nativeBuildInputs = [ unzip ];
+
+  installPhase = ''
+    mkdir -p $out
+    cp -r . "$out"
+    rm -r $out/Libs
+
+    cp -ur "${maps.minigames}"/* "${maps.melee}"/* "${maps.ladder2017season1}"/* "${maps.ladder2017season2}"/* "${maps.ladder2017season3}"/* \
+      "${maps.ladder2017season4}"/* "${maps.ladder2018season1}"/* "${maps.ladder2018season2}"/* \
+      "${maps.ladder2018season3}"/*  "${maps.ladder2018season4}"/* "${maps.ladder2019season1}"/* "$out"/Maps/
+  '';
+
+  preFixup = ''
+    find $out -type f -print0 | while IFS=''' read -d ''' -r file; do
+      isELF "$file" || continue
+      patchelf \
+        --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+        --set-rpath ${lib.makeLibraryPath [stdenv.cc.cc stdenv.cc.libc]} \
+        "$file"
+    done
+  '';
+
+  meta = {
+    platforms = stdenv.lib.platforms.linux;
+    description = "Starcraft II headless linux client for machine learning research";
+    license = {
+      fullName = "BLIZZARD® STARCRAFT® II AI AND MACHINE LEARNING LICENSE";
+      url = "https://blzdistsc2-a.akamaihd.net/AI_AND_MACHINE_LEARNING_LICENSE.html";
+      free = false;
+    };
+    maintainers = with lib.maintainers; [ danharaj ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/maps.nix b/nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/maps.nix
new file mode 100644
index 000000000000..6eec10e958c2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/maps.nix
@@ -0,0 +1,63 @@
+{ fetchzip
+}:
+let
+  fetchzip' = args: (fetchzip args).overrideAttrs (old: { UNZIP = "-j -P iagreetotheeula"; });
+in
+{
+  minigames = fetchzip {
+    url = "https://github.com/deepmind/pysc2/releases/download/v1.2/mini_games.zip";
+    sha256 = "19f873ilcdsf50g2v0s2zzmxil1bqncsk8nq99bzy87h0i7khkla";
+    stripRoot = false;
+  };
+  
+  melee = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Melee.zip";
+    sha256 = "0z44pgy10jklsvgpr0kcn4c2mz3hw7nlcmvsy6a6lzpi3dvzf33i";
+    stripRoot = false;
+  };
+  ladder2017season1 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season1.zip";
+    sha256 = "0ngg4g74s2ryhylny93fm8yq9rlrhphwnjg2s6f3qr85a2b3zdpd";
+    stripRoot = false;
+  };
+  ladder2017season2 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season2.zip";
+    sha256 = "01kycnvqagql9pkjkcgngfcnry2pc4kcygdkk511m0qr34909za5";
+    stripRoot = false;
+  };
+  ladder2017season3 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season3_Updated.zip";
+    sha256 = "0wix3lwmbyxfgh8ldg0n66i21p0dbavk2dxjngz79rx708m8qvld";
+    stripRoot = false;
+  };
+  ladder2017season4 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season4.zip";
+    sha256 = "1sidnmk2rc9j5fd3a4623pvaika1mm1rwhznb2qklsqsq1x2qckp";
+    stripRoot = false;
+  };
+  ladder2018season1 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season1.zip";
+    sha256 = "0mp0ilcq0gmd7ahahc5i8c7bdr3ivk6skx0b2cgb1z89l5d76irq";
+    stripRoot = false;
+  };
+  ladder2018season2 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season2_Updated.zip";
+    sha256 = "176rs848cx5src7qbr6dnn81bv1i86i381fidk3v81q9bxlmc2rv";
+    stripRoot = false;
+  };
+  ladder2018season3 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season3.zip";
+    sha256 = "1r3wv4w53g9zq6073ajgv74prbdsd1x3zfpyhv1kpxbffyr0x0zp";
+    stripRoot = false;
+  };
+  ladder2018season4 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season4.zip";
+    sha256 = "0k47rr6pzxbanlqnhliwywkvf0w04c8hxmbanksbz6aj5wpkcn1s";
+    stripRoot = false;
+  };
+  ladder2019season1 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2019Season1.zip";
+    sha256 = "1dlk9zza8h70lbjvg2ykc5wr9vsvvdk02szwrkgdw26mkssl2rg9";
+    stripRoot = false;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/shogun/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/shogun/default.nix
new file mode 100644
index 000000000000..8de78092bd84
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/shogun/default.nix
@@ -0,0 +1,65 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch, ccache, cmake, ctags, swig
+# data, compression
+, bzip2, curl, hdf5, json_c, lzma, lzo, protobuf, snappy
+# maths
+, openblasCompat, eigen, nlopt, lp_solve, colpack
+# libraries
+, libarchive, libxml2
+# extra support
+, pythonSupport ? true, pythonPackages ? null
+, opencvSupport ? false, opencv ? null
+}:
+
+assert pythonSupport -> pythonPackages != null;
+assert opencvSupport -> opencv != null;
+
+stdenv.mkDerivation rec {
+  pname = "shogun";
+  version = "6.0.0";
+  name = pname + "-" + version;
+
+  src = fetchFromGitHub {
+    owner = pname + "-toolbox";
+    repo = pname;
+    rev = pname + "_" + version;
+    sha256 = "0f2zwzvn5apvwypkfkq371xp7c5bdb4g1fwqfh8c2d57ysjxhmgf";
+    fetchSubmodules = true;
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "Fix-meta-example-parser-bug-in-parallel-builds.patch";
+      url = "https://github.com/shogun-toolbox/shogun/commit/ecd6a8f11ac52748e89d27c7fab7f43c1de39f05.patch";
+      sha256 = "1hrwwrj78sxhwcvgaz7n4kvh5y9snfcc4jf5xpgji5hjymnl311n";
+    })
+    (fetchpatch {
+      url = "https://github.com/awild82/shogun/commit/365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch";
+      sha256 = "158hqv4xzw648pmjbwrhxjp7qcppqa7kvriif87gn3zdn711c49s";
+    })
+  ];
+
+  CCACHE_DIR=".ccache";
+
+  buildInputs = with lib; [
+      openblasCompat bzip2 ccache cmake colpack curl ctags eigen hdf5 json_c lp_solve lzma lzo
+      protobuf nlopt snappy swig (libarchive.dev) libxml2
+    ]
+    ++ optionals (pythonSupport) (with pythonPackages; [ python ply numpy ])
+    ++ optional  (opencvSupport) opencv;
+
+  cmakeFlags = with lib; []
+    ++ (optional (pythonSupport) "-DPythonModular=ON")
+    ++ (optional (opencvSupport) "-DOpenCV=ON")
+    ;
+
+  # Previous attempts to fix parallel builds (see patch above) were not entirely successful.
+  # Sporadic build failures still exist. Dislable parallel builds for now.
+  enableParallelBuilding = false;
+
+  meta = with stdenv.lib; {
+    description = "A toolbox which offers a wide range of efficient and unified machine learning methods";
+    homepage = "http://shogun-toolbox.org/";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ edwtjo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/torch/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/torch/default.nix
new file mode 100644
index 000000000000..bdeeaad189a7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/torch/default.nix
@@ -0,0 +1,10 @@
+{ callPackage, fetchgit, lua } :
+let
+  src = fetchgit {
+    url = "https://github.com/grwlf/torch-distro";
+    rev = "f972c4253b14b95b53aefe7b24efa496223e73f2";
+    sha256 = "1lhjhivhyypaic33vj1nsghshsajf7vi6gwsclaf3nqdl27d1h1s";
+  };
+
+in
+  callPackage (import ./torch-distro.nix) { inherit lua src; }
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/torch/torch-distro.nix b/nixpkgs/pkgs/applications/science/machine-learning/torch/torch-distro.nix
new file mode 100644
index 000000000000..9c4f24021430
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/torch/torch-distro.nix
@@ -0,0 +1,336 @@
+{ luarocks, lib , stdenv,  readline,  makeWrapper,
+  less, ncurses, cmake, coreutils, fetchgit, libuuid, czmq, openssl,
+  gnuplot, lua, src, libjpeg, libpng
+} :
+
+let
+
+  common_meta = {
+    homepage = http://torch.ch;
+    license = stdenv.lib.licenses.bsd3;
+    maintainers = with stdenv.lib.maintainers; [ smironov ];
+    platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;
+  };
+
+  distro_src = src;
+
+  default_luarocks = luarocks;
+
+  pkgs_gnuplot = gnuplot;
+
+  luapkgs = rec {
+
+    luarocks = default_luarocks.override {
+      inherit lua;
+    };
+
+    buildLuaRocks = { rockspec ? "", luadeps ? [] , buildInputs ? []
+                    , preBuild ? "" , postInstall ? ""
+                    , runtimeDeps ? [] ,  ... }@args :
+      let
+
+        luadeps_ =
+          luadeps ++
+          (lib.concatMap (d : if d ? luadeps then d.luadeps else []) luadeps);
+
+        runtimeDeps_ =
+          runtimeDeps ++
+          (lib.concatMap (d : if d ? runtimeDeps then d.runtimeDeps else []) luadeps) ++
+          [ lua coreutils ];
+
+        mkcfg = ''
+          export LUAROCKS_CONFIG=config.lua
+          cat >config.lua <<EOF
+            rocks_trees = {
+                 { name = [[system]], root = [[${luarocks}]] }
+               ${lib.concatImapStrings (i : dep :  ", { name = [[dep${toString i}]], root = [[${dep}]] }") luadeps_}
+            };
+
+            variables = {
+              LUA_BINDIR = "$out/bin";
+              LUA_INCDIR = "$out/include";
+              LUA_LIBDIR = "$out/lib/lua/${lua.luaversion}";
+            };
+          EOF
+        '';
+
+      in
+      stdenv.mkDerivation (args // {
+
+        name = "${args.name}-${lua.luaversion}";
+
+        inherit preBuild postInstall;
+
+        inherit luadeps runtimeDeps;
+
+        phases = [ "unpackPhase" "patchPhase" "buildPhase"];
+
+        buildInputs = runtimeDeps ++ buildInputs ++ [ makeWrapper lua ];
+
+        buildPhase = ''
+          eval "$preBuild"
+          ${mkcfg}
+          eval "`${luarocks}/bin/luarocks --deps-mode=all --tree=$out path`"
+          ${luarocks}/bin/luarocks make --deps-mode=all --tree=$out ${rockspec}
+
+          for p in $out/bin/*; do
+            wrapProgram $p \
+              --suffix LD_LIBRARY_PATH ';' "${lib.makeLibraryPath runtimeDeps_}" \
+              --suffix PATH ';' "${lib.makeBinPath runtimeDeps_}" \
+              --suffix LUA_PATH ';' "\"$LUA_PATH\"" \
+              --suffix LUA_PATH ';' "\"$out/share/lua/${lua.luaversion}/?.lua;$out/share/lua/${lua.luaversion}/?/init.lua\"" \
+              --suffix LUA_CPATH ';' "\"$LUA_CPATH\"" \
+              --suffix LUA_CPATH ';' "\"$out/lib/lua/${lua.luaversion}/?.so;$out/lib/lua/${lua.luaversion}/?/init.so\""
+          done
+
+          eval "$postInstall"
+        '';
+      });
+
+    # FIXME: doesn't installs lua-files for some reason
+    # lua-cjson = buildLuaPackage {
+    #   name = "lua-cjson";
+    #   src = ./extra/lua-cjson;
+    #   rockspec = "lua-cjson-2.1devel-1.rockspec";
+    # };
+
+    lua-cjson = stdenv.mkDerivation rec {
+      name = "lua-cjson";
+      src = "${distro_src}/extra/lua-cjson";
+
+      preConfigure = ''
+        makeFlags="PREFIX=$out LUA_LIBRARY=$out/lib/lua"
+      '';
+
+      buildInputs = [lua];
+
+      installPhase = ''
+        make install-extra $makeFlags
+      '';
+      meta.broken = true;
+    };
+
+    luafilesystem = buildLuaRocks {
+      name = "filesystem";
+      src = "${distro_src}/extra/luafilesystem";
+      luadeps = [lua-cjson];
+      rockspec = "rockspecs/luafilesystem-1.6.3-1.rockspec";
+    };
+
+    penlight = buildLuaRocks {
+      name = "penlight";
+      src = "${distro_src}/extra/penlight";
+      luadeps = [luafilesystem];
+    };
+
+    luaffifb = buildLuaRocks {
+      name = "luaffifb";
+      src = "${distro_src}/extra/luaffifb";
+      meta.broken = true;
+    };
+
+    sundown = buildLuaRocks rec {
+      name = "sundown";
+      src = "${distro_src}/pkg/sundown";
+      rockspec = "rocks/${name}-scm-1.rockspec";
+      meta.broken = true; # 2018-04-11
+    };
+
+    cwrap = buildLuaRocks rec {
+      name = "cwrap";
+      src = "${distro_src}/pkg/cwrap";
+      rockspec = "rocks/${name}-scm-1.rockspec";
+    };
+
+    paths = buildLuaRocks rec {
+      name = "paths";
+      src = "${distro_src}/pkg/paths";
+      buildInputs = [cmake];
+      rockspec = "rocks/${name}-scm-1.rockspec";
+    };
+
+    torch = buildLuaRocks rec {
+      name = "torch";
+      src = "${distro_src}/pkg/torch";
+      luadeps = [ paths cwrap ];
+      buildInputs = [ cmake ];
+      rockspec = "rocks/torch-scm-1.rockspec";
+      preBuild = ''
+        substituteInPlace ${rockspec} \
+          --replace '"sys >= 1.0"' ' '
+        export LUA_PATH="$src/?.lua;$LUA_PATH"
+      '';
+      meta = common_meta // {
+        description = "Torch is a machine-learning library";
+        longDescription = ''
+          Torch is the main package in [Torch7](http://torch.ch) where data
+          structures for multi-dimensional tensors and mathematical operations
+          over these are defined. Additionally, it provides many utilities for
+          accessing files, serializing objects of arbitrary types and other
+          useful utilities.
+        '';
+      };
+    };
+
+    dok = buildLuaRocks rec {
+      name = "dok";
+      src = "${distro_src}/pkg/dok";
+      luadeps = [sundown];
+      rockspec = "rocks/${name}-scm-1.rockspec";
+    };
+
+    sys = buildLuaRocks rec {
+      name = "sys";
+      luadeps = [torch];
+      buildInputs = [readline cmake];
+      src = "${distro_src}/pkg/sys";
+      rockspec = "sys-1.1-0.rockspec";
+      preBuild = ''
+        export Torch_DIR=${torch}/share/cmake/torch
+      '';
+    };
+
+    xlua = buildLuaRocks rec {
+      name = "xlua";
+      luadeps = [torch sys];
+      src = "${distro_src}/pkg/xlua";
+      rockspec = "xlua-1.0-0.rockspec";
+    };
+
+    nn = buildLuaRocks rec {
+      name = "nn";
+      luadeps = [torch luaffifb];
+      buildInputs = [cmake];
+      src = "${distro_src}/extra/nn";
+      rockspec = "rocks/nn-scm-1.rockspec";
+      preBuild = ''
+        export Torch_DIR=${torch}/share/cmake/torch
+      '';
+    };
+
+    graph = buildLuaRocks rec {
+      name = "graph";
+      luadeps = [ torch ];
+      buildInputs = [cmake];
+      src = "${distro_src}/extra/graph";
+      rockspec = "rocks/graph-scm-1.rockspec";
+      preBuild = ''
+        export Torch_DIR=${torch}/share/cmake/torch
+      '';
+    };
+
+    nngraph = buildLuaRocks rec {
+      name = "nngraph";
+      luadeps = [ torch nn graph ];
+      buildInputs = [cmake];
+      src = "${distro_src}/extra/nngraph";
+      preBuild = ''
+        export Torch_DIR=${torch}/share/cmake/torch
+      '';
+    };
+
+    image = buildLuaRocks rec {
+      name = "image";
+      luadeps = [ torch dok sys xlua ];
+      buildInputs = [cmake libjpeg libpng];
+      src = "${distro_src}/pkg/image";
+      rockspec = "image-1.1.alpha-0.rockspec";
+      preBuild = ''
+        export Torch_DIR=${torch}/share/cmake/torch
+      '';
+    };
+
+    optim = buildLuaRocks rec {
+      name = "optim";
+      luadeps = [ torch ];
+      buildInputs = [cmake];
+      src = "${distro_src}/pkg/optim";
+      rockspec = "optim-1.0.5-0.rockspec";
+      preBuild = ''
+        export Torch_DIR=${torch}/share/cmake/torch
+      '';
+    };
+
+    gnuplot = buildLuaRocks rec {
+      name = "gnuplot";
+      luadeps = [ torch paths ];
+      runtimeDeps = [ pkgs_gnuplot less ];
+      src = "${distro_src}/pkg/gnuplot";
+      rockspec = "rocks/gnuplot-scm-1.rockspec";
+    };
+
+    unsup = buildLuaRocks rec {
+      name = "unsup";
+      luadeps = [ torch xlua optim ];
+      buildInputs = [ cmake ];
+      src = fetchgit {
+        url = "https://github.com/koraykv/unsup";
+        rev = "1d4632e716dc3c82feecc7dd4b22549df442859f";
+        sha256 = "0npjq3y1cfmk026sdijcw3f766innrmb3qggnxsz62grczhfvgls";
+      };
+      rockspec = "unsup-0.1-0.rockspec";
+      preBuild = ''
+        export Torch_DIR=${torch}/share/cmake/torch
+      '';
+      meta.broken = true;
+    };
+
+    trepl = buildLuaRocks rec {
+      name = "trepl";
+      luadeps = [torch gnuplot paths penlight graph nn nngraph image gnuplot optim sys dok unsup];
+      runtimeDeps = [ ncurses readline ];
+      src = "${distro_src}/exe/trepl";
+      meta = common_meta // {
+        description = "A pure Lua REPL for Lua(JIT), with heavy support for Torch types.";
+      };
+    };
+
+    lbase64 = buildLuaRocks rec {
+      name = "lbase64";
+      src = fetchgit {
+        url = "https://github.com/LuaDist2/lbase64";
+        rev = "1e9e4f1e0bf589a0ed39f58acc185ec5e213d207";
+        sha256 = "1i1fpy9v6r4w3lrmz7bmf5ppq65925rv90gx39b3pykfmn0hcb9c";
+      };
+      meta.broken = true; # 2018-04-11
+    };
+
+    luuid = stdenv.mkDerivation rec {
+      name = "luuid";
+      src = fetchgit {
+        url = "https://github.com/LuaDist/luuid";
+        sha256 = "062gdf1rild11jg46vry93hcbb36b4527pf1dy7q9fv89f7m2nav";
+      };
+
+      preConfigure = ''
+        cmakeFlags="-DLUA_LIBRARY=${lua}/lib/lua/${lua.luaversion} -DINSTALL_CMOD=$out/lib/lua/${lua.luaversion} -DINSTALL_MOD=$out/lib/lua/${lua.luaversion}"
+      '';
+
+      buildInputs = [cmake libuuid lua];
+      meta = {
+        # FIXME: set the exact revision for src
+        broken = true;
+      };
+    };
+
+    # Doesn't work due to missing deps (according to luarocs).
+    itorch = buildLuaRocks rec {
+      name = "itorch";
+      luadeps = [torch gnuplot paths penlight graph nn nngraph image gnuplot
+                  optim sys dok lbase64 lua-cjson luuid];
+      buildInputs = [czmq openssl];
+      src = "${distro_src}/extra/iTorch";
+      meta = {
+        # FIXME: figure out whats wrong with deps
+        broken = true;
+      };
+    };
+
+
+  };
+
+in
+
+luapkgs
+
+