guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/4] gnu: ocaml-findlib: Update to 1.7.1.


From: Ben Woodcroft
Subject: Re: [PATCH 4/4] gnu: ocaml-findlib: Update to 1.7.1.
Date: Tue, 3 Jan 2017 21:03:16 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

Hi David,

Thanks for this.


On 03/01/17 03:38, David Craven wrote:
* gnu/packages/ocaml.scm (ocaml-findlib)[arguments]: Move
   ocaml-findlib-make-install.patch to phase and set ldconf="ignore" in
   findlib.conf.in.
* gnu/local.mk (dist_patch_DATA): Remove old patch.
The deletion of the patch file itself should also be documented.

[...]
-       #:phases (modify-phases %standard-phases
-                  (replace
-                   'configure
-                   (lambda* (#:key inputs outputs #:allow-other-keys)
-                     (let ((out (assoc-ref outputs "out")))
-                       (system*
-                        "./configure"
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-findlib.conf.in
+           (lambda _
+             (let ((port (open-file "findlib.conf.in" "w" #:encoding "utf-8")))
+               (format port "ldconf=\"ignore\"~%")
+               (close-port port))
+             #t))
+         (add-after 'unpack 'patch-findlib-make-install
+           (lambda _
+             (substitute* "src/findlib/Makefile"
+               (("^.*topfind.*OCAML_CORE_STDLIB.*$")
+                 "\ttest $(INSTALL_TOPFIND) -eq 0 || cp topfind 
\"$(prefix)$(OCAML_SITELIB)\"\n"))
+             #t))
+         (replace 'configure
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (system* "./configure"
                          "-bindir" (string-append out "/bin")
                          "-config" (string-append out "/etc/ocamfind.conf")
                          "-mandir" (string-append out "/share/man")
                          "-sitelib" (string-append out "/lib/ocaml/site-lib")
                          "-with-toolbox")))))))

I had some trouble building downstream packages such as 'laby' after this patch. Do you see the same?

+    (native-search-paths
+     (list (search-path-specification
+            (variable "OCAMLPATH")
+            (files (list (string-append "lib/ocaml/site-lib"))))))

This is unnecessary since this is already specified in the ocaml package definition, right?

[...]

On a somewhat related note, I've been getting around ocaml-findlib issues by adding this phase to downstream packages. WDYT?

         (add-before 'install 'setup-install
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (destdir (string-append out "/lib/ocaml")))
               (mkdir-p destdir)
               (setenv "OCAMLFIND_DESTDIR" destdir)
(setenv "OCAMLFIND_LDCONF" (string-append destdir "/ld.conf"))
               #t))))))

I've been preparing a few ocaml packages, and it is getting to the point that it might be worth adding an ocaml-build-system, much like gnu-build-system except perhaps with a few tweaks such as the above (preliminary patch not adding anything ocaml/findlib-specific attached). OTOH, I'm quite cautious about my knowledge of the OCaml ecosystem, so I'm keen to hear others' opinions.

Thanks, ben.

Attachment: 0001-build-Add-OCaml-build-system.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]