guix-commits
[Top][All Lists]
Advanced

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

06/09: gnu: ocaml-llvm: Move to (gnu packages llvm).


From: guix-commits
Subject: 06/09: gnu: ocaml-llvm: Move to (gnu packages llvm).
Date: Tue, 2 Mar 2021 17:13:16 -0500 (EST)

civodul pushed a commit to branch master
in repository guix.

commit 97f8b22f6d1ac3367dd806f7b01d3c09bf2a74e5
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Tue Mar 2 21:52:03 2021 +0100

    gnu: ocaml-llvm: Move to (gnu packages llvm).
    
    Commit 8f710cc598fb675d267f49a82cffc197f03ad52c introduced a circular
    dependency between ocaml.scm and llvm.scm by referring to 'llvm' from
    the top level of ocaml.scm.  This fixes it.
    
    * gnu/packages/ocaml.scm (make-ocaml-llvm, ocaml-llvm)
    (ocaml-llvm-9, ocaml-llvm-10, ocaml-llvm-11): Move to...
    * gnu/packages/llvm.scm: ... here.
---
 gnu/packages/llvm.scm  | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 gnu/packages/ocaml.scm | 45 ---------------------------------------------
 2 files changed, 47 insertions(+), 45 deletions(-)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 114654c..fb45668 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -17,6 +17,7 @@
 ;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
 ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2021 Julien Lepiller <julien@lepiller.eu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,6 +39,7 @@
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix download)
   #:use-module (guix git-download)
+  #:use-module (guix memoization)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
@@ -54,6 +56,7 @@
   #:use-module (gnu packages lua)
   #:use-module (gnu packages mpi)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages ocaml)
   #:use-module (gnu packages onc-rpc)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
@@ -1182,3 +1185,47 @@ C/C++/Obj-C code according to a set of style options, see
     (synopsis "Rename every occurrence of a symbol using clang-rename")
     (description "This package renames every occurrence of a symbol at point
 using @code{clang-rename}.")))
+
+(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))
+(define-public ocaml-llvm-10 (make-ocaml-llvm llvm-10))
+(define-public ocaml-llvm-11 (make-ocaml-llvm llvm-11))
diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index 3d75240..b561f11 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -87,7 +87,6 @@
   #: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,47 +6197,3 @@ provides support to program with time varying values: 
declarative events and
  signals.  React doesn't define any primitive event or signal, it lets the
 client chooses the concrete timeline.")
     (license license:lgpl2.1+)))
-
-(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))
-(define-public ocaml-llvm-10 (make-ocaml-llvm llvm-10))
-(define-public ocaml-llvm-11 (make-ocaml-llvm llvm-11))



reply via email to

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