Re: Building a library as both static and dynamic

2020-10-05 Thread Ludovic Courtès
Hi,

Greg Hogan  skribis:

> Is there a best practice or example for building a library twice, both
> static and dynamic? I submitted patch #43620, and in working on
> another library have the same issue. These are cmake builds with a
> parameter declaration for either a static or dynamic build, not
> both. I would like to create a single package with both “out” and
> “static” outputs, which looks to be standard across Guix.

Yes, a “static” output is the preferred method if you want to keep .a
files around.

> One idea is to run the configure / make / make install phases
> twice. modify-phases does not currently support copying phases (though
> add-after could work with the right function reference from
> cmake-build) and #:configure-flags would need to be set differently.

Build systems from Autoconf/Automake/Libtool and those using CMake can
produce both shared libraries (position-independent code, PIC) and
static libraries at once.  No need to run it twice.

HTH,
Ludo’.



Re: Building a library as both static and dynamic

2020-09-28 Thread Efraim Flashner
On Sun, Sep 27, 2020 at 07:57:19AM -0400, Greg Hogan wrote:
> Is there a best practice or example for building a library twice, both static 
> and dynamic? I submitted patch #43620, and in working on another library have 
> the same issue. These are cmake builds with a parameter declaration for 
> either a static or dynamic build, not both. I would like to create a single 
> package with both “out” and “static” outputs, which looks to be standard 
> across Guix.
> 
> One idea is to run the configure / make / make install phases twice. 
> modify-phases does not currently support copying phases (though add-after 
> could work with the right function reference from cmake-build) and 
> #:configure-flags would need to be set differently.
> 
> Another option would be to patch the source build files, but this problem 
> feels solvable in Guix without duplicating the code from cmake-build’s 
> configure.
> 
> Thanks,
> Greg

x265 is a package that uses cmake and is built multiple times with
different options and with a separate static output.

-- 
Efraim Flashner  אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted


signature.asc
Description: PGP signature


Building a library as both static and dynamic

2020-09-27 Thread Greg Hogan
Is there a best practice or example for building a library twice, both static 
and dynamic? I submitted patch #43620, and in working on another library have 
the same issue. These are cmake builds with a parameter declaration for either 
a static or dynamic build, not both. I would like to create a single package 
with both “out” and “static” outputs, which looks to be standard across Guix.

One idea is to run the configure / make / make install phases twice. 
modify-phases does not currently support copying phases (though add-after could 
work with the right function reference from cmake-build) and #:configure-flags 
would need to be set differently.

Another option would be to patch the source build files, but this problem feels 
solvable in Guix without duplicating the code from cmake-build’s configure.

Thanks,
Greg