Skip to content

Instantly share code, notes, and snippets.

@cleverca22
Forked from anonymous/default.nix
Last active October 23, 2015 11:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cleverca22/908c0ad8672912feddab to your computer and use it in GitHub Desktop.
Save cleverca22/908c0ad8672912feddab to your computer and use it in GitHub Desktop.
{ stdenv, lua, fetchFromGitHub }:
stdenv.mkDerivation rec {
name = "cwrap-7";
src = fetchFromGitHub {
owner = "torch";
repo = "cwrap";
rev = "6e7d52f0a359dee47127386adb03c0dc4ddd4766";
sha256 = "01yh9z0axz0b4f87mbhkzh64dyv6c4jdkazcpmy1bl1am8apbd8w";
};
installPhase = ''
mkdir -p $out/share/lua/5.2/cwrap/ $out/nix-support
cp -v init.lua types.lua cinterface.lua $out/share/lua/5.2/cwrap/
cat <<EOF > $out/nix-support/setup-hook
# FIXME, overrides all other lua packages, doesnt persist past compile
export LUA_PATH=$out/share/lua/5.2/?/init.lua\;$out/share/lua/5.2/?.lua\;?.lua
EOF
'';
buildInputs = [ lua ];
}
with import <nixpkgs> {};
let
cwrap = pkgs.callPackage ./cwrap.nix {};
in
stdenv.mkDerivation rec {
name = "torch-7";
src = fetchFromGitHub {
owner = "torch";
repo = "torch7";
rev = "adfee5da9740aab2ebf647ecffe1102e8e3ccef5";
sha256 = "0bl2ygfyapvfb2z5w2wk6v0ayg82a5xxh1449shvn7wv1815qs9g";
};
cmakeFlags = [ "-DLUA=${pkgs.lua}/bin/lua" ];
buildInputs = [ cwrap cmake readline qt4 libjpeg libpng ncurses imagemagick gfortran gnuplot lua ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment