guix-commits
[Top][All Lists]
Advanced

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

03/06: gnu: ocaml-llvm: Remove duplicate package.


From: guix-commits
Subject: 03/06: gnu: ocaml-llvm: Remove duplicate package.
Date: Mon, 22 Feb 2021 17:44:26 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit d8c80c671bb7e836f464d159aede6bc0ca86ab36
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Feb 22 18:18:36 2021 +0100

    gnu: ocaml-llvm: Remove duplicate package.
    
    Commit 8f710cc598fb675d267f49a82cffc197f03ad52c introduced a duplicate
    ocaml-llvm@9.0.1 package, which was flagged by a test failure in
    tests/packages.scm.
    
    * gnu/packages/ocaml.scm (make-ocaml-llvm): Define as 'mlambdaq'.
---
 gnu/packages/ocaml.scm | 74 ++++++++++++++++++++++++++------------------------
 1 file changed, 39 insertions(+), 35 deletions(-)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index dec1f84..9e68359 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -87,6 +87,7 @@
   #:use-module (guix packages)
   #:use-module (guix svn-download)
   #:use-module (guix utils)
+  #:use-module (guix memoization)
   #:use-module ((srfi srfi-1) #:hide (zip)))
 
 ;; A shortcut for files from ocaml forge. Downloaded files are computed from
@@ -6198,41 +6199,44 @@ provides support to program with time varying values: 
declarative events and
 client chooses the concrete timeline.")
     (license license:lgpl2.1+)))
 
-(define (make-ocaml-llvm llvm)
-  (package
-    (inherit llvm)
-    (name "ocaml-llvm")
-    (outputs '("out"))
-    (arguments
-     `(#:configure-flags
-       (list
-         (string-append "-DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR="
-                        (assoc-ref %build-inputs "llvm") "/lib")
-         "-DBUILD_SHARED_LIBS=TRUE"
-         "-DLLVM_OCAML_OUT_OF_TREE=TRUE"
-         (string-append "-DLLVM_OCAML_INSTALL_PATH="
-                        (assoc-ref %outputs "out") "/lib/ocaml/site-lib"))
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'build
-           (lambda _
-             (invoke "make" "ocaml_all")))
-         (replace 'install
-           (lambda _
-             (invoke "cmake" "-P" "bindings/ocaml/cmake_install.cmake"))))))
-    (inputs
-     `(("llvm" ,llvm)))
-    (native-inputs
-     `(("ocaml" ,ocaml)
-       ("ocaml-findlib" ,ocaml-findlib)
-       ("ocaml-ounit" ,ocaml-ounit)
-       ("python" ,python)))
-    (propagated-inputs
-     `(("ocaml-integers" ,ocaml-integers)
-       ("ocaml-ctypes" ,ocaml-ctypes)))
-    (synopsis "OCaml bindings to LLVM")
-    (description "This package contains the OCaml bindings distributed with
-LLVM.")))
+(define make-ocaml-llvm
+  ;; Make it a memoizing procedure so its callers below don't end up defining
+  ;; two equal-but-not-eq "ocaml-llvm" packages for the default LLVM.
+  (mlambdaq (llvm)
+    (package
+      (inherit llvm)
+      (name "ocaml-llvm")
+      (outputs '("out"))
+      (arguments
+       `(#:configure-flags
+         (list
+          (string-append "-DLLVM_OCAML_EXTERNAL_LLVM_LIBDIR="
+                         (assoc-ref %build-inputs "llvm") "/lib")
+          "-DBUILD_SHARED_LIBS=TRUE"
+          "-DLLVM_OCAML_OUT_OF_TREE=TRUE"
+          (string-append "-DLLVM_OCAML_INSTALL_PATH="
+                         (assoc-ref %outputs "out") "/lib/ocaml/site-lib"))
+         #:phases
+         (modify-phases %standard-phases
+           (replace 'build
+             (lambda _
+               (invoke "make" "ocaml_all")))
+           (replace 'install
+             (lambda _
+               (invoke "cmake" "-P" "bindings/ocaml/cmake_install.cmake"))))))
+      (inputs
+       `(("llvm" ,llvm)))
+      (native-inputs
+       `(("ocaml" ,ocaml)
+         ("ocaml-findlib" ,ocaml-findlib)
+         ("ocaml-ounit" ,ocaml-ounit)
+         ("python" ,python)))
+      (propagated-inputs
+       `(("ocaml-integers" ,ocaml-integers)
+         ("ocaml-ctypes" ,ocaml-ctypes)))
+      (synopsis "OCaml bindings to LLVM")
+      (description "This package contains the OCaml bindings distributed with
+LLVM."))))
 
 (define-public ocaml-llvm (make-ocaml-llvm llvm))
 (define-public ocaml-llvm-9 (make-ocaml-llvm llvm-9))



reply via email to

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