From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#18926: cmake-build-system should set CMAKE_INSTALL_LIBDIR and CMAKE_PREFIX_PATH Date: Sun, 02 Nov 2014 23:55:49 +0100 Message-ID: <87d295i556.fsf@gnu.org> References: <877fzdu45q.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xl447-0003eS-1t for bug-guix@gnu.org; Sun, 02 Nov 2014 17:56:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xl442-0000wP-Au for bug-guix@gnu.org; Sun, 02 Nov 2014 17:56:07 -0500 Received: from debbugs.gnu.org ([140.186.70.43]:49294) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xl442-0000wL-6w for bug-guix@gnu.org; Sun, 02 Nov 2014 17:56:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xl441-0002it-Pm for bug-guix@gnu.org; Sun, 02 Nov 2014 17:56:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <877fzdu45q.fsf@gmail.com> ("=?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?="'s message of "Sun, 02 Nov 2014 21:24:01 +0800") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Cc: 18926@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable =E5=AE=8B=E6=96=87=E6=AD=A6 skribis: > if CMAKE_INSTALL_LIBDIR not set to `lib`, GNUInstallDirs.cmake will insta= ll > libraries files to $out/lib64. I found several CMake-built libraries on x86_64 (graphite2, openjpeg, qjson) that all use lib/, not lib64/. Then I found one counterexample, libftdi; however, setting CMAKE_INSTALL_LIBDIR=3Dlib doesn=E2=80=99t make any different: it still ins= talls libraries in $out/lib64. Any idea? Here=E2=80=99s the patch I tried: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm index 74b4f01..b1598dd 100644 --- a/guix/build/cmake-build-system.scm +++ b/guix/build/cmake-build-system.scm @@ -53,6 +53,8 @@ build-type)) '()) ,(string-append "-DCMAKE_INSTALL_PREFIX=" out) + ;; Install libraries to $prefix/lib, not $prefix/lib64. + "-DCMAKE_INSTALL_LIBDIR=lib" ;; add input libraries to rpath "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE" ;; add (other) libraries of the project itself to rpath --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable According to , LIBRARY_OUTPUT_PATH might be better for this, no? > if CMAKE_PREFIX_PATH not set to PATH of `inputs`, cmake will unable to > find cmake modules of inputs. You=E2=80=99re talking about .cmake files, right? Could you try the attached patch and report back? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-cmake-Add-search-paths-for-CMAKE_-INCLUDE-LIBRAR.patch Content-Description: the patch >From 536c143997fa146dc77d6e8defc24032452e5a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 2 Nov 2014 23:54:28 +0100 Subject: [PATCH] gnu: cmake: Add search paths for CMAKE_{INCLUDE,LIBRARY,MODULE}_PATH. * gnu/packages/cmake.scm (cmake)[native-search-paths]: New field. * guix/build/cmake-build-system.scm (configure): Remove 'setenv' calls for "CMAKE_LIBRARY_PATH" and "CMAKE_INCLUDE_PATH". --- gnu/packages/cmake.scm | 19 +++++++++++++++++++ guix/build/cmake-build-system.scm | 2 -- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm index 63805ef..e0349be 100644 --- a/gnu/packages/cmake.scm +++ b/gnu/packages/cmake.scm @@ -100,6 +100,25 @@ ("expat" ,expat) ("bzip2" ,bzip2) ("libarchive" ,libarchive))) + + (native-search-paths + (list + ;; Search path used by the 'FIND_XXX' functions. + (search-path-specification + (variable "CMAKE_PROGRAM_PATH") + (directories '("bin"))) + (search-path-specification + (variable "CMAKE_INCLUDE_PATH") + (directories '("include"))) + (search-path-specification + (variable "CMAKE_LIBRARY_PATH") + (directories '("lib" "lib64"))) + + ;; Search path used by 'FIND_PACKAGE' and 'INCLUDE'. + (search-path-specification + (variable "CMAKE_MODULE_PATH") + (directories '("lib/cmake"))))) + (home-page "http://www.cmake.org/") (synopsis "Cross-platform build system") (description diff --git a/guix/build/cmake-build-system.scm b/guix/build/cmake-build-system.scm index b1598dd..766797e 100644 --- a/guix/build/cmake-build-system.scm +++ b/guix/build/cmake-build-system.scm @@ -60,8 +60,6 @@ ;; add (other) libraries of the project itself to rpath ,(string-append "-DCMAKE_INSTALL_RPATH=" out "/lib") ,@configure-flags))) - (setenv "CMAKE_LIBRARY_PATH" (getenv "LIBRARY_PATH")) - (setenv "CMAKE_INCLUDE_PATH" (getenv "CPATH")) (format #t "running 'cmake' with arguments ~s~%" args) (zero? (apply system* "cmake" args))))) -- 2.1.2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > I find this when packaging https://github.com/lxdg/libqtxdg. It=E2=80=99s 404. Thanks, Ludo=E2=80=99. --=-=-=--