From 0f427af474841636e71f2ee34a7eb90d7b17d4a3 Mon Sep 17 00:00:00 2001
From: Matthias Schiffer <mschiffer@universe-factory.net>
Date: Fri, 28 Aug 2015 10:48:23 +0200
Subject: [PATCH] Avoid build dependency on libopenssl

---
 ...ditional-libopenssl-build-dependency.patch | 22 +++++++++++++++++++
 ...ditional-libopenssl-build-dependency.patch | 22 +++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch
 create mode 100644 patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch

diff --git a/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch
new file mode 100644
index 000000000..e87afb859
--- /dev/null
+++ b/patches/openwrt/0021-opkg-work-around-unconditional-libopenssl-build-dependency.patch
@@ -0,0 +1,22 @@
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Fri, 28 Aug 2015 10:43:55 +0200
+Subject: opkg: work around unconditional libopenssl build dependency
+
+As the OpenWrt build system only resolves build dependencies per directory,
+all opkg variants were causing libopenssl to be downloaded and built,
+not only opkg-smime. Fix this by applying the same workaround as in
+ustream-ssl.
+
+diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
+index d38ed52..16ff225 100644
+--- a/package/system/opkg/Makefile
++++ b/package/system/opkg/Makefile
+@@ -70,7 +70,7 @@ endef
+ define Package/opkg-smime
+   $(call Package/opkg/Default)
+   TITLE+= (with S/MIME signature support)
+-  DEPENDS+=+libopenssl
++  DEPENDS+=+PACKAGE_opkg-smime:libopenssl
+   VARIANT:=smime
+ endef
+ 
diff --git a/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch b/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch
new file mode 100644
index 000000000..0d51e607e
--- /dev/null
+++ b/patches/openwrt/0022-hostapd-work-around-unconditional-libopenssl-build-dependency.patch
@@ -0,0 +1,22 @@
+From: Matthias Schiffer <mschiffer@universe-factory.net>
+Date: Fri, 28 Aug 2015 10:46:11 +0200
+Subject: hostapd: work around unconditional libopenssl build dependency
+
+As the OpenWrt build system only resolves build dependencies per directory,
+all hostapd variants were causing libopenssl to be downloaded and built,
+not only wpad-mesh. Fix this by applying the same workaround as in
+ustream-ssl.
+
+diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
+index 3dff7b4..d86bb43 100644
+--- a/package/network/services/hostapd/Makefile
++++ b/package/network/services/hostapd/Makefile
+@@ -177,7 +177,7 @@ endef
+ define Package/wpad-mesh
+ $(call Package/wpad/Default)
+   TITLE+= (with 802.11s mesh and SAE support)
+-  DEPENDS:=$(DRV_DEPENDS) +libubus +libopenssl +@CONFIG_WPA_SUPPLICANT_OPENSSL @(!TARGET_uml||BROKEN)
++  DEPENDS:=$(DRV_DEPENDS) +libubus +PACKAGE_wpad-mesh:libopenssl +@CONFIG_WPA_SUPPLICANT_OPENSSL @(!TARGET_uml||BROKEN)
+   CONFLICTS:=@WPA_SUPPLICANT_INTERNAL
+   VARIANT:=wpad-mesh
+ endef
-- 
GitLab