Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

ocamlPackages.zmq: fix build with non-default OCaml

authored by

Vincent Laporte and committed by
Vincent Laporte
b3411342 0d780652

+18 -5
+18 -5
pkgs/development/ocaml-modules/zmq/default.nix
··· 1 - { stdenv, fetchFromGitHub, buildDunePackage, czmq, stdint }: 1 + { stdenv, fetchFromGitHub, ocaml, findlib, dune, czmq, stdint }: 2 + 3 + if !stdenv.lib.versionAtLeast ocaml.version "4.03" 4 + then throw "zmq is not available for OCaml ${ocaml.version}" 5 + else 2 6 3 - buildDunePackage rec { 4 - pname = "zmq"; 7 + let __dune = dune; in 8 + let dune = __dune.override { ocamlPackages = { inherit ocaml findlib; }; }; 9 + in 10 + 11 + stdenv.mkDerivation rec { 12 + name = "ocaml${ocaml.version}-zmq-${version}"; 5 13 version = "20180726"; 6 - 7 14 src = fetchFromGitHub { 8 15 owner = "issuu"; 9 16 repo = "ocaml-zmq"; ··· 15 22 ./ocaml-zmq-issue43.patch 16 23 ]; 17 24 18 - buildInputs = [ czmq ]; 25 + buildInputs = [ ocaml findlib dune czmq ]; 26 + 19 27 propagatedBuildInputs = [ stdint ]; 20 28 29 + buildPhase = "dune build -p zmq"; 30 + 31 + inherit (dune) installPhase; 32 + 21 33 meta = with stdenv.lib; { 22 34 description = "ZeroMQ bindings for OCaml"; 23 35 license = licenses.mit; 24 36 maintainers = with maintainers; [ akavel ]; 25 37 inherit (src.meta) homepage; 38 + inherit (ocaml.meta) platforms; 26 39 }; 27 40 }