Skip to contentSkip to conversation

Add conditional dependency for libkeyutils

PATCH In review ~_6d6178667269747a 3 participants 5 messages May 22, 2023 – May 31, 2023 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover Add conditional dependency for libkeyutils

I have a patch that adds a conditional dependency for 'libkeyutils' in the meson.build file to enhance the build system's flexibility. The patch addresses the following issue:

If the dynamic library 'libkeyutils' is found by pkg-config, but one attempts to build with static linkage, the build will fail, even if the keyring feature is disabled and, therefore, the library is not needed.

Max Fritz (1):
[meson.build] Add conditional dependency for libkeyutils

 meson.build | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Signature · 1 line
2.38.4
#1 lore raw

PATCH 1/1 Add conditional dependency for libkeyutils

From: Max Fritz <[email protected]>

This modification enables better control over the inclusion of libkeyutils based on the configuration, enhancing the flexibility of the build system.

---
 meson.build | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
meson.build +5 -2
index 0a5cdefd4d..206d4033bf 100644
@@ -1764,8 +1764,11 @@ if gnutls.found()
   tasn1 = dependency('libtasn1',
                      method: 'pkg-config')
 endif
-keyutils = dependency('libkeyutils', required: false,
-                      method: 'pkg-config')
+keyutils = not_found
+if get_option('keyring').enabled()
+  keyutils = dependency('libkeyutils', required: false,
+                        method: 'pkg-config', kwargs: static_kwargs)
+endif
 
 has_gettid = cc.has_function('gettid')
 
Signature · 1 line
2.38.4
#2 lore raw

Hi!

On 22/05/2023 02.12, ~_6d6178667269747a wrote:

There is something weird with your setup (sender name is "~_6d6178667269747a" ?)

Quoted 17 lines

From: Max Fritz <[email protected]>

This modification enables better control over the inclusion of libkeyutils based on the configuration, enhancing the flexibility of the build system.

---
  meson.build | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
meson.build +0 -0
index 0a5cdefd4d..206d4033bf 100644
@@ -1764,8 +1764,11 @@ if gnutls.found()
    tasn1 = dependency('libtasn1',
                       method: 'pkg-config')

meson.build if gnutls.found() · line 1773

Quoted 10 lines
meson.build +5 -2
  endif
-keyutils = dependency('libkeyutils', required: false,
-                      method: 'pkg-config')
+keyutils = not_found
+if get_option('keyring').enabled()
+  keyutils = dependency('libkeyutils', required: false,
+                        method: 'pkg-config', kwargs: static_kwargs)
+endif
 
  has_gettid = cc.has_function('gettid')

Please put the maintainer for the crypto/ folder for this into copy (done now).

Thomas

Reviewed-by on v1 1/1
#3 lore raw
In reply to ~_6d6178667269747a
Quoted 9 lines · On Mon, May 22, 2023 at 02:12:02AM +0200, ~_6d6178667269747a wrote:

From: Max Fritz <[email protected]>

This modification enables better control over the inclusion of libkeyutils based on the configuration, enhancing the flexibility of the build system.

---
 meson.build | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

With regards,
Daniel

Signature · 3 lines
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
#4 lore raw
In reply to ~_6d6178667269747a
Quoted 15 lines · On 22/05/2023 02.12, ~_6d6178667269747a wrote:

From: Max Fritz <[email protected]>

This modification enables better control over the inclusion of libkeyutils based on the configuration, enhancing the flexibility of the build system.

---
  meson.build | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
meson.build +0 -0
index 0a5cdefd4d..206d4033bf 100644

meson.build if gnutls.found() · line 1771

Quoted 10 lines
meson.build +5 -2
@@ -1764,8 +1764,11 @@ if gnutls.found()
    tasn1 = dependency('libtasn1',
                       method: 'pkg-config')
  endif
-keyutils = dependency('libkeyutils', required: false,
-                      method: 'pkg-config')
+keyutils = not_found
+if get_option('keyring').enabled()
+  keyutils = dependency('libkeyutils', required: false,
+                        method: 'pkg-config', kwargs: static_kwargs)
+endif

FYI, since nobody else picked this up yet, I'll add this to my next pull request (dropping the "kwargs" part from the patch, AFAIK it's not needed anymore, see commit 063d5119c18af76).

Thomas