jose: fix static library usage
authorRosen Penev <rosenp@gmail.com>
Sat, 17 Sep 2022 22:22:53 +0000 (15:22 -0700)
committerRosen Penev <rosenp@gmail.com>
Mon, 19 Sep 2022 06:19:31 +0000 (23:19 -0700)
When libjose is built statically, it must use --whole-archive as it uses
GCC's constructor attribute to initialize itself.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
libs/jose/Makefile
libs/jose/patches/010-whole.patch [new file with mode: 0644]

index 6360a70d3808d5bd5dc098c1cc6d4b4ba57046b4..19b6c514d6672fb1f834762c120d588eaf9c6dd4 100644 (file)
@@ -19,15 +19,13 @@ PKG_MAINTAINER:=Tibor Dudlák <tibor.dudlak@gmail.com>
 PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=COPYING
 
-PKG_BUILD_DEPENDS:=openssl
-
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/meson.mk
 
 define Package/jose
   SECTION:=utils
   TITLE:=Provides a full crypto stack including key generation, signing and encryption.
-  DEPENDS:=+jansson
+  DEPENDS:=+jansson +libopenssl +zlib
   URL:=https://github.com/latchset/jose
 endef
 
diff --git a/libs/jose/patches/010-whole.patch b/libs/jose/patches/010-whole.patch
new file mode 100644 (file)
index 0000000..33ee9e2
--- /dev/null
@@ -0,0 +1,10 @@
+--- a/cmd/meson.build
++++ b/cmd/meson.build
+@@ -22,6 +22,6 @@ executable(meson.project_name(),
+   'alg.c',
+   'fmt.c',
+   dependencies: jansson,
+-  link_with: libjose,
++  link_whole: libjose,
+   install: true
+ )