From 92e90f0dd41cfd4365059fa806e53df97fcc7b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Mon, 21 Aug 2023 21:31:03 +0700 Subject: [PATCH] New package: libb64-1.2.1 --- common/shlibs | 1 + srcpkgs/libb64-devel | 1 + srcpkgs/libb64/patches/01-cflags.patch | 27 ++++++++++++ srcpkgs/libb64/patches/02-bufsiz.patch | 44 +++++++++++++++++++ .../libb64/patches/03-internal-linkage.patch | 0 .../patches/04-initialise-coder-state.patch | 31 +++++++++++++ srcpkgs/libb64/template | 32 ++++++++++++++ 7 files changed, 136 insertions(+) create mode 120000 srcpkgs/libb64-devel create mode 100644 srcpkgs/libb64/patches/01-cflags.patch create mode 100644 srcpkgs/libb64/patches/02-bufsiz.patch create mode 100644 srcpkgs/libb64/patches/03-internal-linkage.patch create mode 100644 srcpkgs/libb64/patches/04-initialise-coder-state.patch create mode 100644 srcpkgs/libb64/template diff --git a/common/shlibs b/common/shlibs index 0a0188bf132..f1ca9ce4870 100644 --- a/common/shlibs +++ b/common/shlibs @@ -4328,3 +4328,4 @@ libdbi.so.1 libdbi-0.9.0_1 libchafa.so.0 libchafa-1.12.5_1 libcppdap.so cppdap-1.58.0+a_1 libkeyfinder.so.2 libkeyfinder-2.2.7_1 +libb64.so.0 libb64-1.2.1_1 diff --git a/srcpkgs/libb64-devel b/srcpkgs/libb64-devel new file mode 120000 index 00000000000..65941166177 --- /dev/null +++ b/srcpkgs/libb64-devel @@ -0,0 +1 @@ +libb64 \ No newline at end of file diff --git a/srcpkgs/libb64/patches/01-cflags.patch b/srcpkgs/libb64/patches/01-cflags.patch new file mode 100644 index 00000000000..e2353263220 --- /dev/null +++ b/srcpkgs/libb64/patches/01-cflags.patch @@ -0,0 +1,27 @@ +Description: make overriding CFLAGS possible +Author: Jakub Wilk +Forwarded: no +Last-Update: 2012-11-30 + +--- a/base64/Makefile ++++ b/base64/Makefile +@@ -3,7 +3,7 @@ BINARIES = base64 + # Build flags (uncomment one) + ############################# + # Release build flags +-CFLAGS += -O3 ++CFLAGS ?= -O3 + ############################# + # Debug build flags + #CFLAGS += -g +--- a/src/Makefile ++++ b/src/Makefile +@@ -3,7 +3,7 @@ LIBRARIES = libb64.a + # Build flags (uncomment one) + ############################# + # Release build flags +-CFLAGS += -O3 ++CFLAGS ?= -O3 + ############################# + # Debug build flags + #CFLAGS += -g diff --git a/srcpkgs/libb64/patches/02-bufsiz.patch b/srcpkgs/libb64/patches/02-bufsiz.patch new file mode 100644 index 00000000000..7e31bac14bf --- /dev/null +++ b/srcpkgs/libb64/patches/02-bufsiz.patch @@ -0,0 +1,44 @@ +Description: use BUFSIZ as buffer size +Author: Jakub Wilk +Bug: http://sourceforge.net/tracker/?func=detail&atid=785907&aid=3591336&group_id=152942 +Forwarded: no +Last-Update: 2012-11-30 + +--- a/include/b64/decode.h ++++ b/include/b64/decode.h +@@ -8,6 +8,7 @@ For details, see http://sourceforge.net/ + #ifndef BASE64_DECODE_H + #define BASE64_DECODE_H + ++#include + #include + + namespace base64 +@@ -22,7 +23,7 @@ namespace base64 + base64_decodestate _state; + int _buffersize; + +- decoder(int buffersize_in = BUFFERSIZE) ++ decoder(int buffersize_in = BUFSIZ) + : _buffersize(buffersize_in) + {} + +--- a/include/b64/encode.h ++++ b/include/b64/encode.h +@@ -8,6 +8,7 @@ For details, see http://sourceforge.net/ + #ifndef BASE64_ENCODE_H + #define BASE64_ENCODE_H + ++#include + #include + + namespace base64 +@@ -22,7 +23,7 @@ namespace base64 + base64_encodestate _state; + int _buffersize; + +- encoder(int buffersize_in = BUFFERSIZE) ++ encoder(int buffersize_in = BUFSIZ) + : _buffersize(buffersize_in) + {} + diff --git a/srcpkgs/libb64/patches/03-internal-linkage.patch b/srcpkgs/libb64/patches/03-internal-linkage.patch new file mode 100644 index 00000000000..e69de29bb2d diff --git a/srcpkgs/libb64/patches/04-initialise-coder-state.patch b/srcpkgs/libb64/patches/04-initialise-coder-state.patch new file mode 100644 index 00000000000..e34f005dc37 --- /dev/null +++ b/srcpkgs/libb64/patches/04-initialise-coder-state.patch @@ -0,0 +1,31 @@ +Description: initialize encoder/decoder state in the constructors +Author: Jakub Wilk +Forwarded: no +Last-Update: 2013-01-11 + +--- a/include/b64/decode.h ++++ b/include/b64/decode.h +@@ -25,7 +25,9 @@ namespace base64 + + decoder(int buffersize_in = BUFSIZ) + : _buffersize(buffersize_in) +- {} ++ { ++ base64_init_decodestate(&_state); ++ } + + int decode(char value_in) + { +--- a/include/b64/encode.h ++++ b/include/b64/encode.h +@@ -25,7 +25,9 @@ namespace base64 + + encoder(int buffersize_in = BUFSIZ) + : _buffersize(buffersize_in) +- {} ++ { ++ base64_init_encodestate(&_state); ++ } + + int encode(char value_in) + { diff --git a/srcpkgs/libb64/template b/srcpkgs/libb64/template new file mode 100644 index 00000000000..48ad704ecb3 --- /dev/null +++ b/srcpkgs/libb64/template @@ -0,0 +1,32 @@ +# Template file for 'libb64' +pkgname=libb64 +version=1.2.1 +revision=1 +short_desc="Library for fast encoding/decoding data into and from Base64 format" +maintainer="Đoàn Trần Công Danh " +license="Public Domain" +homepage="https://libb64.sourceforge.net/" +distfiles="${SOURCEFORGE_SITE}/libb64/libb64-${version}.zip" +checksum=20106f0ba95cfd9c35a13c71206643e3fb3e46512df3e2efb2fdbf87116314b2 +CFLAGS=-fPIC + +do_build() { + make -C src + ${CC} ${LDFLAGS} ${CFLAGS} \ + -shared -Wl,-soname,libb64.so.0 \ + src/*.o -o libb64.so.0 +} + +do_install() { + vinstall libb64.so.0 644 usr/lib +} + +libb64-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + pkg_install() { + ln -sf libb64.so.0 "${PKGDESTDIR}/usr/lib/libb64.so" + vcopy include usr + vinstall src/libb64.a 644 usr/lib + } +}