From 147eabb0f47b6cf6be50ae5a1ffb021f33088526 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 23 Nov 2023 06:13:44 +0100 Subject: [PATCH] ocamlPackages.readline: init at 0.1 --- .../ocaml-modules/readline/default.nix | 34 +++++++++++++++++++ .../ocaml-modules/readline/dune.patch | 16 +++++++++ pkgs/top-level/ocaml-packages.nix | 4 +++ 3 files changed, 54 insertions(+) create mode 100644 pkgs/development/ocaml-modules/readline/default.nix create mode 100644 pkgs/development/ocaml-modules/readline/dune.patch diff --git a/pkgs/development/ocaml-modules/readline/default.nix b/pkgs/development/ocaml-modules/readline/default.nix new file mode 100644 index 000000000000..43763a3116c6 --- /dev/null +++ b/pkgs/development/ocaml-modules/readline/default.nix @@ -0,0 +1,34 @@ +{ lib, buildDunePackage, fetchFromGitLab +, readline +}: + +buildDunePackage { + pname = "readline"; + version = "0.1"; + + minimalOCamlVersion = "4.14"; + + src = fetchFromGitLab { + domain = "gitlab.inria.fr"; + owner = "vtourneu"; + repo = "readline-ocaml"; + rev = "b3f84c8a006439142884d3e0df51b395d963f9fe"; + hash = "sha256-h4kGbzwM88rPGj/KkHKgGyfyvkAYHP83ZY1INZzTaIE="; + }; + + patches = [ ./dune.patch ]; + + preConfigure = '' + echo "(${lib.getOutput "dev" readline}/include)" > src/iflags.sexp + echo "(-L${lib.getOutput "lib" readline}/lib -lreadline)" > src/lflags.sexp + ''; + + propagatedBuildInputs = [ readline ]; + + meta = { + description = "OCaml bindings for GNU Readline"; + homepage = "https://vtourneu.gitlabpages.inria.fr/readline-ocaml/readline/index.html"; + license = lib.licenses.cecill20; + maintainers = [ lib.maintainers.vbgl ]; + }; +} diff --git a/pkgs/development/ocaml-modules/readline/dune.patch b/pkgs/development/ocaml-modules/readline/dune.patch new file mode 100644 index 000000000000..9b62fb6f9b51 --- /dev/null +++ b/pkgs/development/ocaml-modules/readline/dune.patch @@ -0,0 +1,16 @@ +--- a/src/dune 2023-11-23 16:07:10.195742159 +0100 ++++ b/src/dune 2023-11-23 16:07:22.055805922 +0100 +@@ -1,13 +1,3 @@ +-(rule +- (target iflags.sexp) +- (action (run ./discover.sh include)) +-) +- +-(rule +- (target lflags.sexp) +- (action (run ./discover.sh lib)) +-) +- + (library + (name readline) + (public_name readline) diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/top-level/ocaml-packages.nix index adbec01c46ef..e788578d669f 100644 --- a/pkgs/top-level/ocaml-packages.nix +++ b/pkgs/top-level/ocaml-packages.nix @@ -1579,6 +1579,10 @@ let reactivedata = callPackage ../development/ocaml-modules/reactivedata {}; + readline = callPackage ../development/ocaml-modules/readline { + readline = pkgs.readline; + }; + reason = callPackage ../development/compilers/reason { }; reason-native = lib.recurseIntoAttrs (callPackage ../development/ocaml-modules/reason-native { });