From 9114b4731454cbbe547b8a0279b5084a672e6064 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 28 May 2018 05:50:12 +0000 Subject: [PATCH 01/16] ocamlPackages.gg: use opaline --- pkgs/development/ocaml-modules/gg/default.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/development/ocaml-modules/gg/default.nix b/pkgs/development/ocaml-modules/gg/default.nix index 0839ff361ae..0c80f39d9d7 100644 --- a/pkgs/development/ocaml-modules/gg/default.nix +++ b/pkgs/development/ocaml-modules/gg/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam }: +{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opaline }: let inherit (stdenv.lib) getVersion versionAtLeast; @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { sha256 = "0czj41sr8jsivl3z8wyblf9k971j3kx2wc3s0c1nhzcc8allg9i2"; }; - buildInputs = [ ocaml findlib ocamlbuild opam ]; + buildInputs = [ ocaml findlib ocamlbuild opaline ]; createFindlibDestdir = true; @@ -27,10 +27,7 @@ stdenv.mkDerivation rec { buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true"; - installPhase = '' - opam-installer --script --prefix=$out ${pname}.install | sh - ln -s $out/lib/${pname} $out/lib/ocaml/${getVersion ocaml}/site-lib/${pname} - ''; + installPhase = "opaline -libdir $OCAMLFIND_DESTDIR"; meta = with stdenv.lib; { description = "Basic types for computer graphics in OCaml"; From 853fb4598fcc96c7f27c795332d49292f871edcd Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 28 May 2018 06:08:03 +0000 Subject: [PATCH 02/16] ocamlPackages.uchar: use opaline --- pkgs/development/ocaml-modules/uchar/default.nix | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/pkgs/development/ocaml-modules/uchar/default.nix b/pkgs/development/ocaml-modules/uchar/default.nix index 6b27f00fb15..8fddf883da5 100644 --- a/pkgs/development/ocaml-modules/uchar/default.nix +++ b/pkgs/development/ocaml-modules/uchar/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, ocaml, ocamlbuild, opam }: +{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opaline }: stdenv.mkDerivation { name = "ocaml${ocaml.version}-uchar-0.0.2"; @@ -9,15 +9,9 @@ stdenv.mkDerivation { }; unpackCmd = "tar xjf $src"; - buildInputs = [ ocaml ocamlbuild opam ]; + buildInputs = [ ocaml ocamlbuild findlib opaline ]; buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true"; - installPhase = '' - opam-installer --script --prefix=$out uchar.install > install.sh - sh install.sh - mkdir -p $out/lib/ocaml/${ocaml.version}/site-lib/ - ln -s $out/lib/uchar $out/lib/ocaml/${ocaml.version}/site-lib/ - ''; - + installPhase = "opaline -libdir $OCAMLFIND_DESTDIR"; meta = { description = "Compatibility library for OCaml’s Uchar module"; From c066d9dfc3c3848036ee6ea6c90622de006215b3 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 28 May 2018 06:12:16 +0000 Subject: [PATCH 03/16] ocamlPackages.topkg: use opaline --- pkgs/development/ocaml-modules/topkg/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/topkg/default.nix b/pkgs/development/ocaml-modules/topkg/default.nix index 9a655e05513..3ff641ff93e 100644 --- a/pkgs/development/ocaml-modules/topkg/default.nix +++ b/pkgs/development/ocaml-modules/topkg/default.nix @@ -5,7 +5,7 @@ The `buildPhase` and `installPhase` attributes can be reused directly in many cases. When more fine-grained control on how to run the “topkg” build system is required, the attribute `run` can be used. */ -{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, result, opam }: +{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, result, opaline }: if !stdenv.lib.versionAtLeast ocaml.version "4.01" then throw "topkg is not available for OCaml ${ocaml.version}" @@ -35,7 +35,7 @@ stdenv.mkDerivation rec { unpackCmd = "tar xjf ${src}"; buildPhase = "${run} build"; createFindlibDestdir = true; - installPhase = "${opam}/bin/opam-installer -i --prefix=$out --libdir=$OCAMLFIND_DESTDIR"; + installPhase = "${opaline}/bin/opaline -prefix $out -libdir $OCAMLFIND_DESTDIR"; passthru = { inherit run; }; From 29a6ca660af6bcc20c87b6b4b88510016551d676 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 28 May 2018 06:12:33 +0000 Subject: [PATCH 04/16] jbuilder: use opaline --- pkgs/development/tools/ocaml/jbuilder/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/ocaml/jbuilder/default.nix b/pkgs/development/tools/ocaml/jbuilder/default.nix index 38fd4323d5c..abfcdb61c1e 100644 --- a/pkgs/development/tools/ocaml/jbuilder/default.nix +++ b/pkgs/development/tools/ocaml/jbuilder/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, ocaml, opam }: +{ stdenv, fetchFromGitHub, ocamlPackages, opaline }: stdenv.mkDerivation rec { name = "jbuilder-${version}"; @@ -10,11 +10,11 @@ stdenv.mkDerivation rec { sha256 = "0571lzm8caq6wnia7imgy4a27x5l2bvxiflg0jrwwml0ylnii65f"; }; - buildInputs = [ ocaml ]; + buildInputs = with ocamlPackages; [ ocaml findlib ]; dontAddPrefix = true; - installPhase = "${opam}/bin/opam-installer -i --prefix=$out --libdir=$OCAMLFIND_DESTDIR"; + installPhase = "${opaline}/bin/opaline -prefix $out -libdir $OCAMLFIND_DESTDIR"; preFixup = "rm -rf $out/jbuilder"; @@ -23,6 +23,6 @@ stdenv.mkDerivation rec { description = "Fast, portable and opinionated build system"; maintainers = [ stdenv.lib.maintainers.vbgl ]; license = stdenv.lib.licenses.asl20; - inherit (ocaml.meta) platforms; + inherit (ocamlPackages.ocaml.meta) platforms; }; } From 8e0100ba8516a4c0bd7bafa49ccd5673bcadfbfb Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 28 May 2018 06:50:17 +0000 Subject: [PATCH 05/16] ocamlPackages.ppx_import: use opaline --- pkgs/development/ocaml-modules/ppx_import/default.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/development/ocaml-modules/ppx_import/default.nix b/pkgs/development/ocaml-modules/ppx_import/default.nix index 991af1e41de..3948cfce0e8 100644 --- a/pkgs/development/ocaml-modules/ppx_import/default.nix +++ b/pkgs/development/ocaml-modules/ppx_import/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchFromGitHub, buildOcaml, ocaml, opam, +{stdenv, fetchFromGitHub, buildOcaml, ocaml, opaline, cppo, ppx_tools, ounit, ppx_deriving}: buildOcaml rec { @@ -15,15 +15,12 @@ buildOcaml rec { sha256 = "14c2lp7r9080c4hsb1y1drbxxx3v44b7ib5wfh3kkh3f1jfsjwbk"; }; - buildInputs = [ cppo ounit ppx_deriving opam ]; + buildInputs = [ cppo ounit ppx_deriving opaline ]; doCheck = true; checkTarget = "test"; - installPhase = '' - opam-installer --script --prefix=$out ppx_import.install | sh - ln -s $out/lib/ppx_import $out/lib/ocaml/${ocaml.version}/site-lib - ''; + installPhase = "opaline -prefix $out -libdir $OCAMLFIND_DESTDIR"; meta = with stdenv.lib; { description = "A syntax extension that allows to pull in types or signatures from other compiled interface files"; From e7795ce53e6e7fff4c5b43b29ff4b682ea8d563d Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 28 May 2018 06:52:45 +0000 Subject: [PATCH 06/16] ocamlPackages.reactivedata: use opaline --- pkgs/development/ocaml-modules/reactivedata/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/ocaml-modules/reactivedata/default.nix b/pkgs/development/ocaml-modules/reactivedata/default.nix index 1f1781f5a65..fa85f217468 100644 --- a/pkgs/development/ocaml-modules/reactivedata/default.nix +++ b/pkgs/development/ocaml-modules/reactivedata/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, react, opam }: +{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, react, opaline }: assert stdenv.lib.versionAtLeast ocaml.version "3.11"; @@ -9,12 +9,12 @@ stdenv.mkDerivation { sha256 = "0wcs0z50nia1cpk8mh6i5qbc6sff9cc8x7s7q1q89d7m73bnv4vf"; }; - buildInputs = [ ocaml findlib ocamlbuild opam ]; + buildInputs = [ ocaml findlib ocamlbuild opaline ]; propagatedBuildInputs = [ react ]; buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true"; - installPhase = "opam-installer -i --prefix=$out --libdir=$OCAMLFIND_DESTDIR"; + installPhase = "opaline -prefix $out -libdir $OCAMLFIND_DESTDIR"; meta = with stdenv.lib; { description = "An OCaml module for functional reactive programming (FRP) based on React"; From cb5d4c1205d432b1098d59633cf73ebc23f31548 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 28 May 2018 07:35:51 +0000 Subject: [PATCH 07/16] ocamlPackages.eliom: use opaline --- pkgs/development/ocaml-modules/eliom/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/ocaml-modules/eliom/default.nix b/pkgs/development/ocaml-modules/eliom/default.nix index da9383c4e95..8b304aadd9e 100644 --- a/pkgs/development/ocaml-modules/eliom/default.nix +++ b/pkgs/development/ocaml-modules/eliom/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, which, ocsigen_server, ocsigen_deriving, ocaml, camlp4, js_of_ocaml, lwt_react, cryptokit, ipaddr, ocamlnet, lwt_ssl, ocaml_pcre, - opam, ppx_tools, ppx_deriving, findlib + opaline, ppx_tools, ppx_deriving, findlib , js_of_ocaml-ocamlbuild, js_of_ocaml-ppx, js_of_ocaml-ppx_deriving_json , js_of_ocaml-lwt , js_of_ocaml-tyxml @@ -22,7 +22,7 @@ stdenv.mkDerivation rec patches = [ ./camlp4.patch ]; - buildInputs = [ ocaml which findlib js_of_ocaml-ocamlbuild js_of_ocaml-ppx_deriving_json opam ppx_tools + buildInputs = [ ocaml which findlib js_of_ocaml-ocamlbuild js_of_ocaml-ppx_deriving_json opaline ppx_tools ocsigen_deriving ]; @@ -40,7 +40,7 @@ stdenv.mkDerivation rec ppx_deriving ]; - installPhase = "opam-installer -i --prefix=$out --libdir=$OCAMLFIND_DESTDIR"; + installPhase = "opaline -prefix $out -libdir $OCAMLFIND_DESTDIR"; setupHook = [ ./setup-hook.sh ]; From 69ac6be0096c15b0a2f60b788aac00dc99ccce1c Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Tue, 29 May 2018 05:15:32 +0000 Subject: [PATCH 08/16] ocamlPackages.ocsigen-toolkit: use opaline --- pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix b/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix index 556c343241c..37c8c8f76c9 100644 --- a/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix +++ b/pkgs/development/ocaml-modules/ocsigen-toolkit/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, buildOcaml, ocaml, opam +{ stdenv, fetchurl, buildOcaml, ocaml, opaline , calendar, eliom, js_of_ocaml-ppx_deriving_json }: @@ -8,13 +8,13 @@ buildOcaml rec version = "1.1.0"; propagatedBuildInputs = [ calendar eliom js_of_ocaml-ppx_deriving_json ]; - buildInputs = [ opam ]; + buildInputs = [ opaline ]; installPhase = '' export OCAMLPATH=$out/lib/ocaml/${ocaml.version}/site-lib/:$OCAMLPATH make install - opam-installer --prefix=$out + opaline -prefix $out ''; src = fetchurl { From 535a8b000f7f7538de70f8441c56316c51355451 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Tue, 29 May 2018 05:26:45 +0000 Subject: [PATCH 09/16] ocamlPackages.buildOcamlJane: use opaline --- .../ocaml-modules/janestreet/buildOcamlJane.nix | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix b/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix index 61b2038bfd2..fdb0d8034e6 100644 --- a/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix +++ b/pkgs/development/ocaml-modules/janestreet/buildOcamlJane.nix @@ -1,4 +1,4 @@ -{ buildOcaml, opam, js_build_tools, ocaml_oasis, fetchurl } : +{ buildOcaml, opaline, js_build_tools, ocaml_oasis, fetchurl } : { name, version ? "113.33.03", buildInputs ? [], hash ? "", @@ -14,7 +14,7 @@ buildOcaml (args // { hasSharedObjects = true; - buildInputs = [ ocaml_oasis js_build_tools opam ] ++ buildInputs; + buildInputs = [ ocaml_oasis js_build_tools opaline ] ++ buildInputs; dontAddPrefix = true; @@ -22,14 +22,6 @@ buildOcaml (args // { buildPhase = "OCAML_TOPLEVEL_PATH=`ocamlfind query findlib`/.. make"; - installPhase = '' - opam-installer -i --prefix $prefix --libdir `ocamlfind printconf destdir` --stubsdir `ocamlfind printconf destdir`/${name} ${name}.install - if [ -d $out/lib/${name} ] - then if [ "$(ls -A $out/lib/${name})" ] - then mv $out/lib/${name}/* `ocamlfind printconf destdir`/${name} - fi - rmdir $out/lib/${name} - fi - ''; + installPhase = "opaline -prefix $prefix -libdir $OCAMLFIND_DESTDIR ${name}.install"; }) From 733d88574b46b666648140c3505f32fc5cc6acec Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Tue, 29 May 2018 05:27:27 +0000 Subject: [PATCH 10/16] ocamlPackages.js-build-tools: use opaline --- .../development/ocaml-modules/janestreet/js-build-tools.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix b/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix index 2c314f3dbde..f77b793bcaa 100644 --- a/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix +++ b/pkgs/development/ocaml-modules/janestreet/js-build-tools.nix @@ -1,4 +1,4 @@ -{ stdenv, buildOcaml, fetchurl, ocaml_oasis, opam }: +{ stdenv, buildOcaml, fetchurl, ocaml_oasis, opaline }: buildOcaml rec { name = "js-build-tools"; @@ -13,11 +13,11 @@ buildOcaml rec { hasSharedObjects = true; - buildInputs = [ ocaml_oasis opam ]; + buildInputs = [ ocaml_oasis opaline ]; dontAddPrefix = true; configurePhase = "./configure --prefix $prefix"; - installPhase = "opam-installer -i --prefix $prefix --libdir `ocamlfind printconf destdir` ${name}.install"; + installPhase = "opaline -prefix $prefix -libdir $OCAMLFIND_DESTDIR ${name}.install"; patches = [ ./js-build-tools-darwin.patch ]; From 94445ed4bc4229d8bc40076f0d77ff265138c3c9 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Tue, 29 May 2018 05:28:04 +0000 Subject: [PATCH 11/16] ocamlPackages.findlib: fix stublibs --- pkgs/development/tools/ocaml/findlib/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/tools/ocaml/findlib/default.nix b/pkgs/development/tools/ocaml/findlib/default.nix index e25b94714b6..18b84e2c961 100644 --- a/pkgs/development/tools/ocaml/findlib/default.nix +++ b/pkgs/development/tools/ocaml/findlib/default.nix @@ -50,8 +50,8 @@ stdenv.mkDerivation rec { if test -d "''$1/lib/ocaml/${ocaml.version}/site-lib"; then export OCAMLPATH="''${OCAMLPATH}''${OCAMLPATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/" fi - if test -d "''$1/lib/ocaml/${ocaml.version}/site-lib/stubslibs"; then - export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/stubslibs" + if test -d "''$1/lib/ocaml/${ocaml.version}/site-lib/stublibs"; then + export CAML_LD_LIBRARY_PATH="''${CAML_LD_LIBRARY_PATH}''${CAML_LD_LIBRARY_PATH:+:}''$1/lib/ocaml/${ocaml.version}/site-lib/stublibs" fi export OCAMLFIND_DESTDIR="''$out/lib/ocaml/${ocaml.version}/site-lib/" if test -n "$createFindlibDestdir"; then From 98e8e95136d3e89fd46c03899aebef10d7e55ee1 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sat, 2 Jun 2018 14:54:51 +0000 Subject: [PATCH 12/16] ocamlPackages.nocrypto: use opaline --- pkgs/development/ocaml-modules/nocrypto/default.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkgs/development/ocaml-modules/nocrypto/default.nix b/pkgs/development/ocaml-modules/nocrypto/default.nix index cfe3f37800d..6e68c87b5ff 100644 --- a/pkgs/development/ocaml-modules/nocrypto/default.nix +++ b/pkgs/development/ocaml-modules/nocrypto/default.nix @@ -22,10 +22,7 @@ stdenv.mkDerivation rec { ppx_sexp_conv ]; propagatedBuildInputs = [ cstruct zarith sexplib ] ++ optional withLwt cstruct-lwt; - buildPhase = '' - LD_LIBRARY_PATH=${cpuid}/lib/ocaml/${ocaml.version}/site-lib/stubslibs/ \ - ${topkg.buildPhase} --with-lwt ${boolToString withLwt} - ''; + buildPhase = "${topkg.buildPhase} --with-lwt ${boolToString withLwt}"; inherit (topkg) installPhase; meta = { From 10d70a2ae3e20ae8e578212b4cc92b453445d8ca Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sat, 2 Jun 2018 14:55:23 +0000 Subject: [PATCH 13/16] ocamlPackages.lambda-term: fix installPhase --- pkgs/development/ocaml-modules/lambda-term/default.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkgs/development/ocaml-modules/lambda-term/default.nix b/pkgs/development/ocaml-modules/lambda-term/default.nix index 769b80ecddc..fdd30d28ed8 100644 --- a/pkgs/development/ocaml-modules/lambda-term/default.nix +++ b/pkgs/development/ocaml-modules/lambda-term/default.nix @@ -17,10 +17,7 @@ buildOcaml rec { buildPhase = "jbuilder build -p lambda-term"; - installPhase = '' - ${jbuilder.installPhase} - mv $out/lib/ocaml/${ocaml.version}/site-lib/{stubslibs,lambda-term}/dlllambda_term_stubs.so - ''; + inherit (jbuilder) installPhase; hasSharedObjects = true; From a4fa4c45cc7f0d2057729f0103a1600de32d642d Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sat, 2 Jun 2018 14:55:47 +0000 Subject: [PATCH 14/16] ocamlPackages.cmdliner_0_9: use opaline --- pkgs/development/ocaml-modules/cmdliner/0.9.nix | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pkgs/development/ocaml-modules/cmdliner/0.9.nix b/pkgs/development/ocaml-modules/cmdliner/0.9.nix index e8824f31807..345d56d2170 100644 --- a/pkgs/development/ocaml-modules/cmdliner/0.9.nix +++ b/pkgs/development/ocaml-modules/cmdliner/0.9.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam }: +{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opaline }: let pname = "cmdliner"; @@ -17,17 +17,12 @@ stdenv.mkDerivation rec { }; unpackCmd = "tar xjf $src"; - nativeBuildInputs = [ ocamlbuild opam ]; + nativeBuildInputs = [ ocamlbuild opaline ]; buildInputs = [ ocaml findlib ]; - createFindlibDestdir = true; - configurePhase = "ocaml pkg/git.ml"; buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true"; - installPhase = '' - opam-installer --script --prefix=$out | sh - ln -s $out/lib/${pname} $out/lib/ocaml/${ocaml.version}/site-lib/ - ''; + installPhase = "opaline -libdir $OCAMLFIND_DESTDIR"; meta = with stdenv.lib; { homepage = http://erratique.ch/software/cmdliner; From 2e851f96519f999d5e645ca556193353f2d39186 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 4 Jun 2018 18:28:12 +0000 Subject: [PATCH 15/16] ocamlPackages.xmlm: remove at 1.2.0 --- .../ocaml-modules/xmlm/default.nix | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/pkgs/development/ocaml-modules/xmlm/default.nix b/pkgs/development/ocaml-modules/xmlm/default.nix index 9d3a0b1bb4d..a1765296d57 100644 --- a/pkgs/development/ocaml-modules/xmlm/default.nix +++ b/pkgs/development/ocaml-modules/xmlm/default.nix @@ -4,38 +4,24 @@ let webpage = "http://erratique.ch/software/${pname}"; in -assert stdenv.lib.versionAtLeast ocaml.version "3.12"; - -let param = - if stdenv.lib.versionAtLeast ocaml.version "4.02" - then { - version = "1.3.0"; - sha256 = "1rrdxg5kh9zaqmgapy9bhdqyxbbvxxib3bdfg1vhw4rrkp1z0x8n"; - buildInputs = [ topkg ]; - inherit (topkg) buildPhase; - } else { - version = "1.2.0"; - sha256 = "1jywcrwn5z3gkgvicr004cxmdaqfmq8wh72f81jqz56iyn5024nh"; - buildInputs = []; - buildPhase = "./pkg/build true"; - }; -in +if !stdenv.lib.versionAtLeast ocaml.version "4.02" +then throw "xmlm is not available for OCaml ${ocaml.version}" +else stdenv.mkDerivation rec { - name = "ocaml-${pname}-${version}"; - inherit (param) version; + name = "ocaml${ocaml.version}-${pname}-${version}"; + version = "1.3.0"; src = fetchurl { url = "${webpage}/releases/${pname}-${version}.tbz"; - inherit (param) sha256; + sha256 = "1rrdxg5kh9zaqmgapy9bhdqyxbbvxxib3bdfg1vhw4rrkp1z0x8n"; }; - buildInputs = [ ocaml findlib ocamlbuild ] ++ param.buildInputs; + buildInputs = [ ocaml findlib ocamlbuild topkg ]; unpackCmd = "tar xjf $src"; - inherit (param) buildPhase; - inherit (topkg) installPhase; + inherit (topkg) buildPhase installPhase; meta = with stdenv.lib; { description = "An OCaml streaming codec to decode and encode the XML data format"; From 07d40825d8ef020f6dd10aa5c64caf395b76799e Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Wed, 6 Jun 2018 07:13:50 +0000 Subject: [PATCH 16/16] ocamlPackages.mstruct: remove spurious dependency --- pkgs/development/ocaml-modules/mstruct/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/ocaml-modules/mstruct/default.nix b/pkgs/development/ocaml-modules/mstruct/default.nix index 5aa57ba8fbb..5682b75d6a1 100644 --- a/pkgs/development/ocaml-modules/mstruct/default.nix +++ b/pkgs/development/ocaml-modules/mstruct/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, ocaml, findlib, jbuilder, opam +{ stdenv, fetchFromGitHub, ocaml, findlib, jbuilder , cstruct }: @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { sha256 = "1p4ygwzs3n1fj4apfib0z0sabpph21bkq1dgjk4bsa59pq4prncm"; }; - buildInputs = [ ocaml findlib jbuilder opam ]; + buildInputs = [ ocaml findlib jbuilder ]; propagatedBuildInputs = [ cstruct ];