guix-commits
[Top][All Lists]
Advanced

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

04/04: gnu: agda: Adjust for using shared libraries.


From: guix-commits
Subject: 04/04: gnu: agda: Adjust for using shared libraries.
Date: Thu, 20 Aug 2020 00:05:56 -0400 (EDT)

samplet pushed a commit to branch master
in repository guix.

commit 8d06906017901822c9186a6885f85bcd8cd97467
Author: Timothy Sample <samplet@ngyro.com>
AuthorDate: Wed Aug 19 23:44:59 2020 -0400

    gnu: agda: Adjust for using shared libraries.
    
    See also 9e5496e0ae0ee8f638ca93949ecca314fdb9251e.
    
    * gnu/packages/agda.scm (agda)[arguments]: Add a phase that sets
    'LD_LIBRARY_PATH'; update the 'configure' phase to match the current
    Haskell build system code.
---
 gnu/packages/agda.scm | 46 +++++++++++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/agda.scm b/gnu/packages/agda.scm
index 98768c6..7b0cdd0 100644
--- a/gnu/packages/agda.scm
+++ b/gnu/packages/agda.scm
@@ -79,6 +79,11 @@
                   (ice-9 match))
        #:phases
        (modify-phases %standard-phases
+         ;; This allows us to call the 'agda' binary before installing.
+         (add-after 'unpack 'set-ld-library-path
+           (lambda _
+             (setenv "LD_LIBRARY_PATH" (string-append (getcwd) "/dist/build"))
+             #t))
          ;; FIXME: This is a copy of the standard configure phase with a tiny
          ;; difference: this package needs the -package-db flag to be passed
          ;; to "runhaskell" in addition to the "configure" action, because
@@ -90,30 +95,25 @@
                      #:allow-other-keys)
              (let* ((out (assoc-ref outputs "out"))
                     (name-version (strip-store-file-name out))
-                    (input-dirs (match inputs
-                                  (((_ . dir) ...)
-                                   dir)
-                                  (_ '())))
                     (ghc-path (getenv "GHC_PACKAGE_PATH"))
-                    (params (append `(,(string-append "--prefix=" out))
-                                    `(,(string-append "--libdir=" out "/lib"))
-                                    `(,(string-append "--bindir=" out "/bin"))
-                                    `(,(string-append
-                                        "--docdir=" out
-                                        "/share/doc/" name-version))
-                                    '("--libsubdir=$compiler/$pkg-$version")
-                                    '("--package-db=../package.conf.d")
-                                    '("--global")
-                                    `(,@(map
-                                         (cut string-append 
"--extra-include-dirs=" <>)
-                                         (search-path-as-list '("include") 
input-dirs)))
-                                    `(,@(map
-                                         (cut string-append 
"--extra-lib-dirs=" <>)
-                                         (search-path-as-list '("lib") 
input-dirs)))
-                                    (if tests?
-                                        '("--enable-tests")
-                                        '())
-                                    configure-flags)))
+                    (params
+                     `(,(string-append "--prefix=" out)
+                       ,(string-append "--libdir=" out "/lib")
+                       ,(string-append "--docdir=" out
+                                       "/share/doc/" name-version)
+                       "--libsubdir=$compiler/$pkg-$version"
+                       "--package-db=../package.conf.d"
+                       "--global"
+                       ,@(if tests?
+                             '("--enable-tests")
+                             '())
+                       ;; Build and link with shared libraries
+                       "--enable-shared"
+                       "--enable-executable-dynamic"
+                       "--ghc-option=-fPIC"
+                       ,(string-append "--ghc-option=-optl=-Wl,-rpath=" out
+                                       "/lib/$compiler/$pkg-$version")
+                       ,@configure-flags)))
                (unsetenv "GHC_PACKAGE_PATH")
                (apply invoke "runhaskell" "-package-db=../package.conf.d"
                       "Setup.hs" "configure" params)



reply via email to

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