guix-devel
[Top][All Lists]
Advanced

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

cmake-build-system


From: Ricardo Wurmus
Subject: cmake-build-system
Date: Sun, 05 Jul 2015 10:52:19 +0200

Attached is a patch for the cmake-build-system.  I have encountered a
couple of applications that failed the validate-runpath phase because
the RUNPATH was not set properly.

I found that setting BUILD_WITH_INSTALL_RPATH=TRUE helped when the
INSTALL_RPATH was also set to contain all inputs, like this:

  (string-append "-DCMAKE_INSTALL_RPATH="
                 (string-join (map (match-lambda
                                     ((name . directory)
                                      (string-append directory "/lib")))
                                   %build-inputs) ";"))

Currently, the build system only sets the INSTALL_RPATH to the output’s
“/lib” directory.

The attached patch only adds BUILD_WITH_INSTALL_RPATH=TRUE.  I’m not
sure if this is sufficient, but I think it is actually a requirement.

What do you think?

~~ Ricardo

>From def7bdacbebc1969e0390674844c85982575c305 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <address@hidden>
Date: Sun, 5 Jul 2015 10:45:15 +0200
Subject: [PATCH] cmake-build-system: Enable BUILD_WITH_INSTALL_RPATH.

* guix/build/cmake-build-system.scm (configure): Set BUILD_WITH_INSTALL_RPATH
  to TRUE.
---
 guix/build/cmake-build-system.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/guix/build/cmake-build-system.scm 
b/guix/build/cmake-build-system.scm
index f57622e..7199e51 100644
--- a/guix/build/cmake-build-system.scm
+++ b/guix/build/cmake-build-system.scm
@@ -55,6 +55,8 @@
                   ,(string-append "-DCMAKE_INSTALL_PREFIX=" out)
                   ;; add input libraries to rpath
                   "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE"
+                  ;; link target in the build tree with the INSTALL_RPATH
+                  "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
                   ;; add (other) libraries of the project itself to rpath
                   ,(string-append "-DCMAKE_INSTALL_RPATH=" out "/lib")
                   ;; enable verbose output from builds
-- 
2.4.3


reply via email to

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