unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#45762] [PATCH] ocaml: Add ocaml-down and ocaml-ocp-index
@ 2021-01-10 10:49 aecepoglu
  2021-01-11 14:57 ` zimoun
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: aecepoglu @ 2021-01-10 10:49 UTC (permalink / raw)
  To: 45762

---
 gnu/packages/ocaml.scm | 132 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 132 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 2df16e7cd2..6699eb1050 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -390,6 +390,71 @@ repository-wide uninstallability checks.")
     ;; with static-linking exception
     (license license:lgpl2.1+)))
 
+(define-public ocaml-down
+  (package
+    (name "ocaml-down")
+    (version "0.0.3")
+    (source
+      (origin
+        (method url-fetch)
+        (uri "https://erratique.ch/software/down/releases/down-0.0.3.tbz")
+        (sha256
+          (base32
+            "1nz2f5j17frgr2vrslcz9klmi6w9sm2vqwwwpi33ngcm3rgmsrlg"))))
+    (build-system ocaml-build-system)
+    (arguments
+     `(#:tests? #f
+       #:phases (modify-phases %standard-phases
+                              (delete 'configure))
+       #:build-flags (list "build"
+                           "--lib-dir" (string-append (assoc-ref %outputs "out")
+                                                      "/lib/ocaml/site-lib"))))
+    (native-inputs
+      `(("ocaml-findlib" ,ocaml-findlib)
+        ("ocamlbuild" ,ocamlbuild)
+        ("ocaml-topkg" ,ocaml-topkg)
+        ("opam" ,opam)))
+    (home-page "https://erratique.ch/software/down")
+    (synopsis "An OCaml toplevel (REPL) upgrade")
+    (description
+      "
+Down is an unintrusive user experience upgrade for the `ocaml`
+toplevel (REPL). 
+
+Simply load the zero dependency `Down` library in the `ocaml` toplevel
+and you get line edition, history, session support and identifier
+completion and documentation (courtesy of [`ocp-index`][ocp-index]).
+
+Add this to your `~/.ocamlinit`:
+
+    #use \"down.top\"
+
+You may also need to add this to your `~/.ocamlinit` and declare
+the environment variable OCAML_TOPLEVEL_PATH
+
+    let () =
+      try Topdirs.dir_directory (Sys.getenv \"OCAML_TOPLEVEL_PATH\")
+      with Not_found -> ()
+
+OR
+     
+    let () = String.split_on_char ':' (Sys.getenv \"OCAMLPATH\")
+             |> List.filter (fun x -> Filename.check_suffix x \"/site-lib\")
+             |> List.map (fun x -> x ^ \"/toplevel\")
+             (* remove the line below if you don't want to see the text
+                every time you start the toplevel *)
+             |> List.map (fun x -> Printf.printf \"adding directory %s\\n\" x; x)
+             |> List.iter Topdirs.dir_directory;;
+
+
+![tty](doc/tty.png)
+
+Down is distributed under the ISC license.
+
+
+[ocp-index]: https://github.com/OCamlPro/ocp-index")
+    (license license:isc)))
+
 (define-public ocaml-opam-file-format
   (package
     (name "ocaml-opam-file-format")
@@ -2363,6 +2428,73 @@ the JSON data format.  It can process JSON text without blocking on IO and
 without a complete in-memory representation of the data.")
     (license license:isc)))
 
+(define-public ocaml-ocp-indent
+  (package
+    (name "ocaml-ocp-indent")
+    (version "1.8.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri "https://github.com/OCamlPro/ocp-indent/archive/1.8.1.tar.gz")
+        (sha256
+          (base32
+            "0rqcvwzpwwzwqvrzg1l37jjiglrk2ijgjg1c7vy3xvc8lk9zyysw"))))
+    (build-system dune-build-system)
+    (arguments
+     `(#:tests? #f
+       #:build-flags (list "--profile=release")))
+    (propagated-inputs
+      `(("ocaml-cmdliner" ,ocaml-cmdliner)))
+    (home-page
+      "http://www.typerex.org/ocp-indent.html")
+    (synopsis
+      "A simple tool to indent OCaml programs")
+    (description
+      "Ocp-indent is based on an approximate, tolerant OCaml parser and a simple stack
+machine ; this is much faster and more reliable than using regexps. Presets and
+configuration options available, with the possibility to set them project-wide.
+Supports most common syntax extensions, and extensible for others.
+
+Includes:
+- An indentor program, callable from the command-line or from within editors
+- Bindings for popular editors
+- A library that can be directly used by editor writers, or just for\n  fault-tolerant/approximate parsing.
+")
+    (license #f)))
+
+(define-public ocaml-ocp-index
+  (package
+    (name "ocaml-ocp-index")
+    (version "1.2.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri "https://github.com/OCamlPro/ocp-index/archive/1.2.1.tar.gz")
+        (sha256
+          (base32
+            "169msb3k1ip5lp79lr62nsk715rwrn53x9jcrnxz4js7c0fv0cyr"))))
+    (build-system dune-build-system)
+    (arguments
+     `(#:package "ocp-index"))
+    (propagated-inputs
+      `(("ocaml-ocp-indent" ,ocaml-ocp-indent)
+        ("ocaml-re" ,ocaml-re)
+        ("ocaml-cmdliner" ,ocaml-cmdliner)))
+    (native-inputs `(("ocaml-cppo" ,ocaml-cppo)))
+    (home-page
+      "http://www.typerex.org/ocp-index.html")
+    (synopsis
+      "Lightweight completion and documentation browsing for OCaml libraries")
+    (description
+      "This package includes
+* The `ocp-index` library and command-line tool
+* `ocp-grep`, a tool that finds uses of a given (qualified) identifier in a source tree
+* bindings for emacs and vim (sublime text also [available](https://github.com/whitequark/sublime-ocp-index/))
+
+To automatically configure your editors, install this with package `user-setup`.
+")
+    (license #f)))
+
 (define-public ocaml-ocurl
   (package
     (name "ocaml-ocurl")
-- 
2.29.2





^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-12 14:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-10 10:49 [bug#45762] [PATCH] ocaml: Add ocaml-down and ocaml-ocp-index aecepoglu
2021-01-11 14:57 ` zimoun
2021-01-11 15:15 ` Julien Lepiller
2021-01-11 20:55 ` [bug#45762] [PATCH 1/3] ocaml: Add ocaml-ocp-indent * gnu/packages/ocaml.scm (ocaml-ocp-indent): New variable aecepoglu
2021-01-11 20:55 ` [bug#45762] [PATCH 2/3] ocaml: Add ocaml-ocp-index * gnu/packages/ocaml.scm (ocaml-ocp-index): " aecepoglu
2021-01-11 20:56 ` [bug#45762] [PATCH 3/3] ocaml: Add ocaml-down * gnu/packages/ocaml.scm (ocaml-down): " aecepoglu
2021-01-12 14:10 ` bug#45762: [PATCH] ocaml: Add ocaml-down and ocaml-ocp-index Julien Lepiller

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).