summary refs log tree commit diff
path: root/pkgs/applications/science/misc/megam/default.nix
blob: f86bed854a2bf327fe94c8dffc89de293616809c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{ fetchurl, stdenv, ocaml, makeWrapper, ncurses }:

let version = "0.92"; in
stdenv.mkDerivation {
  pname = "megam";
  inherit version;

  src = fetchurl {
    url = "http://hal3.name/megam/megam_src.tgz";
    sha256 = "dc0e9f59ff8513449fe3bd40b260141f89c88a4edf6ddc8b8a394c758e49724e";
  };

  patches = [ ./ocaml-includes.patch ./ocaml-3.12.patch ];
  
  buildInputs = [ ocaml ncurses ];

  nativeBuildInputs = [ makeWrapper ];

  makeFlags = "CAML_INCLUDES=${ocaml}/lib/ocaml/caml";

  # see https://bugzilla.redhat.com/show_bug.cgi?id=435559
  dontStrip = true;

  installPhase = ''
    mkdir -pv $out/bin
    cp -Rv megam $out/bin
  '';


  meta = {
    description = "MEGA Model Optimization Package";

    longDescription =
      ''  The software here is an implementation of maximum likelihood
          and maximum a posterior optimization of the parameters of
          these models.  The algorithms used are much more efficient
          than the iterative scaling techniques used in almost every
          other maxent package out there.  '';

    homepage = http://www.umiacs.umd.edu/~hal/megam;

    license = "non-commercial";

    maintainers = [ ];
    platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;  # arbitrary choice
  };
}