diff options
Diffstat (limited to 'pkgs/development/ocaml-modules')
-rw-r--r-- | pkgs/development/ocaml-modules/frontc/default.nix | 35 | ||||
-rw-r--r-- | pkgs/development/ocaml-modules/ppx_tools/default.nix | 43 | ||||
-rw-r--r-- | pkgs/development/ocaml-modules/qtest/default.nix | 12 |
3 files changed, 67 insertions, 23 deletions
diff --git a/pkgs/development/ocaml-modules/frontc/default.nix b/pkgs/development/ocaml-modules/frontc/default.nix new file mode 100644 index 000000000000..ecf1ddc8fbae --- /dev/null +++ b/pkgs/development/ocaml-modules/frontc/default.nix @@ -0,0 +1,35 @@ +{lib, buildOcaml, fetchurl}: + +buildOcaml rec { + name = "FrontC"; + version = "3.4"; + + src = fetchurl { + url = "http://www.irit.fr/recherches/ARCHI/MARCH/frontc/Frontc-${version}.tgz"; + sha256 = "16dz153s92dgbw1rrfwbhscy73did87kfmjwyh3qpvs748h1sc4g"; + }; + + meta = with lib; { + homepage = https://www.irit.fr/recherches/ARCHI/MARCH/rubrique.php3?id_rubrique=61; + description = "C Parsing Library"; + license = licenses.lgpl21; + maintainers = [ maintainers.maurer ]; + }; + + meta_file = fetchurl { + url = https://raw.githubusercontent.com/ocaml/opam-repository/0f0e610f6499bdf0151e4170411b4f05e4d076d4/packages/FrontC/FrontC.3.4/files/META; + sha256 = "1flhvwr01crn7d094kby0418s1m4198np85ymjp3b4maz0n7m2mx"; + }; + + opam_patch = fetchurl { + url = https://raw.githubusercontent.com/ocaml/opam-repository/0f0e610f6499bdf0151e4170411b4f05e4d076d4/packages/FrontC/FrontC.3.4/files/opam.patch; + sha256 = "0xf83ixx0mf3mznwpwp2mjflii0njdzikhhfxpnms7vhnnmlfzy5"; + }; + + patches = [ opam_patch ]; + patchFlags = "-p4"; + + makeFlags = "PREFIX=$(out) OCAML_SITE=$(OCAMLFIND_DESTDIR)"; + + postInstall = "cp ${meta_file} $OCAMLFIND_DESTDIR/FrontC/META"; +} diff --git a/pkgs/development/ocaml-modules/ppx_tools/default.nix b/pkgs/development/ocaml-modules/ppx_tools/default.nix index 377dc32751a7..33bf180cd7f3 100644 --- a/pkgs/development/ocaml-modules/ppx_tools/default.nix +++ b/pkgs/development/ocaml-modules/ppx_tools/default.nix @@ -1,21 +1,30 @@ -{ stdenv, fetchzip, ocaml, findlib }: +{ stdenv, fetchFromGitHub, ocaml, findlib }: -stdenv.mkDerivation { - name = "ocaml-ppx_tools-5.0+4.02"; - src = fetchzip { - url = https://github.com/alainfrisch/ppx_tools/archive/5.0+4.02.0.tar.gz; - sha256 = "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8"; - }; +let + version = + if stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.03" then "5.0+4.03.0" else "5.0+4.02.0"; +in + stdenv.mkDerivation { + name = "ocaml-ppx_tools-${version}"; + src = fetchFromGitHub { + owner = "alainfrisch"; + repo = "ppx_tools"; + rev = version; + sha256 = if version == "5.0+4.03.0" + then "061v1fl5z7z3ywi4ppryrlcywnvnqbsw83ppq72qmkc7ma4603jg" + else "16drjk0qafjls8blng69qiv35a84wlafpk16grrg2i3x19p8dlj8" + ; + }; - buildInputs = [ ocaml findlib ]; + buildInputs = [ ocaml findlib ]; - createFindlibDestdir = true; + createFindlibDestdir = true; - meta = with stdenv.lib; { - description = "Tools for authors of ppx rewriters"; - homepage = http://www.lexifi.com/ppx_tools; - license = licenses.mit; - platforms = ocaml.meta.platforms or []; - maintainers = with maintainers; [ vbgl ]; - }; -} + meta = with stdenv.lib; { + description = "Tools for authors of ppx rewriters"; + homepage = http://www.lexifi.com/ppx_tools; + license = licenses.mit; + platforms = ocaml.meta.platforms or []; + maintainers = with maintainers; [ vbgl ]; + }; + } diff --git a/pkgs/development/ocaml-modules/qtest/default.nix b/pkgs/development/ocaml-modules/qtest/default.nix index f7e585b43b08..05b9c06af0fe 100644 --- a/pkgs/development/ocaml-modules/qtest/default.nix +++ b/pkgs/development/ocaml-modules/qtest/default.nix @@ -1,20 +1,20 @@ -{ stdenv, fetchzip, ocaml, oasis, findlib, ounit }: +{ stdenv, fetchzip, ocaml, findlib, ounit }: -let version = "2.0.1"; in +let version = "2.2"; in stdenv.mkDerivation { name = "ocaml-qtest-${version}"; src = fetchzip { url = "https://github.com/vincent-hugot/iTeML/archive/v${version}.tar.gz"; - sha256 = "00sir7q7z78s22w8fzrgw9gqm7r8ww0bgwqxrq6nsbbclgxj9c6i"; + sha256 = "1k68z8kby1f9s5j9xbn9bz8yhk59aalffz8gj5d1y5zhyalifrlz"; }; - buildInputs = [ ocaml oasis findlib ]; + buildInputs = [ ocaml findlib ]; propagatedBuildInputs = [ ounit ]; - buildPhase = "ocaml do.ml qtest build $out"; createFindlibDestdir = true; - installPhase = "ocaml do.ml qtest install $out"; + installFlags = [ "BIN=$(out)/bin" ]; + preInstall = "mkdir -p $out/bin"; meta = { description = "Inline (Unit) Tests for OCaml (formerly “qtest”)"; |