aboutsummaryrefslogtreecommitdiffstats
path: root/testing/bobcat
diff options
context:
space:
mode:
authorShiz <hi@shiz.me>2017-05-06 02:52:37 +0000
committerJakub Jirutka <jakub@jirutka.cz>2017-05-06 14:56:13 +0200
commit31f4e002d0f23414ec8d19a8f8656d2de01bbc20 (patch)
tree4dfce9491e6c99c91d667971eaebc9963e9bc39e /testing/bobcat
parentc01724f27449aabc93e5231f10bcba5a7e9b06f2 (diff)
downloadaports-31f4e002d0f23414ec8d19a8f8656d2de01bbc20.tar.bz2
aports-31f4e002d0f23414ec8d19a8f8656d2de01bbc20.tar.xz
testing/bobcat: new aport
https://fbb-git.github.io/bobcat/ library of C++ classes and templates handling child processes, streams/sockets, shared memory, config files, etc.
Diffstat (limited to 'testing/bobcat')
-rw-r--r--testing/bobcat/APKBUILD44
-rw-r--r--testing/bobcat/avoid-gnuisms.patch30
-rw-r--r--testing/bobcat/avoid-strerror_r.patch23
-rw-r--r--testing/bobcat/dont-use-reserved-name-for-page-size.patch35
-rw-r--r--testing/bobcat/libressl-compatibility.patch33
5 files changed, 165 insertions, 0 deletions
diff --git a/testing/bobcat/APKBUILD b/testing/bobcat/APKBUILD
new file mode 100644
index 0000000000..5cba65aa26
--- /dev/null
+++ b/testing/bobcat/APKBUILD
@@ -0,0 +1,44 @@
+# Contributor: Shiz <hi@shiz.me>
+# Maintainer: Shiz <hi@shiz.me>
+pkgname=bobcat
+pkgver=4.07.00
+pkgrel=0
+pkgdesc="Brokken's Own Base Classes And Templates"
+url="https://fbb-git.github.io/bobcat/"
+arch="all"
+license="GPL2+"
+depends_dev="$pkgname=$pkgver-r$pkgrel"
+makedepends="icmake bash yodl"
+subpackages="$pkgname-doc $pkgname-dev"
+options="!check" # no tests provided by upstream.
+source="bobcat-$pkgver.tar.gz::https://github.com/fbb-git/bobcat/archive/$pkgver.tar.gz
+ dont-use-reserved-name-for-page-size.patch
+ avoid-gnuisms.patch
+ avoid-strerror_r.patch
+ libressl-compatibility.patch"
+builddir="$srcdir/bobcat-$pkgver/bobcat"
+
+prepare() {
+ default_prepare
+
+ cd "$builddir"
+ sed -i '/^#define DOC/d' INSTALL.im
+ echo '#define DOC "/usr/share/doc/bobcat"' >> INSTALL.im
+}
+
+build() {
+ cd "$builddir"
+ ./build light strip
+ ./build man
+}
+
+package() {
+ cd "$builddir"
+ ./build install hlm "$pkgdir"
+}
+
+sha512sums="7df9ead07f9a46d146afb3c527ef574eb833adfe65d3ace6f3805dbb0cfc722071dbe095e079a4286be6e07fb5ca2ef9dc37b42afade1ef4bc0f5c09ce88c72a bobcat-4.07.00.tar.gz
+6521da77c2452fb2c4b209c24e5dae04650636224efe5e75e2f2e64ab1c6457392ad4cdc4afbe79526734c8211488b2dc5915210ee7af646e7d0af04579cd484 dont-use-reserved-name-for-page-size.patch
+24eb74e7dab68cb70f89459228f0f302a5214f8d45bc31e38a8d608edfa97cfe61710212fface32fc480fc4ef2fb23bbca7ed806dd40330e6da69774b3d1965d avoid-gnuisms.patch
+1129bb0666f6809ab2cca60bb164f4c557be7d27db84e41712643ee5027b8c7b62bc82e8f1c5fa9a1e737e487fe58f163afd6687d94fbacb9a23ad7818851cf0 avoid-strerror_r.patch
+02f3ca5a42d64f2831a3357b24cdc6d706f8ff26d38d87a36695f65f02730d06fb759f3d8ccb9accf93cca166954c80968ba31d16cdae3823478f7dbc917fb40 libressl-compatibility.patch"
diff --git a/testing/bobcat/avoid-gnuisms.patch b/testing/bobcat/avoid-gnuisms.patch
new file mode 100644
index 0000000000..92eb4ef7d4
--- /dev/null
+++ b/testing/bobcat/avoid-gnuisms.patch
@@ -0,0 +1,30 @@
+--- a/icmake/installer
++++ b/icmake/installer
+@@ -5,13 +5,13 @@
+ exit 0
+ fi
+
+-for src in `find -mindepth 1 -type d` # create missing target dirs
++for src in `find . -mindepth 1 -type d` # create missing target dirs
+ do
+ [ ! -e $1$src ] && mkdir -p $1$src
+ done
+
+-for file in `find -type f -or -type l`
++for file in `find . -type f -or -type l`
+ do
+- cp -d --preserve=timestamps $file $1$file
++ cp -H $file $1$file
+ done
+
+--- a/icmake/findall
++++ b/icmake/findall
+@@ -15,7 +15,7 @@
+ if (pattern != "")
+ pattern = "-name '" + pattern + "'";
+
+- entries = backtick(cmd + " " + pattern + " -printf \"%f\\n\"");
++ entries = backtick(cmd + " " + pattern + " -exec basename {} \\;");
+
+ for (idx = listlen(entries); idx--; )
+ ret += (list)cutEoln(entries[idx]);
diff --git a/testing/bobcat/avoid-strerror_r.patch b/testing/bobcat/avoid-strerror_r.patch
new file mode 100644
index 0000000000..73eea28215
--- /dev/null
+++ b/testing/bobcat/avoid-strerror_r.patch
@@ -0,0 +1,23 @@
+bobcat expects the GNU variant of strerror_r, while musl only provides the
+XSI variant with incompatible return type, leading to a compilation error.
+As musl strerror() is re-entrant anyway, just use that instead.
+--- a/exception/errnodescr.cc
++++ b/exception/errnodescr.cc
+@@ -7,16 +7,7 @@
+ {
+ if (errno != 0)
+ {
+- char *buffer = new char[Exception::STRERROR_BUFSIZE];
+-
+- if (char *cp = strerror_r(errno, buffer, Exception::STRERROR_BUFSIZE))
+- out << cp;
+- else
+- {
+- out << "internal error: strerror_r failed with errno = " << errno;
+- }
+-
+- delete[] buffer;
++ out << strerror(errno);
+ }
+
+ return out;
diff --git a/testing/bobcat/dont-use-reserved-name-for-page-size.patch b/testing/bobcat/dont-use-reserved-name-for-page-size.patch
new file mode 100644
index 0000000000..3c3fb1a5fe
--- /dev/null
+++ b/testing/bobcat/dont-use-reserved-name-for-page-size.patch
@@ -0,0 +1,35 @@
+--- a/sharedmemory/computesegmentsize.cc
++++ b/sharedmemory/computesegmentsize.cc
+@@ -28,10 +28,10 @@
+
+ maxMemory <<= sizeUnit;
+
+- double a = static_cast<double>(PAGESIZE) * PAGESIZE / sizeof(Entry);
++ double a = static_cast<double>(BC_PAGE_SIZE) * BC_PAGE_SIZE / sizeof(Entry);
+
+ double b = -static_cast<double>(sizeof(SharedSegment) - sizeof(Entry))
+- * PAGESIZE / sizeof(Entry);
++ * BC_PAGE_SIZE / sizeof(Entry);
+
+ double c = -maxMemory;
+
+@@ -39,7 +39,7 @@
+ ceil((-b + sqrt(b * b - 4 * a * c)) / (2 * a))
+ );
+
+- size_t segmentSize = factor * PAGESIZE;
++ size_t segmentSize = factor * BC_PAGE_SIZE;
+
+ *nBlocks = (segmentSize - (sizeof(SharedSegment) - sizeof(Entry)))
+ / sizeof(Entry);
+--- a/sharedmemory/sharedmemory
++++ b/sharedmemory/sharedmemory
+@@ -27,7 +27,7 @@
+ friend std::ostream &operator<<(std::ostream &out,
+ SharedMemory const &mem);
+
+- enum { PAGESIZE = 1 << 12 };
++ enum { BC_PAGE_SIZE = 1 << 12 };
+
+ // updated by the non-default constructors.
+ int d_id = -1; // id of SharedSegment
diff --git a/testing/bobcat/libressl-compatibility.patch b/testing/bobcat/libressl-compatibility.patch
new file mode 100644
index 0000000000..970bcf62d0
--- /dev/null
+++ b/testing/bobcat/libressl-compatibility.patch
@@ -0,0 +1,33 @@
+--- a/diffiehellman/diffiehellman.ih
++++ b/diffiehellman/diffiehellman.ih
+@@ -15,7 +15,7 @@
+ using namespace std;
+ using namespace FBB;
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ inline BN_GENCB *BN_GENCB_new()
+ {
+--- a/digestbuf/digestbuf.ih
++++ b/digestbuf/digestbuf.ih
+@@ -9,7 +9,7 @@
+
+ #include "../ohexstreambuf/ohexstreambuf"
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+ inline EVP_MD_CTX *EVP_MD_CTX_new()
+ {
+ EVP_MD_CTX *ret = new EVP_MD_CTX;
+--- a/hmacbuf/hmacbuf.ih
++++ b/hmacbuf/hmacbuf.ih
+@@ -7,7 +7,7 @@
+ #include <bobcat/exception>
+ #include "../ohexstreambuf/ohexstreambuf"
+
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+
+ inline HMAC_CTX *HMAC_CTX_new()
+ {