Skip to content

[RFC] meson: Allow building only libnm

Matt Turner requested to merge mattst88/NetworkManager:libnm-only into main

The Steam Runtime includes a 32-bit libnm.so. We would like to be able to build only libnm from NetworkManager and minimize the number of 32-bit dependencies required to do so.

There is not explicit support for this in the autotools build system, but it was still possible to accomplish with

$ make src/libnm-client-impl/libnm.la
$ make \
     install-libLTLIBRARIES
     install-libnmincludeHEADERS
     install-nodist_libnmincludeHEADERS
     install-pkgconfigDATA

Unfortunately ninja does not provide a way to install only specific targets.


To be clear: I hate this. Suggestions welcome.

Context: I'm switching Gentoo's NetworkManager packaging over from autotools to meson, and I ran into this issue—it's not easy to build and install only libnm.so which is a part of the Steam Runtime. Unlike some other distro tooling (e.g. Debian), in Gentoo I don't have a good way of splitting files resulting from a single build into separate packages, and that wouldn't solve the problem of needing a lot of additional 32-bit dependencies that aren't ultimately used by the only 32-bit binary we want to install from NetworkManager, libnm.so.

Looks like Arch builds as little as possible with the currently available meson options and then deletes everything except libnm.so (https://github.com/archlinux/svntogit-community/blob/packages/lib32-libnm/trunk/PKGBUILD). That's doable if the strategy in this patch is deemed unworkable—an outcome I'm fine with.

Thanks for your time and consideration!

(Everything else with the Meson conversion has been perfectly smooth! \o/)

Merge request reports