From 8dc21739057079bdd749537dccb1fa31205ff0ff Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Mon, 21 Oct 2019 05:36:52 +0000 Subject: [PATCH] =?UTF-8?q?ocamlPackages.decompress:=200.6=20=E2=86=92=200?= =?UTF-8?q?.9.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ocamlPackages.git: 1.11.5 → 2.1.0 ocamlPackages.imagelib: 20171028 → 20191011 ocamlPackages.imagelib-unix: init --- .../ocaml-modules/checkseum/default.nix | 2 + .../ocaml-modules/decompress/default.nix | 37 +++++++++---------- .../development/ocaml-modules/git/default.nix | 19 +++++----- .../ocaml-modules/imagelib/default.nix | 25 +++++++------ .../ocaml-modules/imagelib/unix.nix | 8 ++++ pkgs/top-level/ocaml-packages.nix | 4 +- 6 files changed, 53 insertions(+), 42 deletions(-) create mode 100644 pkgs/development/ocaml-modules/imagelib/unix.nix diff --git a/pkgs/development/ocaml-modules/checkseum/default.nix b/pkgs/development/ocaml-modules/checkseum/default.nix index 0e348dd65c38..18e06d260f4e 100644 --- a/pkgs/development/ocaml-modules/checkseum/default.nix +++ b/pkgs/development/ocaml-modules/checkseum/default.nix @@ -29,6 +29,8 @@ stdenv.mkDerivation rec { inherit (dune) installPhase; + passthru = { inherit hasC; }; + meta = { homepage = "https://github.com/mirage/checkseum"; description = "ADLER-32 and CRC32C Cyclic Redundancy Check"; diff --git a/pkgs/development/ocaml-modules/decompress/default.nix b/pkgs/development/ocaml-modules/decompress/default.nix index 70ec7fd34ae1..828d3a98f9de 100644 --- a/pkgs/development/ocaml-modules/decompress/default.nix +++ b/pkgs/development/ocaml-modules/decompress/default.nix @@ -1,30 +1,27 @@ -{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, topkg +{ lib, fetchurl, buildDunePackage +, checkseum, cmdliner +, alcotest, bos, camlzip, mmap, re }: -if !stdenv.lib.versionAtLeast ocaml.version "4.03" -then throw "decompress is not available for OCaml ${ocaml.version}" -else +buildDunePackage rec { + version = "0.9.0"; + pname = "decompress"; -stdenv.mkDerivation rec { - version = "0.6"; - name = "ocaml${ocaml.version}-decompress-${version}"; - - src = fetchFromGitHub { - owner = "mirage"; - repo = "decompress"; - rev = "v${version}"; - sha256 = "0hfs5zrvimzvjwdg57vrxx9bb7irvlm07dk2yv3s5qhj30zimd08"; + src = fetchurl { + url = "https://github.com/mirage/decompress/releases/download/v${version}/decompress-v${version}.tbz"; + sha256 = "0fryhcvv96vfca51c7kqdn3n3canqsbbvfbi75ya6lca4lmpipbh"; }; - buildInputs = [ ocaml findlib ocamlbuild topkg ]; - - inherit (topkg) buildPhase installPhase; + buildInputs = [ cmdliner ]; + propagatedBuildInputs = [ checkseum ]; + checkInputs = lib.optionals doCheck [ alcotest bos camlzip mmap re ]; + doCheck = true; meta = { description = "Pure OCaml implementation of Zlib"; - license = stdenv.lib.licenses.mit; - maintainers = [ stdenv.lib.maintainers.vbgl ]; - inherit (src.meta) homepage; - inherit (ocaml.meta) platforms; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.vbgl ]; + homepage = "https://github.com/mirage/decompress"; + broken = !checkseum.hasC; }; } diff --git a/pkgs/development/ocaml-modules/git/default.nix b/pkgs/development/ocaml-modules/git/default.nix index 35f8f5d52e94..929382abe76b 100644 --- a/pkgs/development/ocaml-modules/git/default.nix +++ b/pkgs/development/ocaml-modules/git/default.nix @@ -1,27 +1,28 @@ -{ stdenv, fetchFromGitHub, buildDunePackage -, astring, decompress, fmt, hex, logs, mstruct, ocaml_lwt, ocamlgraph, ocplib-endian, uri -, alcotest, mtime, nocrypto +{ lib, fetchFromGitHub, buildDunePackage +, alcotest, git, mtime, nocrypto +, angstrom, astring, cstruct, decompress, digestif, encore, duff, fmt +, fpath, hex, ke, logs, lru, ocaml_lwt, ocamlgraph, ocplib-endian, uri, rresult }: buildDunePackage rec { pname = "git"; - version = "1.11.5"; + version = "2.1.0"; src = fetchFromGitHub { owner = "mirage"; repo = "ocaml-git"; rev = version; - sha256 = "0r1bxpxjjnl9hh8xbabsxl7svzvd19hfy73a2y1m4kljmw64dpfh"; + sha256 = "0v55zkwgml6i5hp0kzynbi58z6j15k3qgzg06b3h8pdbv5fwd1jp"; }; - buildInputs = [ alcotest mtime nocrypto ]; - propagatedBuildInputs = [ astring decompress fmt hex logs mstruct ocaml_lwt ocamlgraph ocplib-endian uri ]; + propagatedBuildInputs = [ angstrom astring cstruct decompress digestif encore duff fmt fpath hex ke logs lru ocaml_lwt ocamlgraph ocplib-endian uri rresult ]; + checkInputs = lib.optionals doCheck [ alcotest git mtime nocrypto ]; doCheck = true; meta = { description = "Git format and protocol in pure OCaml"; - license = stdenv.lib.licenses.isc; - maintainers = [ stdenv.lib.maintainers.vbgl ]; + license = lib.licenses.isc; + maintainers = [ lib.maintainers.vbgl ]; inherit (src.meta) homepage; }; } diff --git a/pkgs/development/ocaml-modules/imagelib/default.nix b/pkgs/development/ocaml-modules/imagelib/default.nix index 77b18f0ce3a9..12b8a757e16f 100644 --- a/pkgs/development/ocaml-modules/imagelib/default.nix +++ b/pkgs/development/ocaml-modules/imagelib/default.nix @@ -1,26 +1,27 @@ -{ stdenv, fetchFromGitHub, which, ocaml, findlib, ocamlbuild, decompress }: +{ lib, fetchFromGitHub, fetchpatch, buildDunePackage, decompress }: -stdenv.mkDerivation rec { - version = "20171028"; - name = "ocaml${ocaml.version}-imagelib-${version}"; +buildDunePackage rec { + minimumOCamlVersion = "4.07"; + version = "20191011"; + pname = "imagelib"; src = fetchFromGitHub { owner = "rlepigre"; repo = "ocaml-imagelib"; - rev = "ocaml-imagelib_${version}"; - sha256 = "1frkrgcrv4ybdmqcfxpfsywx0hm1arxgxp32n8kzky6qip1g0zxf"; + rev = "03fed7733825cef7e0465163f398f6af810e2e75"; + sha256 = "0h7vgyss42nhlfqpbdnb54nxq86rskqi2ilx8b87r0hi19hqx463"; }; - buildInputs = [ which ocaml findlib ocamlbuild ]; + patches = [ (fetchpatch { + url = "https://github.com/rlepigre/ocaml-imagelib/pull/24/commits/4704fd44adcda62e0d96ea5b1927071326aa6111.patch"; + sha256 = "0ipjab1hfa2v2pnd8g1k3q2ia0plgiw7crm3fa4w2aqpzdyabkb9"; + }) ]; propagatedBuildInputs = [ decompress ]; - createFindlibDestdir = true; - meta = { description = "Image formats such as PNG and PPM in OCaml"; - license = stdenv.lib.licenses.lgpl3; - maintainers = [ stdenv.lib.maintainers.vbgl ]; + license = lib.licenses.lgpl3; + maintainers = [ lib.maintainers.vbgl ]; inherit (src.meta) homepage; - inherit (ocaml.meta) platforms; }; } diff --git a/pkgs/development/ocaml-modules/imagelib/unix.nix b/pkgs/development/ocaml-modules/imagelib/unix.nix new file mode 100644 index 000000000000..48986b15a8f8 --- /dev/null +++ b/pkgs/development/ocaml-modules/imagelib/unix.nix @@ -0,0 +1,8 @@ +{ buildDunePackage, imagelib }: + +buildDunePackage { + pname = "imagelib-unix"; + inherit (imagelib) version src meta; + + propagatedBuildInputs = [ imagelib ]; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 10b4d03b70ad..f2baa2b2a9ee 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -289,6 +289,8 @@ let imagelib = callPackage ../development/ocaml-modules/imagelib { }; + imagelib-unix = callPackage ../development/ocaml-modules/imagelib/unix.nix { }; + inotify = callPackage ../development/ocaml-modules/inotify { }; integers = callPackage ../development/ocaml-modules/integers { }; @@ -316,7 +318,7 @@ let gg = callPackage ../development/ocaml-modules/gg { }; - git = callPackage ../development/ocaml-modules/git { }; + git = callPackage ../development/ocaml-modules/git { inherit (pkgs) git; }; git-http = callPackage ../development/ocaml-modules/git-http { };