From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2CZe-0008MK-KX for guix-patches@gnu.org; Wed, 11 Oct 2017 04:41:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2CZa-00037G-0v for guix-patches@gnu.org; Wed, 11 Oct 2017 04:41:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:52574) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2CZZ-00037C-Td for guix-patches@gnu.org; Wed, 11 Oct 2017 04:41:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e2CZZ-0002b6-MS for guix-patches@gnu.org; Wed, 11 Oct 2017 04:41:01 -0400 Subject: [bug#28690] provide a lib output for boost Resent-Message-ID: References: <87d164b36m.fsf@albion.it.manchester.ac.uk> From: Roel Janssen Message-ID: <874lr6w02b.fsf@gnu.org> In-reply-to: <87d164b36m.fsf@albion.it.manchester.ac.uk> Date: Wed, 11 Oct 2017 10:39:40 +0200 MIME-Version: 1.0 Content-Type: text/plain 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: Dave Love Cc: 28690@debbugs.gnu.org Dave Love writes: > I mentioned elsewhere noticing the large size of boost in closures. > I've now realized what the problem was with making a lib output, and > done one, as below. However, presumably it should have a dependency of > out on lib for compatibility, and I don't know the right way to do that. > > The lib package is 17MiB, and the headers are 108MiB. > >>>From 1bb845d1d45ee7e8b9447bab902f3de41f0acfac Mon Sep 17 00:00:00 2001 > From: Dave Love > Date: Tue, 3 Oct 2017 16:18:59 +0100 > Subject: [PATCH] gnu: boost: Make a "lib" output. > > This save about half the contribution to the Closure of things linked against > it, > > * gnu/packages/boost.scm(outputs): Add lib. > (arguments)[mv-lib]: Add move the lib output into place after install. > --- > gnu/packages/boost.scm | 11 +++++++++-- > 1 file changed, 9 insertions(+), 2 deletions(-) > > diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm > index 4c7308e9d..c1e622fcd 100644 > --- a/gnu/packages/boost.scm > +++ b/gnu/packages/boost.scm > @@ -53,6 +53,7 @@ > `(("perl" ,perl) > ("python" ,python-2) > ("tcsh" ,tcsh))) > + (outputs '("out" "lib")) > (arguments > `(#:tests? #f > #:make-flags > @@ -60,7 +61,7 @@ > > ;; Set the RUNPATH to $libdir so that the libs find each other. > (string-append "linkflags=-Wl,-rpath=" > - (assoc-ref %outputs "out") "/lib") > + (assoc-ref %outputs "lib") "/lib") > > ;; Boost's 'context' library is not yet supported on mips64, so > ;; we disable it. The 'coroutine' library depends on 'context', > @@ -99,7 +100,13 @@ > (replace > 'install > (lambda* (#:key outputs make-flags #:allow-other-keys) > - (zero? (apply system* "./b2" "install" make-flags))))))) > + (zero? (apply system* "./b2" "install" make-flags)))) > + (add-after 'install 'mv-lib > + (lambda _ > + (mkdir-p (assoc-ref %outputs "lib")) > + (rename-file (string-append %output "/lib") > + (string-append (assoc-ref %outputs "lib") > + "/lib"))))))) > > (home-page "http://boost.org") > (synopsis "Peer-reviewed portable C++ source libraries") Boost consists of various modules or components. Some of these are "header-only". How does this patch handle that? If I were to install the "lib" output, could I then compile a C++ program that uses a header-only part of Boost? Kind regards, Roel Janssen