From d563c4f32f58637d7021a46d9ed46d7377b6deac Mon Sep 17 00:00:00 2001
From: Michal Hrusecky <michal.hrusecky@turris.com>
Date: Mon, 30 Dec 2024 21:12:46 +0100
Subject: [PATCH] ldns: Do not compile parts not needed

When examples or drill are disabled, do not compile them at all.
---
 ...ldns-Do-not-compile-parts-not-needed.patch | 40 +++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 patches/packages/to-upstream/0023-ldns-Do-not-compile-parts-not-needed.patch

diff --git a/patches/packages/to-upstream/0023-ldns-Do-not-compile-parts-not-needed.patch b/patches/packages/to-upstream/0023-ldns-Do-not-compile-parts-not-needed.patch
new file mode 100644
index 000000000..024b069fc
--- /dev/null
+++ b/patches/packages/to-upstream/0023-ldns-Do-not-compile-parts-not-needed.patch
@@ -0,0 +1,40 @@
+From 9373fd9ed50faa410661460fb6506de79376c094 Mon Sep 17 00:00:00 2001
+From: Michal Hrusecky <michal.hrusecky@turris.com>
+Date: Mon, 30 Dec 2024 20:32:55 +0100
+Subject: [PATCH] ldns: Do not compile parts not needed
+
+When examples or drill are disabled, do not compile them at all.
+---
+ libs/ldns/Makefile | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/libs/ldns/Makefile b/libs/ldns/Makefile
+index 96653e502..15d631e31 100644
+--- a/libs/ldns/Makefile
++++ b/libs/ldns/Makefile
+@@ -78,10 +78,20 @@ CONFIGURE_ARGS += \
+ 	--disable-dsa \
+ 	--disable-gost \
+ 	--enable-ecdsa \
+-	--with-drill \
+-	--with-examples \
+ 	--with-ssl="$(STAGING_DIR)/usr"
+ 
++ifndef CONFIG_PACKAGE_ldns-examples
++CONFIGURE_ARGS += --without-examples
++else
++CONFIGURE_ARGS += --with-examples
++endif
++
++ifndef CONFIG_PACKAGE_drill
++CONFIGURE_ARGS += --without-drill
++else
++CONFIGURE_ARGS += --with-drill
++endif
++
+ define Build/InstallDev
+ 	$(INSTALL_DIR) $(1)/usr/include
+ 	$(CP) $(PKG_INSTALL_DIR)/usr/include/ldns $(1)/usr/include/
+-- 
+2.47.1
+
-- 
GitLab