Skip to content

Commit

Permalink
ocamlPackages.readline: init at 0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vbgl committed Nov 30, 2023
1 parent 9d5b3ca commit 147eabb
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
34 changes: 34 additions & 0 deletions pkgs/development/ocaml-modules/readline/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}
16 changes: 16 additions & 0 deletions pkgs/development/ocaml-modules/readline/dune.patch
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 4 additions & 0 deletions pkgs/top-level/ocaml-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { });
Expand Down

0 comments on commit 147eabb

Please sign in to comment.