~alpine/users

1

Building static libraries

Joost Nieuwenhuijse <joost@newhouse.nl>
Details
Message ID
<25b8e8d9-5ad5-a03d-8cf6-d3055ebc1d98@newhouse.nl>
DKIM signature
missing
Download raw message
Hi,

I'm trying to build a completely statically linked application using gcc 
under Alpine. My application (PTGui) depends on GTK3 and a number of 
other libraries.

I've noticed that for some libraries Alpine is providing a xx-static 
package, containing the .a file. But for GTK3 and others this doesn't 
seem to exist.

I guess this means I'll have to compile a static GTK3 and other 
libraries myself, including all their dependencies, which is quite a 
job. I stumbled upon this though:

https://github.com/alpinelinux/aports/blob/master/main/gtk%2B3.0/APKBUILD

So I'm wondering if there's an easy way to build these static libs by 
modifying the APKBUILD file, instead of reinventing the wheel. Any hints 
would most welcome.

Thanks,
Joost Nieuwenhuijse
Details
Message ID
<20201125123431.jjweawhad6zxmwah@wolfsden.cz>
In-Reply-To
<25b8e8d9-5ad5-a03d-8cf6-d3055ebc1d98@newhouse.nl> (view parent)
DKIM signature
missing
Download raw message
Hello,

On 2020-11-19 23:12:27 +0100, Joost Nieuwenhuijse wrote:
> I guess this means I'll have to compile a static GTK3 and other libraries
> myself, including all their dependencies, which is quite a job. I stumbled
> upon this though:
> 
> https://github.com/alpinelinux/aports/blob/master/main/gtk%2B3.0/APKBUILD
> 
> So I'm wondering if there's an easy way to build these static libs by
> modifying the APKBUILD file, instead of reinventing the wheel. Any hints
> would most welcome.

If you take a look at community/jsoncpp/APKBUILD, you can see that it
builds both. So I assume adding --default-library=both to the
abuild-meson invocation and adding the -static subpackage should
suffice?

Not sure completely, but I think it should be on the right track.

W.

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
Reply to thread Export thread (mbox)