From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: cmake-build-system Date: Sun, 05 Jul 2015 10:52:19 +0200 Message-ID: <87d207j8ak.fsf@elephly.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBff7-0006e2-St for guix-devel@gnu.org; Sun, 05 Jul 2015 04:52:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZBff2-0003M5-Qn for guix-devel@gnu.org; Sun, 05 Jul 2015 04:52:33 -0400 Received: from sender163-mail.zoho.com ([74.201.84.163]:25971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZBff2-0003Lx-IE for guix-devel@gnu.org; Sun, 05 Jul 2015 04:52:28 -0400 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-cmake-build-system-Enable-BUILD_WITH_INSTALL_RPATH.patch >From def7bdacbebc1969e0390674844c85982575c305 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus 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 --=-=-=--