From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marius Bakke Subject: bug#30006: bzip2 does not provide libbz2.so Date: Mon, 26 Mar 2018 19:36:35 +0200 Message-ID: <87bmfakacc.fsf@fastmail.com> References: <87incft8tf.fsf@gnu.org> <877eq3knk0.fsf@fastmail.com> <718583be2617e43743e8ee40397bb0b4@tobias.gr> <871sgbklvj.fsf@fastmail.com> <87zi2xjtm9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52925) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0W3P-00048Z-Ag for bug-guix@gnu.org; Mon, 26 Mar 2018 13:37:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0W3K-0001sh-Dk for bug-guix@gnu.org; Mon, 26 Mar 2018 13:37:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:46765) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0W3K-0001sV-9T for bug-guix@gnu.org; Mon, 26 Mar 2018 13:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f0W3K-0004LS-4G for bug-guix@gnu.org; Mon, 26 Mar 2018 13:37:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87zi2xjtm9.fsf@gnu.org> 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" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 30006@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > There=E2=80=99s no such function, which is unfortunate. But I agree it= =E2=80=99s nicer > to preserve symlinks in this case. > > Perhaps we should actually do: > > (with-directory-excursion libdir > (symlink =E2=80=A6 "libbz2.so")) Thanks for the feedback everyone. I settled on a slightly different solution, that first extracts the (full) soversion from the built library, then creates symlinks for each "sub-version". It assumes that the major version is "1". That could be circumvented with a regex, but I'm not sure if it's worth the effort. As an added bonus, this also creates "libbz2.so.1" which was missing too. WDYT of this approach? Can it be made simpler? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-bzip2-Provide-libbz2.so-and-libbz2.so.1.patch Content-Transfer-Encoding: quoted-printable From=206c903b1da1ab64c4f52581c7debb82b65a6afb0e Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Mon, 26 Mar 2018 19:24:59 +0200 Subject: [PATCH] gnu: bzip2: Provide libbz2.so and libbz2.so.1. Fixes . * gnu/packages/compression.scm (bzip2)[arguments]: Rework INSTALL-SHARED-LIBS-PHASE to manage all library symlinks. =2D-- gnu/packages/compression.scm | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index 3bcc09bd3..7c853e432 100644 =2D-- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -271,15 +271,28 @@ file; as a result, it is often used in conjunction wi= th \"tar\", resulting in (add-after 'install 'install-shared-lib (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) =2D (libdir (string-append out "/lib"))) =2D (for-each (lambda (file) =2D (let ((base (basename file))) =2D (format #t "installing `~a' to `~a'~%" =2D base libdir) =2D (copy-file file =2D (string-append libdir "/" base))= )) =2D (find-files "." "^libbz2\\.so"))) =2D #t)) + (libdir (string-append out "/lib")) + ;; Find the actual library (e.g. "libbz2.so.1.0.6"). + (lib (string-drop + (car (find-files + "." + (lambda (file stat) + (and (string-prefix? "./libbz2.so.1" fil= e) + (eq? 'regular (stat:type stat)))))) + 2)) + (soversion (string-drop lib (string-length "libbz2.so.= ")))) + ;; The Makefile above does not have an 'install' target, nor + ;; does it create the versioned symlinks, so we handle it h= ere. + (install-file lib libdir) + (with-directory-excursion libdir + (let ((libs (string-split soversion #\.)) + (base "libbz2.so")) + (map (lambda (so) + (let ((next (string-append base "." so))) + (symlink next base) + (set! base next))) + libs))) + #t))) (add-after 'install-shared-lib 'patch-scripts (lambda* (#:key outputs inputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out"))) =2D-=20 2.16.2 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlq5L6MACgkQoqBt8qM6 VPqApQf/TjCXrrQzEF9jt59FE6RGjecqpsEHiIul6UIowloJxdEZ4QQwMT/V7Ghz WhQ21cjlEPOtNhZqpMUkm2myIuHZ1eJrQqQYdtuPa9LG590QwlyrgyU+F5mFKhM1 M4DEOAdaz+WOqJjrDnXImUZXu5veqavk5f9avr7Od7OflLiWv01Uh68srH5ywxeh 5A+pk3U5vuuwtEx54JGK50Bw3PaeeDx7GupIjMxkSpH8rYyH0b43ZUaCqM+MUNhG sXqx2iYsbaZQ4Wi4rl1c3IsGUah3Ll8VFKUYPMIbJsnHh6WZS0FOY+7Lj+OeeFig Ij+2qX741TK/TAkWb0WdGdNBtPlzTA== =8e4P -----END PGP SIGNATURE----- --==-=-=--