From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:35723) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iSesa-0007LK-B5 for guix-patches@gnu.org; Thu, 07 Nov 2019 05:19:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iSesZ-0003xi-27 for guix-patches@gnu.org; Thu, 07 Nov 2019 05:19:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:32856) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iSesY-0003xE-Ug for guix-patches@gnu.org; Thu, 07 Nov 2019 05:19:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iSesX-0002dV-PB for guix-patches@gnu.org; Thu, 07 Nov 2019 05:19:01 -0500 Subject: [bug#38098] [PATCH 1/2] gnu: astyle: Create symlinks for .so files, too. References: <20191107101604.3211-1-h.goebel@crazy-compilers.com> In-Reply-To: <20191107101604.3211-1-h.goebel@crazy-compilers.com> Resent-Message-ID: From: Hartmut Goebel Date: Thu, 7 Nov 2019 11:18:09 +0100 Message-Id: <20191107101810.3284-1-h.goebel@crazy-compilers.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 38098@debbugs.gnu.org The Makefile only creates files with a versioned extension (.so.3.1.0), which are not picked up be cmake's `find_libarary()`. (Instead cmake picks up the static .a library.) Symlinks for .so.3 are required to avoid phase `verify-runpath` fails. * gnu/packages/code.scm(astyle)[argumements]: New element. {install-libs}: Add creating symlinks. --- gnu/packages/code.scm | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/gnu/packages/code.scm b/gnu/packages/code.scm index 512ca5d365..a277434b36 100644 --- a/gnu/packages/code.scm +++ b/gnu/packages/code.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2014 Eric Bavier ;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2014 Mark H Weaver +;;; Copyright © 2019 Hartmut Goebel ;;; ;;; This file is part of GNU Guix. ;;; @@ -599,6 +600,9 @@ Objective@tie{}C, D, Java, Pawn, and Vala). Features: #:make-flags (list (string-append "prefix=" %output) "INSTALL=install" "all") + #:modules ((guix build gnu-build-system) ;; FIXME use %default-modules + (guix build utils) + (ice-9 regex)) #:phases (modify-phases %standard-phases (replace 'configure @@ -608,12 +612,22 @@ Objective@tie{}C, D, Java, Pawn, and Vala). Features: ;; Libraries are not installed by default (let* ((output (assoc-ref outputs "out")) (libdir (string-append output "/lib"))) - (begin - (mkdir-p libdir) - (for-each (lambda (l) - (copy-file - l (string-append libdir "/" (basename l)))) - (find-files "bin" "lib*")))) + (define (make-so-link sofile strip-pattern) + (symlink + (basename sofile) + (regexp-substitute #f + (string-match strip-pattern sofile) + 'pre))) + (mkdir-p libdir) + (for-each (lambda (l) + (copy-file + l (string-append libdir "/" (basename l)))) + (find-files "bin" "lib*")) + (for-each + (lambda (sofile) + (make-so-link sofile "(\\.[0-9]){3}$") ;; link .so + (make-so-link sofile "(\\.[0-9]){2}$")) ;; link .so.3 + (find-files libdir "lib.*\\.so\\..*"))) #t))))) (home-page "http://astyle.sourceforge.net/") (synopsis "Source code indenter, formatter, and beautifier") -- 2.21.0