From e3c1e37823976a712ec86ddc7bb78f9c6420131a Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Fri, 24 Mar 2017 19:09:00 +0000 Subject: [PATCH] ocamlPackages.ppx_ast: init at 0.9.0 Ppx_ast selects a specific version of the OCaml Abstract Syntax Tree from the migrate-parsetree project that is not necessarily the same one as the one being used by the compiler. Homepage: https://github.com/janestreet/ppx_ast --- .../ocaml-modules/janestreet/ppx_ast.nix | 24 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/development/ocaml-modules/janestreet/ppx_ast.nix diff --git a/pkgs/development/ocaml-modules/janestreet/ppx_ast.nix b/pkgs/development/ocaml-modules/janestreet/ppx_ast.nix new file mode 100644 index 00000000000..33f1766cb4a --- /dev/null +++ b/pkgs/development/ocaml-modules/janestreet/ppx_ast.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchurl, ocaml, jbuilder, findlib +, ocaml-compiler-libs, ocaml-migrate-parsetree +}: + +stdenv.mkDerivation { + name = "ocaml${ocaml.version}-ppx_ast-0.9.0"; + src = fetchurl { + url = http://ocaml.janestreet.com/ocaml-core/v0.9/files/ppx_ast-v0.9.0.tar.gz; + sha256 = "1hirfmxr8hkf3p39k1pqidabxxhd541d6ddfaqpgxbl51bw9ddmz"; + }; + + buildInputs = [ ocaml jbuilder findlib ]; + propagatedBuildInputs = [ ocaml-compiler-libs ocaml-migrate-parsetree ]; + + inherit (jbuilder) installPhase; + + meta = { + description = "OCaml AST used by Jane Street ppx rewriters"; + homepage = https://github.com/janestreet/ppx_ast; + license = stdenv.lib.licenses.asl20; + maintainers = [ stdenv.lib.maintainers.vbgl ]; + inherit (ocaml.meta) platforms; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 12ddbfafa10..54460f855db 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -573,6 +573,8 @@ let ocaml-compiler-libs = callPackage ../development/ocaml-modules/janestreet/ocaml-compiler-libs.nix {}; + ppx_ast = callPackage ../development/ocaml-modules/janestreet/ppx_ast.nix {}; + ppx_core = if lib.versionOlder "4.03" ocaml.version then callPackage ../development/ocaml-modules/janestreet/ppx_core-113_33_01.nix {}