Le 2016-12-13 03:19, Eric Bavier a écrit :
On Mon, 12 Dec 2016 23:57:35 +0100
Julien Lepiller <jul...@lepiller.eu> wrote:
hi,
here are a few ocaml-related patches. The first one adds a
native-search-path so ocaml-findlib can find the libraries it
installs. Next, lablgtk is updated and installed using the recommended
way, with findlib. Then this new lablgtk is used to build coqide.
+ "-lablgtkdir" (string-append
lablgtkdir
+
"/lib/ocaml/site-lib/lablgtk2/")
Is there additional benefit to the ocaml search dir OCAMLPATH? I would
expect coq's build system to be able to find lablgtk from OCAMLPATH
without needing to pass the configure flags.
oh ! how could I not see it... OCAMLPATH is already defined differently
by the ocaml package... I guess there was an update I didn't see since I
wrote these patches (or maybe I'm just blind). Here is a a new version
of the patches. I added ocaml-findlib to the native-inputs of coq so its
configure script can find lablgtk without the option. and lablgtk
doesn't need to be installed in site-lib anymore. Is this correct, or
should the library be installed in site-lib, and this directory added to
OCAMLPATH?
By the way, is there someone working on an ocaml-build-system?
`~Eric
From 2c7e43ffd0db19362756fe7fa848482c61b263d6 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <jul...@lepiller.eu>
Date: Tue, 13 Dec 2016 11:21:33 +0100
Subject: [PATCH 1/3] gnu: lablgtk: Update to 2.18.5
* gnu/packages/ocaml.scm (lablgtk): Update to 2.18.5.
---
gnu/packages/ocaml.scm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 61d5107..bc9f8f8 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -6,6 +6,7 @@
;;; Copyright © 2016 Eric Bavier <bav...@member.fsf.org>
;;; Copyright © 2016 Jan Nieuwenhuizen <jann...@gnu.org>
;;; Copyright © 2016 Efraim Flashner <efr...@flashner.co.il>
+;;; Copyright © 2016 Julien Lepiller <jul...@lepiller.eu>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -493,15 +494,15 @@ Knuthâs LR(1) parser construction technique.")
(define-public lablgtk
(package
(name "lablgtk")
- (version "2.18.3")
+ (version "2.18.5")
(source
(origin
(method url-fetch)
(uri (string-append "https://forge.ocamlcore.org/frs/download.php/"
- "1479/lablgtk-2.18.3.tar.gz"))
+ "1627/lablgtk-2.18.5.tar.gz"))
(sha256
(base32
- "1bybn3jafxf4cx25zvn8h2xj9agn1xjbn7j3ywxxqx6az7rfnnwp"))))
+ "0cyj6sfdvzx8hw7553lhgwc0krlgvlza0ph3dk9gsxy047dm3wib"))))
(build-system gnu-build-system)
(native-inputs
`(("camlp4" ,camlp4)
--
2.7.4
From ecb9fb669c8c93c35b7efd0f19b550a942234ad6 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <jul...@lepiller.eu>
Date: Tue, 13 Dec 2016 11:21:51 +0100
Subject: [PATCH 2/3] gnu: lablgtk: use ocamlfind in installation
* gnu/packages/ocaml.scm (lablgtk): Use ocamlfind in installation.
---
gnu/packages/ocaml.scm | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index bc9f8f8..555e3fd 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -507,6 +507,7 @@ Knuthâs LR(1) parser construction technique.")
(native-inputs
`(("camlp4" ,camlp4)
("ocaml" ,ocaml)
+ ("findlib" ,ocaml-findlib)
("pkg-config" ,pkg-config)))
;; FIXME: Add inputs gtkgl-2.0, libpanelapplet-2.0, gtkspell-2.0,
;; and gtk+-quartz-2.0 once available.
@@ -521,21 +522,24 @@ Knuthâs LR(1) parser construction technique.")
`(#:tests? #f ; no check target
;; opt: also install cmxa files
- #:make-flags (list "all" "opt")
+ #:make-flags (list "all" "opt"
+ (string-append "FINDLIBDIR="
+ (assoc-ref %outputs "out")
+ "/lib/ocaml"))
;; Occasionally we would get "Error: Unbound module GtkThread" when
;; compiling 'gtkThInit.ml', with 'make -j'. So build sequentially.
#:parallel-build? #f
#:phases
(modify-phases %standard-phases
- (replace 'install
+ (add-before 'install 'prepare-install
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(ocaml (assoc-ref inputs "ocaml")))
;; Install into the output and not the ocaml directory.
+ (mkdir-p (string-append out "/lib/ocaml"))
(substitute* "config.make"
((ocaml) out))
- (system* "make" "old-install")
#t))))))
(home-page "http://lablgtk.forge.ocamlcore.org/")
(synopsis "GTK+ bindings for OCaml")
--
2.7.4
From 330fa542eebed022b4e99abe69e593b5a8f5c4f5 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <jul...@lepiller.eu>
Date: Tue, 13 Dec 2016 11:22:06 +0100
Subject: [PATCH 3/3] gnu: coq: Build coqide
* gnu/packages/ocaml.scm (coq): Build coqide.
---
gnu/packages/ocaml.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 555e3fd..c5784db 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -341,9 +341,11 @@ written in Objective Caml.")
(build-system gnu-build-system)
(native-inputs
`(("texlive" ,texlive)
+ ("findlib" ,ocaml-findlib)
("hevea" ,hevea)))
(inputs
`(("ocaml" ,ocaml)
+ ("lablgtk" ,lablgtk)
("camlp5" ,camlp5)))
(arguments
`(#:phases
@@ -356,7 +358,8 @@ written in Objective Caml.")
(zero? (system* "./configure"
"-prefix" out
"-mandir" mandir
- "-browser" browser)))))
+ "-browser" browser
+ "-coqide" "opt")))))
(replace 'build
(lambda _
(zero? (system* "make" "-j" (number->string
--
2.7.4