Skip to content

Instantly share code, notes, and snippets.

@benkolera
Last active August 2, 2018 08:40
Show Gist options
  • Save benkolera/5200fe1100ee532c97dc18da6531797f to your computer and use it in GitHub Desktop.
Save benkolera/5200fe1100ee532c97dc18da6531797f to your computer and use it in GitHub Desktop.
{ nixpkgs ? import <nixpkgs> {} }:
with nixpkgs;
let
hpkgs = pkgs.haskell.packages.ghc843;
nlopt-new = hpkgs.mkDerivation {
pname = "nlopt-haskell";
version = "0.1.2.0";
src = fetchFromGitHub {
owner = "peddie";
repo = "nlopt-haskell";
rev = "dd8c88334a91e51598beecfd02165a1810890c43";
sha256 = "1bmb53a3k4scr8higwihz2nrf1r4041sxxr1gg8xfajzy03n0qmd";
};
libraryHaskellDepends = (with hpkgs; [base vector ]);
testHaskellDepends = (with hpkgs; [ base vector ]);
librarySystemDepends = [ pkgs.nlopt ];
testSystemDepends = [ pkgs.nlopt ];
homepage = "https://github.com/peddie/nlopt-haskell";
description = "Low-level bindings to the NLOPT optimization library";
license = stdenv.lib.licenses.bsd3.fullName;
configureFlags = ["-flink-nlopt-cxx"];
};
hmatrix-nlopt-new = hpkgs.mkDerivation {
pname = "hmatrix-nlopt";
version = "0.1.2.0";
src = fetchFromGitHub {
owner = "peddie";
repo = "hmatrix-nlopt";
rev = "e13a471599d5fca318d4bfc9417d1156bea3bb5";
sha256 = "01bn12d90f8gfrw2fgq2yrpwh8p8wz0w922vvh716vjn2g647x5q";
};
libraryHaskellDepends = (with hpkgs; [base hmatrix nlopt-new vector ]);
testHaskellDepends = (with hpkgs; [ base doctest ]);
homepage = "https://github.com/peddie/hmatrix-nlopt";
description = "Interface HMatrix with the NLOPT minimizer";
license = stdenv.lib.licenses.bsd3.fullName;
};
ghc = hpkgs.ghcWithPackages (ps: with ps; [
hmatrix-nlopt-new
hmpfr
hmatrix-gsl
]);
in
pkgs.stdenv.mkDerivation {
name = "my-haskell-env-0";
buildInputs = [ ghc ];
shellHook = "eval $(egrep ^export ${ghc}/bin/ghc)";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment