From 8352e0b38c65a736219619d8821ad50f787e58d1 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 18 Feb 2017 22:54:02 +0100 Subject: [PATCH] ocaml-ipaddr: 2.6.1 -> 2.7.2 Keeps the legacy version under attribute `ipaddr_p4`; it is needed for OCaml < 4.02 and some libraries (eg `conduit`). --- .../ocaml-modules/conduit/default.nix | 4 +-- .../ocaml-modules/ipaddr/2.6.1.nix | 32 +++++++++++++++++++ .../ocaml-modules/ipaddr/default.nix | 22 ++++--------- .../ocaml-modules/ocsigen-server/default.nix | 4 +-- pkgs/top-level/ocaml-packages.nix | 7 +++- 5 files changed, 49 insertions(+), 20 deletions(-) create mode 100644 pkgs/development/ocaml-modules/ipaddr/2.6.1.nix diff --git a/pkgs/development/ocaml-modules/conduit/default.nix b/pkgs/development/ocaml-modules/conduit/default.nix index 22c74d7f92e5..d1da95ffaa1c 100644 --- a/pkgs/development/ocaml-modules/conduit/default.nix +++ b/pkgs/development/ocaml-modules/conduit/default.nix @@ -1,4 +1,4 @@ -{ stdenv, buildOcaml, fetchurl, ocaml, sexplib_p4, stringext, uri_p4, cstruct, ipaddr +{ stdenv, buildOcaml, fetchurl, ocaml, sexplib_p4, stringext, uri_p4, cstruct, ipaddr_p4 , asyncSupport ? stdenv.lib.versionAtLeast ocaml.version "4.02" , async_p4 ? null, async_ssl_p4 ? null, lwt ? null }: @@ -12,7 +12,7 @@ buildOcaml rec { sha256 = "5cf1a46aa0254345e5143feebe6b54bdef96314e9987f44e69f24618d620faa1"; }; - propagatedBuildInputs = [ sexplib_p4 stringext uri_p4 cstruct ipaddr ]; + propagatedBuildInputs = [ sexplib_p4 stringext uri_p4 cstruct ipaddr_p4 ]; buildInputs = stdenv.lib.optional (lwt != null) lwt ++ stdenv.lib.optional (asyncSupport && async_p4 != null) async_p4 ++ stdenv.lib.optional (asyncSupport && async_ssl_p4 != null) async_ssl_p4; diff --git a/pkgs/development/ocaml-modules/ipaddr/2.6.1.nix b/pkgs/development/ocaml-modules/ipaddr/2.6.1.nix new file mode 100644 index 000000000000..cdc273d6ecfd --- /dev/null +++ b/pkgs/development/ocaml-modules/ipaddr/2.6.1.nix @@ -0,0 +1,32 @@ +{stdenv, buildOcaml, fetchurl, sexplib_p4}: + +buildOcaml rec { + name = "ipaddr"; + version = "2.6.1"; + + src = fetchurl { + url = "https://github.com/mirage/ocaml-ipaddr/archive/${version}.tar.gz"; + sha256 = "7051013d8f58abff433187d70cd7ddd7a6b49a6fbe6cad1893f571f65b8ed3d0"; + }; + + propagatedBuildInputs = [ sexplib_p4 ]; + + configurePhase = '' + ocaml setup.ml -configure --prefix $out + ''; + + buildPhase = '' + make build + ''; + + installPhase = '' + make install + ''; + + meta = with stdenv.lib; { + homepage = https://github.com/mirage/ocaml-ipaddr; + description = "A library for manipulation of IP (and MAC) address representations "; + license = licenses.mit; + maintainers = [ maintainers.ericbmerritt ]; + }; +} diff --git a/pkgs/development/ocaml-modules/ipaddr/default.nix b/pkgs/development/ocaml-modules/ipaddr/default.nix index cdc273d6ecfd..0b561ab6d695 100644 --- a/pkgs/development/ocaml-modules/ipaddr/default.nix +++ b/pkgs/development/ocaml-modules/ipaddr/default.nix @@ -1,27 +1,19 @@ -{stdenv, buildOcaml, fetchurl, sexplib_p4}: +{ stdenv, buildOcaml, fetchurl, ocamlbuild, findlib +, topkg, sexplib, ppx_sexp_conv, opam }: buildOcaml rec { name = "ipaddr"; - version = "2.6.1"; + version = "2.7.2"; src = fetchurl { url = "https://github.com/mirage/ocaml-ipaddr/archive/${version}.tar.gz"; - sha256 = "7051013d8f58abff433187d70cd7ddd7a6b49a6fbe6cad1893f571f65b8ed3d0"; + sha256 = "0mnjw1xjr8vyn5x1nnbbxfxhs77znwrkz8c144w47zk2pc3xrh9d"; }; - propagatedBuildInputs = [ sexplib_p4 ]; + buildInputs = [ findlib ocamlbuild topkg ppx_sexp_conv opam ]; + propagatedBuildInputs = [ sexplib ]; - configurePhase = '' - ocaml setup.ml -configure --prefix $out - ''; - - buildPhase = '' - make build - ''; - - installPhase = '' - make install - ''; + inherit (topkg) buildPhase installPhase; meta = with stdenv.lib; { homepage = https://github.com/mirage/ocaml-ipaddr; diff --git a/pkgs/development/ocaml-modules/ocsigen-server/default.nix b/pkgs/development/ocaml-modules/ocsigen-server/default.nix index 5c424cfe0599..8d949497b465 100644 --- a/pkgs/development/ocaml-modules/ocsigen-server/default.nix +++ b/pkgs/development/ocaml-modules/ocsigen-server/default.nix @@ -1,6 +1,6 @@ {stdenv, fetchurl, ocaml, findlib, which, ocaml_react, ocaml_ssl, ocaml_lwt, ocamlnet, ocaml_pcre, cryptokit, tyxml, ipaddr, zlib, -libev, openssl, ocaml_sqlite3, tree, uutf, makeWrapper +libev, openssl, ocaml_sqlite3, tree, uutf, makeWrapper, camlp4 }: let mkpath = p: n: @@ -18,7 +18,7 @@ stdenv.mkDerivation { buildInputs = [ocaml which findlib ocaml_react ocaml_ssl ocaml_lwt ocamlnet ocaml_pcre cryptokit tyxml ipaddr zlib libev openssl - ocaml_sqlite3 tree uutf makeWrapper ]; + ocaml_sqlite3 tree uutf makeWrapper camlp4 ]; configureFlags = "--root $(out) --prefix /"; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index f7a91767326e..339f6eb84e38 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -202,7 +202,12 @@ let io-page = callPackage ../development/ocaml-modules/io-page { }; - ipaddr = callPackage ../development/ocaml-modules/ipaddr { }; + ipaddr_p4 = callPackage ../development/ocaml-modules/ipaddr/2.6.1.nix { }; + + ipaddr = + if lib.versionOlder "4.02" ocaml.version + then callPackage ../development/ocaml-modules/ipaddr { } + else ipaddr_p4; iso8601 = callPackage ../development/ocaml-modules/iso8601 { };