From cbfc766ad4203bf0b858084377ad91fc6c5219b1 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Thu, 17 Nov 2016 21:37:56 +0100 Subject: [PATCH 1/2] ocaml-cstruct: remove camlp4 support This change solves dependency issues related to camlp4, async_p4 and sexplib_p4 --- pkgs/development/ocaml-modules/cstruct/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/ocaml-modules/cstruct/default.nix b/pkgs/development/ocaml-modules/cstruct/default.nix index dd6cffb979c5..8c1aac4d83b2 100644 --- a/pkgs/development/ocaml-modules/cstruct/default.nix +++ b/pkgs/development/ocaml-modules/cstruct/default.nix @@ -1,5 +1,5 @@ -{ stdenv, writeText, fetchFromGitHub, ocaml, ocplib-endian, sexplib_p4, findlib, ppx_tools -, async_p4 ? null, lwt ? null, camlp4 +{ stdenv, writeText, fetchFromGitHub, ocaml, ocplib-endian, sexplib, findlib, ppx_tools +, async ? null, lwt ? null }: assert stdenv.lib.versionAtLeast ocaml.version "4.01"; @@ -22,10 +22,10 @@ stdenv.mkDerivation { inherit (param) sha256; }; - configureFlags = [ "${opt lwt}-lwt" "${opt async_p4}-async" "${opt ppx_tools}-ppx" ]; + configureFlags = [ "${opt lwt}-lwt" "${opt async}-async" "${opt ppx_tools}-ppx" ]; - buildInputs = [ ocaml findlib ppx_tools camlp4 lwt async_p4 ]; - propagatedBuildInputs = [ ocplib-endian sexplib_p4 ]; + buildInputs = [ ocaml findlib ppx_tools lwt async ]; + propagatedBuildInputs = [ ocplib-endian sexplib ]; createFindlibDestdir = true; dontStrip = true; From 86c45fc2d3a2cf2d99fa96e6d6e759535c9de0c4 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Thu, 3 Nov 2016 01:09:54 +0100 Subject: [PATCH 2/2] ocaml-nocrypto: 0.5.1 -> 0.5.3 --- .../ocaml-modules/nocrypto/default.nix | 33 ++++++++++++------- pkgs/top-level/ocaml-packages.nix | 4 ++- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/pkgs/development/ocaml-modules/nocrypto/default.nix b/pkgs/development/ocaml-modules/nocrypto/default.nix index fab048a9a9f8..d7f7ae0e3655 100644 --- a/pkgs/development/ocaml-modules/nocrypto/default.nix +++ b/pkgs/development/ocaml-modules/nocrypto/default.nix @@ -1,20 +1,30 @@ -{ stdenv, fetchzip, ocaml, findlib, cstruct, type_conv, zarith, ocaml_lwt, ounit }: +{ stdenv, buildOcaml, fetchFromGitHub, ocaml, findlib +, cstruct, zarith, ounit, ocaml_oasis, ppx_sexp_conv, sexplib +, lwt ? null}: -assert stdenv.lib.versionAtLeast ocaml.version "4.01"; +with stdenv.lib; +let withLwt = lwt != null; in -stdenv.mkDerivation rec { - name = "ocaml-nocrypto-${version}"; - version = "0.5.1"; +buildOcaml rec { + name = "nocrypto"; + version = "0.5.3"; - src = fetchzip { - url = "https://github.com/mirleft/ocaml-nocrypto/archive/${version}.tar.gz"; - sha256 = "15gffvixk12ghsfra9amfszd473c8h188zfj03ngvblbdm0d80m0"; + minimumSupportedOcamlVersion = "4.02"; + + src = fetchFromGitHub { + owner = "mirleft"; + repo = "ocaml-nocrypto"; + rev = "v${version}"; + sha256 = "0m3yvqpgfffqp15mcl08b78cv8zw25rnp6z1pkj5aimz6xg3gqbl"; }; - buildInputs = [ ocaml findlib type_conv ocaml_lwt ounit ]; - propagatedBuildInputs = [ cstruct zarith ]; + buildInputs = [ ocaml ocaml_oasis findlib ounit ppx_sexp_conv ]; + propagatedBuildInputs = [ cstruct zarith sexplib ] ++ optional withLwt lwt; + + configureFlags = [ "--enable-tests" ] ++ optional withLwt ["--enable-lwt"]; + + configurePhase = "./configure --prefix $out $configureFlags"; - configureFlags = "--enable-tests"; doCheck = true; checkTarget = "test"; createFindlibDestdir = true; @@ -22,7 +32,6 @@ stdenv.mkDerivation rec { meta = { homepage = https://github.com/mirleft/ocaml-nocrypto; description = "Simplest possible crypto to support TLS"; - platforms = ocaml.meta.platforms or []; license = stdenv.lib.licenses.bsd2; maintainers = with stdenv.lib.maintainers; [ vbgl ]; }; diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 5e694f188e9c..c7422bdaba4a 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -259,7 +259,9 @@ let mlgmp = callPackage ../development/ocaml-modules/mlgmp { }; - nocrypto = callPackage ../development/ocaml-modules/nocrypto { }; + nocrypto = callPackage ../development/ocaml-modules/nocrypto { + lwt = ocaml_lwt; + }; ocaml_batteries = callPackage ../development/ocaml-modules/batteries { };