summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/http/default.nix
blob: 8b611c65a41d6d5e90ef8c820207ac979e60e477 (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
{stdenv, fetchurl, ocaml_pcre, ocamlnet, ocaml, findlib}:

let
  ocaml_version = (builtins.parseDrvName ocaml.name).version;
  pname = "ocaml-http";
  version = "0.1.3";
in

stdenv.mkDerivation {
  name = "${pname}-${version}";

  src = fetchurl {
    url = "http://upsilon.cc/~zack/hacking/software/${pname}/${pname}-${version}.tar.gz";
    sha256 = "070xw033r4pk6f4l0wcknm75y9qm4mp622a4cgzmcfhm58v6kssn";
  };

  buildInputs = [ocaml_pcre ocamlnet ocaml findlib];

  createFindlibDestdir = true;

  prePatch = ''
    BASH=$(type -tp bash)
    echo $BASH
    substituteInPlace Makefile --replace "SHELL=/bin/bash" "SHELL=$BASH"
  '';

  configurePhase = "true";	# Skip configure phase

  buildPhase = ''
    make all opt
  '';

  meta = {
    homepage = "http://upsilon.cc/~zack/hacking/software/ocaml-http/";
    description = "do it yourself (OCaml) HTTP daemon";
    license = stdenv.lib.licenses.lgpl2;
    maintainers = [ stdenv.lib.maintainers.roconnor ];
  };
}