From 7621523fc19d76a6fe8715a25159557b872fc6af Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Fri, 30 Nov 2018 12:46:14 +0100 Subject: [PATCH 1/3] Add bisect_ppx and bisect_ppx-ocamlbuild --- .../bisect_ppx-ocamlbuild/default.nix | 32 ++++++++++++++++++ .../ocaml-modules/bisect_ppx/default.nix | 33 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 3 ++ 3 files changed, 68 insertions(+) create mode 100644 pkgs/development/ocaml-modules/bisect_ppx-ocamlbuild/default.nix create mode 100644 pkgs/development/ocaml-modules/bisect_ppx/default.nix diff --git a/pkgs/development/ocaml-modules/bisect_ppx-ocamlbuild/default.nix b/pkgs/development/ocaml-modules/bisect_ppx-ocamlbuild/default.nix new file mode 100644 index 000000000000..e4d5c22c187f --- /dev/null +++ b/pkgs/development/ocaml-modules/bisect_ppx-ocamlbuild/default.nix @@ -0,0 +1,32 @@ +{ stdenv, fetchFromGitHub, ocaml, dune, findlib, ocamlbuild }: + +let version = "1.4.0"; in + +stdenv.mkDerivation { + name = "ocaml${ocaml.version}-bisect_ppx-ocamlbuild-${version}"; + + src = fetchFromGitHub { + owner = "aantron"; + repo = "bisect_ppx"; + rev = version; + sha256 = "1plhm4pvrhpapz5zaks194ji1fgzmp13y942g10pbn9m7kgkqg4h"; + }; + + buildInputs = [ + ocaml + dune + findlib + ocamlbuild + ]; + + buildPhase = "dune build -p bisect_ppx-ocamlbuild"; + + inherit (dune) installPhase; + + meta = { + homepage = https://github.com/aantron/bisect_ppx; + platforms = ocaml.meta.platforms or []; + description = "Code coverage for OCaml"; + license = stdenv.lib.licenses.mpl20; + }; +} diff --git a/pkgs/development/ocaml-modules/bisect_ppx/default.nix b/pkgs/development/ocaml-modules/bisect_ppx/default.nix new file mode 100644 index 000000000000..7b39cd1968f0 --- /dev/null +++ b/pkgs/development/ocaml-modules/bisect_ppx/default.nix @@ -0,0 +1,33 @@ +{ stdenv, fetchFromGitHub, ocaml, dune, findlib, ocaml-migrate-parsetree, ppx_tools_versioned }: + +let version = "1.4.0"; in + +stdenv.mkDerivation { + name = "ocaml${ocaml.version}-bisect_ppx-${version}"; + + src = fetchFromGitHub { + owner = "aantron"; + repo = "bisect_ppx"; + rev = version; + sha256 = "1plhm4pvrhpapz5zaks194ji1fgzmp13y942g10pbn9m7kgkqg4h"; + }; + + buildInputs = [ + ocaml + dune + findlib + ocaml-migrate-parsetree + ppx_tools_versioned + ]; + + buildPhase = "dune build -p bisect_ppx"; + + inherit (dune) installPhase; + + meta = { + homepage = https://github.com/aantron/bisect_ppx; + platforms = ocaml.meta.platforms or []; + description = "Code coverage for OCaml"; + license = stdenv.lib.licenses.mpl20; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index cf06b52c5ba0..7d03651eac91 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -131,6 +131,9 @@ let bin_prot_p4 = callPackage ../development/ocaml-modules/bin_prot { }; + bisect_ppx = callPackage ../development/ocaml-modules/bisect_ppx { }; + bisect_ppx-ocamlbuild = callPackage ../development/ocaml-modules/bisect_ppx-ocamlbuild { }; + ocaml_cairo = callPackage ../development/ocaml-modules/ocaml-cairo { }; cairo2 = callPackage ../development/ocaml-modules/cairo2 { }; From 54ed86852e921948cbd35bc7e228ebfca38c4d47 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Sat, 1 Dec 2018 17:45:37 +0100 Subject: [PATCH 2/3] Switch to buildDunePackage, and remove redundancies --- .../bisect_ppx-ocamlbuild/default.nix | 35 +++---------------- .../ocaml-modules/bisect_ppx/default.nix | 19 +++------- 2 files changed, 10 insertions(+), 44 deletions(-) diff --git a/pkgs/development/ocaml-modules/bisect_ppx-ocamlbuild/default.nix b/pkgs/development/ocaml-modules/bisect_ppx-ocamlbuild/default.nix index e4d5c22c187f..602956ee760d 100644 --- a/pkgs/development/ocaml-modules/bisect_ppx-ocamlbuild/default.nix +++ b/pkgs/development/ocaml-modules/bisect_ppx-ocamlbuild/default.nix @@ -1,32 +1,7 @@ -{ stdenv, fetchFromGitHub, ocaml, dune, findlib, ocamlbuild }: +{ buildDunePackage, bisect_ppx, ocamlbuild }: -let version = "1.4.0"; in - -stdenv.mkDerivation { - name = "ocaml${ocaml.version}-bisect_ppx-ocamlbuild-${version}"; - - src = fetchFromGitHub { - owner = "aantron"; - repo = "bisect_ppx"; - rev = version; - sha256 = "1plhm4pvrhpapz5zaks194ji1fgzmp13y942g10pbn9m7kgkqg4h"; - }; - - buildInputs = [ - ocaml - dune - findlib - ocamlbuild - ]; - - buildPhase = "dune build -p bisect_ppx-ocamlbuild"; - - inherit (dune) installPhase; - - meta = { - homepage = https://github.com/aantron/bisect_ppx; - platforms = ocaml.meta.platforms or []; - description = "Code coverage for OCaml"; - license = stdenv.lib.licenses.mpl20; - }; +buildDunePackage rec { + inherit (bisect_ppx) version src meta; + pname = "bisect_ppx-ocamlbuild"; + buildInputs = [ ocamlbuild ]; } diff --git a/pkgs/development/ocaml-modules/bisect_ppx/default.nix b/pkgs/development/ocaml-modules/bisect_ppx/default.nix index 7b39cd1968f0..9999cd06fcae 100644 --- a/pkgs/development/ocaml-modules/bisect_ppx/default.nix +++ b/pkgs/development/ocaml-modules/bisect_ppx/default.nix @@ -1,9 +1,8 @@ -{ stdenv, fetchFromGitHub, ocaml, dune, findlib, ocaml-migrate-parsetree, ppx_tools_versioned }: +{ stdenv, fetchFromGitHub, buildDunePackage, ocaml-migrate-parsetree, ppx_tools_versioned }: -let version = "1.4.0"; in - -stdenv.mkDerivation { - name = "ocaml${ocaml.version}-bisect_ppx-${version}"; +buildDunePackage rec { + pname = "bisect_ppx"; + version = "1.4.0"; src = fetchFromGitHub { owner = "aantron"; @@ -13,21 +12,13 @@ stdenv.mkDerivation { }; buildInputs = [ - ocaml - dune - findlib ocaml-migrate-parsetree ppx_tools_versioned ]; - buildPhase = "dune build -p bisect_ppx"; - - inherit (dune) installPhase; - meta = { - homepage = https://github.com/aantron/bisect_ppx; - platforms = ocaml.meta.platforms or []; description = "Code coverage for OCaml"; license = stdenv.lib.licenses.mpl20; + homepage = https://github.com/aantron/bisect_ppx; }; } From 6ca50c3deb65eef9f9f0a91e82ddc0e17cc0115a Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Sat, 1 Dec 2018 23:47:39 +0100 Subject: [PATCH 3/3] bisect_ppx-ocamlbuild: Propagate ocamlbuild --- .../development/ocaml-modules/bisect_ppx-ocamlbuild/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/ocaml-modules/bisect_ppx-ocamlbuild/default.nix b/pkgs/development/ocaml-modules/bisect_ppx-ocamlbuild/default.nix index 602956ee760d..fd3e7d58ae31 100644 --- a/pkgs/development/ocaml-modules/bisect_ppx-ocamlbuild/default.nix +++ b/pkgs/development/ocaml-modules/bisect_ppx-ocamlbuild/default.nix @@ -3,5 +3,5 @@ buildDunePackage rec { inherit (bisect_ppx) version src meta; pname = "bisect_ppx-ocamlbuild"; - buildInputs = [ ocamlbuild ]; + propagatedBuildInputs = [ ocamlbuild ]; }