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`).
This commit is contained in:
sternenseemann 2017-02-18 22:54:02 +01:00 committed by Vincent Laporte
parent 6c37a92b2b
commit 8352e0b38c
5 changed files with 49 additions and 20 deletions

View File

@ -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;

View File

@ -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 ];
};
}

View File

@ -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;

View File

@ -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 /";

View File

@ -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 { };