From 3a10042c81ca28996978b91608a900344a551e14 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sat, 6 Apr 2019 13:17:37 +0000 Subject: [PATCH] ocamlPackages.base64: 2.0.0 -> 3.2.0 Keep the legacy version under attribute `base64_2` --- pkgs/development/ocaml-modules/base64/2.0.nix | 24 +++++++++++++++++++ .../ocaml-modules/base64/default.nix | 22 +++++++++-------- pkgs/top-level/ocaml-packages.nix | 17 ++++++++++--- 3 files changed, 50 insertions(+), 13 deletions(-) create mode 100644 pkgs/development/ocaml-modules/base64/2.0.nix diff --git a/pkgs/development/ocaml-modules/base64/2.0.nix b/pkgs/development/ocaml-modules/base64/2.0.nix new file mode 100644 index 000000000000..8128dc1cb6f5 --- /dev/null +++ b/pkgs/development/ocaml-modules/base64/2.0.nix @@ -0,0 +1,24 @@ +{ stdenv, fetchzip, ocaml, findlib, ocamlbuild }: + +let version = "2.0.0"; in + +stdenv.mkDerivation { + name = "ocaml-base64-${version}"; + + src = fetchzip { + url = "https://github.com/mirage/ocaml-base64/archive/v${version}.tar.gz"; + sha256 = "1nv55gwq5vaxmrcz9ja2s165b1p9fhcxszc1l76043gpa56qm4fs"; + }; + + buildInputs = [ ocaml findlib ocamlbuild ]; + + createFindlibDestdir = true; + + meta = { + homepage = https://github.com/mirage/ocaml-base64; + platforms = ocaml.meta.platforms or []; + description = "Base64 encoding and decoding in OCaml"; + license = stdenv.lib.licenses.isc; + maintainers = with stdenv.lib.maintainers; [ vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/base64/default.nix b/pkgs/development/ocaml-modules/base64/default.nix index 8128dc1cb6f5..2633d43c1045 100644 --- a/pkgs/development/ocaml-modules/base64/default.nix +++ b/pkgs/development/ocaml-modules/base64/default.nix @@ -1,24 +1,26 @@ -{ stdenv, fetchzip, ocaml, findlib, ocamlbuild }: +{ lib, fetchzip, buildDunePackage, alcotest, bos }: -let version = "2.0.0"; in +let version = "3.2.0"; in -stdenv.mkDerivation { - name = "ocaml-base64-${version}"; +buildDunePackage { + pname = "base64"; + inherit version; src = fetchzip { url = "https://github.com/mirage/ocaml-base64/archive/v${version}.tar.gz"; - sha256 = "1nv55gwq5vaxmrcz9ja2s165b1p9fhcxszc1l76043gpa56qm4fs"; + sha256 = "1ilw3zj0w6cq7i4pvr8m2kv5l5f2y9aldmv72drlwwns013b1gwy"; }; - buildInputs = [ ocaml findlib ocamlbuild ]; + minimumOCamlVersion = "4.03"; - createFindlibDestdir = true; + buildInputs = [ alcotest bos ]; + + doCheck = true; meta = { homepage = https://github.com/mirage/ocaml-base64; - platforms = ocaml.meta.platforms or []; description = "Base64 encoding and decoding in OCaml"; - license = stdenv.lib.licenses.isc; - maintainers = with stdenv.lib.maintainers; [ vbgl ]; + license = lib.licenses.isc; + maintainers = with lib.maintainers; [ vbgl ]; }; } diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 68e7fde3a521..f79f6ea3c0ca 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -53,6 +53,8 @@ let atdgen = callPackage ../development/ocaml-modules/atdgen { }; + base64_2 = callPackage ../development/ocaml-modules/base64/2.0.nix { }; + base64 = callPackage ../development/ocaml-modules/base64 { }; bap = callPackage ../development/ocaml-modules/bap { @@ -144,12 +146,15 @@ let cmdliner = callPackage ../development/ocaml-modules/cmdliner { }; cohttp_p4 = callPackage ../development/ocaml-modules/cohttp/0.19.3.nix { + base64 = base64_2; lwt = lwt2; }; cohttp = if lib.versionOlder "4.03" ocaml.version - then callPackage ../development/ocaml-modules/cohttp { } + then callPackage ../development/ocaml-modules/cohttp { + base64 = base64_2; + } else cohttp_p4; cohttp-lwt = callPackage ../development/ocaml-modules/cohttp/lwt.nix { }; @@ -337,7 +342,10 @@ let then callPackage ../development/tools/ocaml/js_of_ocaml/3.0.nix { } else js_of_ocaml_2; - js_of_ocaml_2 = callPackage ../development/tools/ocaml/js_of_ocaml { lwt = lwt2; }; + js_of_ocaml_2 = callPackage ../development/tools/ocaml/js_of_ocaml { + base64 = base64_2; + lwt = lwt2; + }; js_of_ocaml-camlp4 = callPackage ../development/tools/ocaml/js_of_ocaml/camlp4.nix {}; @@ -574,7 +582,10 @@ let ounit = callPackage ../development/ocaml-modules/ounit { }; - piqi = callPackage ../development/ocaml-modules/piqi { }; + piqi = callPackage ../development/ocaml-modules/piqi { + base64 = base64_2; + }; + piqi-ocaml = callPackage ../development/ocaml-modules/piqi-ocaml { }; ppxfind = callPackage ../development/ocaml-modules/ppxfind { };