Subject: Building static libraries

From: Joost Nieuwenhuijse <[email-masked]>
Date: Thu, 19 Nov 2020 23:12:27 +0100

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

---

From: Wolf <[email-masked]>
Date: Wed, 25 Nov 2020 13:34:31 +0100

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:
> 

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.