Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 fetchFromGitHub, 4 stdenv, 5 findlib, 6 ocaml, 7 ocamlbuild, 8}: 9 10lib.throwIf (lib.versionOlder ocaml.version "4.02") 11 "sosa is not available for OCaml ${ocaml.version}" 12 13 stdenv.mkDerivation 14 rec { 15 pname = "ocaml${ocaml.version}-sosa"; 16 version = "0.3.0"; 17 18 src = fetchFromGitHub { 19 owner = "hammerlab"; 20 repo = "sosa"; 21 rev = "sosa.${version}"; 22 sha256 = "053hdv6ww0q4mivajj4iyp7krfvgq8zajq9d8x4mia4lid7j0dyk"; 23 }; 24 25 postPatch = lib.optionalString (lib.versionAtLeast ocaml.version "4.07") '' 26 for p in functors list_of of_mutable 27 do 28 substituteInPlace src/lib/$p.ml --replace Pervasives. Stdlib. 29 done 30 ''; 31 32 nativeBuildInputs = [ 33 ocaml 34 ocamlbuild 35 findlib 36 ]; 37 38 strictDeps = true; 39 40 buildPhase = "make build"; 41 42 createFindlibDestdir = true; 43 44 doCheck = true; 45 46 meta = with lib; { 47 homepage = "http://www.hammerlab.org/docs/sosa/master/index.html"; 48 description = "Sane OCaml String API"; 49 license = licenses.isc; 50 maintainers = [ maintainers.alexfmpe ]; 51 }; 52 }