libb64: add package
authorDaniel Golle <daniel@makrotopia.org>
Sun, 19 Feb 2023 04:41:08 +0000 (04:41 +0000)
committerJosef Schlehofer <pepe.schlehofer@gmail.com>
Tue, 20 Feb 2024 08:05:54 +0000 (09:05 +0100)
Add generic base64 encode/decode (static) library.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 6993b5d9456f4747583082106e889eacc4d8ab08)

libs/libb64/Makefile [new file with mode: 0644]
libs/libb64/patches/100-no-Werror.patch [new file with mode: 0644]

diff --git a/libs/libb64/Makefile b/libs/libb64/Makefile
new file mode 100644 (file)
index 0000000..8223975
--- /dev/null
@@ -0,0 +1,34 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=libb64
+PKG_VERSION:=2.0.0
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/libb64/libb64/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=28c43c47674409fc50e7145d4c2d26dc1f3d200889c41205e7812c2b67f26382
+
+PKG_LICENSE:=PublicDomain
+PKG_LICENSE_FILES:=LICENSE.md
+
+PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
+
+include $(INCLUDE_DIR)/package.mk
+
+MAKE_FLAGS+=all_src
+
+define Package/libb64
+  SECTION:=libs
+  CATEGORY:=Libraries
+  TITLE:=Base64 Encoding/Decoding Routines
+  URL:=https://github.com/libb64/libb64
+  BUILDONLY:=1
+endef
+
+define Build/InstallDev
+       $(INSTALL_DIR) $(1)/usr/include/b64 $(1)/usr/lib
+       $(CP) $(PKG_BUILD_DIR)/include/b64/*.h $(1)/usr/include/b64
+       $(CP) $(PKG_BUILD_DIR)/src/*.a $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,libb64))
diff --git a/libs/libb64/patches/100-no-Werror.patch b/libs/libb64/patches/100-no-Werror.patch
new file mode 100644 (file)
index 0000000..5485999
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -15,7 +15,7 @@ TARGETS = $(LIBRARIES)
+ LINK.o = gcc
+-CFLAGS += -Werror -pedantic
++CFLAGS += -pedantic
+ CFLAGS += -I../include
+ vpath %.h ../include/b64