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 }: 2 3 - buildDunePackage rec { 4 - pname = "zmq"; 5 version = "20180726"; 6 - 7 src = fetchFromGitHub { 8 owner = "issuu"; 9 repo = "ocaml-zmq"; ··· 15 ./ocaml-zmq-issue43.patch 16 ]; 17 18 - buildInputs = [ czmq ]; 19 propagatedBuildInputs = [ stdint ]; 20 21 meta = with stdenv.lib; { 22 description = "ZeroMQ bindings for OCaml"; 23 license = licenses.mit; 24 maintainers = with maintainers; [ akavel ]; 25 inherit (src.meta) homepage; 26 }; 27 }
··· 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 6 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}"; 13 version = "20180726"; 14 src = fetchFromGitHub { 15 owner = "issuu"; 16 repo = "ocaml-zmq"; ··· 22 ./ocaml-zmq-issue43.patch 23 ]; 24 25 + buildInputs = [ ocaml findlib dune czmq ]; 26 + 27 propagatedBuildInputs = [ stdint ]; 28 29 + buildPhase = "dune build -p zmq"; 30 + 31 + inherit (dune) installPhase; 32 + 33 meta = with stdenv.lib; { 34 description = "ZeroMQ bindings for OCaml"; 35 license = licenses.mit; 36 maintainers = with maintainers; [ akavel ]; 37 inherit (src.meta) homepage; 38 + inherit (ocaml.meta) platforms; 39 }; 40 }