From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#30006: bzip2 does not provide libbz2.so Date: Tue, 27 Mar 2018 09:32:10 +0200 Message-ID: <87370m0y9x.fsf@gnu.org> References: <87incft8tf.fsf@gnu.org> <877eq3knk0.fsf@fastmail.com> <718583be2617e43743e8ee40397bb0b4@tobias.gr> <871sgbklvj.fsf@fastmail.com> <87zi2xjtm9.fsf@gnu.org> <87bmfakacc.fsf@fastmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f0j6R-0006eB-FK for bug-guix@gnu.org; Tue, 27 Mar 2018 03:33:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f0j6M-00010p-TF for bug-guix@gnu.org; Tue, 27 Mar 2018 03:33:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:47189) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f0j6M-00010i-OD for bug-guix@gnu.org; Tue, 27 Mar 2018 03:33:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f0j6M-0000ZR-Hx for bug-guix@gnu.org; Tue, 27 Mar 2018 03:33:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87bmfakacc.fsf@fastmail.com> (Marius Bakke's message of "Mon, 26 Mar 2018 19:36:35 +0200") 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: Marius Bakke Cc: 30006@debbugs.gnu.org Hello Marius, Marius Bakke skribis: > 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? Sounds reasonable to me. I have a suggestion: > From 6c903b1da1ab64c4f52581c7debb82b65a6afb0e 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. [...] > + (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))) To avoid =E2=80=98set!=E2=80=99, I=E2=80=99d write it along these lines: ;; Create symlinks libbz2.so.1.2 -> libbz2.so.1, etc. (let loop ((base "libbz2.so") (numbers (string-split soversion #\.))) (unless (null? numbers) (let ((so-file (string-append base "." (car numbers)))) (symlink so-file base) (loop so-file (cdr numbers))))) Otherwise LGTM. Thank you! Ludo=E2=80=99.