From dd6d785d381865cd571b190f7cfc3fc278c8bd8f Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Sun, 15 Mar 2020 18:14:32 +0100 Subject: [PATCH] =?UTF-8?q?ocamlPackages.graphics:=20init=20at=205.1.0=20f?= =?UTF-8?q?or=20OCaml=20=E2=89=A5=204.09?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ocaml-modules/graphics/default.nix | 23 +++++++++++++++++++ pkgs/top-level/ocaml-packages.nix | 5 ++++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/development/ocaml-modules/graphics/default.nix diff --git a/pkgs/development/ocaml-modules/graphics/default.nix b/pkgs/development/ocaml-modules/graphics/default.nix new file mode 100644 index 00000000000..6a3217431b4 --- /dev/null +++ b/pkgs/development/ocaml-modules/graphics/default.nix @@ -0,0 +1,23 @@ +{ lib, fetchurl, buildDunePackage, dune-configurator, libX11 }: + +buildDunePackage rec { + + pname = "graphics"; + version = "5.1.0"; + + useDune2 = true; + + src = fetchurl { + url = "https://github.com/ocaml/graphics/releases/download/${version}/graphics-${version}.tbz"; + sha256 = "16z997mp0ccilaqqvmz3wp7vx0ghaf4ik9qklgd4piklcl1yv5n5"; + }; + + buildInputs = [ dune-configurator ]; + propagatedBuildInputs = [ libX11 ]; + + meta = { + homepage = "https://github.com/ocaml/graphics"; + description = "A set of portable drawing primitives"; + license = lib.licenses.lgpl2; + }; +} diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index 485dfa7d807..7e12a3db3f7 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -347,6 +347,11 @@ let gmetadom = callPackage ../development/ocaml-modules/gmetadom { }; + graphics = + if lib.versionOlder "4.09" ocaml.version + then callPackage ../development/ocaml-modules/graphics { } + else null; + graphql = callPackage ../development/ocaml-modules/graphql { }; graphql-cohttp = callPackage ../development/ocaml-modules/graphql/cohttp.nix { };