Subject: [alpine-aports] [PATCH] testing/libcouchbase: update for docker image.

From: Nathan Johnson <[email-masked]>
Date: Mon, 29 Feb 2016 05:35:10 -0600

Added small patch to make unit tests complete under docker image.

Added prepare() back since default prepare() doesn't seem to apply
patches.

Relaxed makedepends to remove openjdk8-jre-base, skip running expensive
couchbase mock tests (which required java in the first place).

Bumped revision number.
---
 testing/libcouchbase/APKBUILD           | 27 ++++++++++++++++++++-------
 testing/libcouchbase/fix_socktest.patch | 11 +++++++++++
 2 files changed, 31 insertions(+), 7 deletions(-)
 create mode 100644 testing/libcouchbase/fix_socktest.patch

diff --git a/testing/libcouchbase/APKBUILD b/testing/libcouchbase/APKBUILD
index 7beb485..3547a84 100644
--- a/testing/libcouchbase/APKBUILD
+++ b/testing/libcouchbase/APKBUILD
@@ -2,27 +2,37 @@
 # Maintainer: Nathan Johnson <[email-masked]>
 pkgname=libcouchbase
 pkgver=2.5.6
-pkgrel=0
+pkgrel=1
 pkgdesc="C client library for Couchbase"
 url="http://developer.couchbase.com/community"
 arch="all"
 license="ASL 2.0"
 depends=""
 depends_dev="musl-dev openssl-dev snappy-dev"
-makedepends="$depends_dev cmake perl openjdk8-jre-base libtool libev-dev libevent-dev libuv-dev"
+makedepends="$depends_dev cmake perl libtool libev-dev libevent-dev libuv-dev"
 install=""
 subpackages="$pkgname-dev $pkgname-bin $pkgname-doc $pkgname-libevent $pkgname-libev $pkgname-libuv"
 source="$pkgname-$pkgver.tar.gz::https://github.com/couchbase/libcouchbase/archive/${pkgver}.tar.gz
     disable_git_version_check.patch
     fix_ioserver_tests.patch
-    fix_snappy.patch"
+    fix_snappy.patch
+    fix_socktest.patch"
 
 _builddir="$srcdir/libcouchbase-${pkgver}"
+prepare() {
+	local i
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+}
 
 build() {
 	cd "$_builddir"
 	rm -rf build && mkdir build && cd build
-	../cmake/configure --prefix=/usr || return 1
+	../cmake/configure --prefix=/usr --disable-couchbasemock || return 1
 	make || return 1
 	ctest || return 1
 }
@@ -78,12 +88,15 @@ bin() {
 md5sums="309944c436b1eb4d90e8c90581d7504b  libcouchbase-2.5.6.tar.gz
 99f6fd7df5b3ccf4be9bc3363a96efea  disable_git_version_check.patch
 2b1192fba9fc460db50963caddef608a  fix_ioserver_tests.patch
-e207d547e3de14e22eecef04edf97a6b  fix_snappy.patch"
+e207d547e3de14e22eecef04edf97a6b  fix_snappy.patch
+00792fefbf19d29257411285afad5dd5  fix_socktest.patch"
 sha256sums="35690d39c51c00b2656911389068e9bc099a791872fadd6bb8d75684984cf10f  libcouchbase-2.5.6.tar.gz
 c323477ab7d2dddad9decf85b00e64a9b13e4e0c9eb78890e8c2ff99cee9ed3b  disable_git_version_check.patch
 cae791e2ed78cf570118cf9c50686aac62fd5a48b4050e9862cf0893af017a05  fix_ioserver_tests.patch
-30066934200e21c1b912600bc5dd72ec033aa9c580f1d2456a167ba91b4e624f  fix_snappy.patch"
+30066934200e21c1b912600bc5dd72ec033aa9c580f1d2456a167ba91b4e624f  fix_snappy.patch
+541a8d97d1e84fcbbee65014e7f81efa312c0f592975e168d7c81ded5a585152  fix_socktest.patch"
 sha512sums="32c87c323d3336a7aec612f56751c8788494860c6223449ddeca1577ac586d11d3c267b554aece1916c866b5a9d957a80a4b9d62f790b2501ed65a9ee8724246  libcouchbase-2.5.6.tar.gz
 987b76b9c8a38a1f144bcada3c24192b30b352c993c433f4a2a1e381b765ae6bb845ebc6393c794da1b4efbb68fd1d34b027104fecf5c9bcc29b0f58c7f6a474  disable_git_version_check.patch
 40992e442a2e9376ae6d4313fde801769ad4b43d8697e47f6183c8fbb05f30b160cd099c4ca7e893cfa2e665026cb0802abc22ade6d2da2bcf1b56e199b2528a  fix_ioserver_tests.patch
-36b483883f8cc2785a1b323cb67ebb9fb7e6e3af767fdcaca88205b3bbc32c02a375a88ce3749df750770ebd62d99c4bf5a19ef496e5f7f160e4b74fbd928e45  fix_snappy.patch"
+36b483883f8cc2785a1b323cb67ebb9fb7e6e3af767fdcaca88205b3bbc32c02a375a88ce3749df750770ebd62d99c4bf5a19ef496e5f7f160e4b74fbd928e45  fix_snappy.patch
+72319b86fdd91728723ccb091e72199788a84e2ec9ea12c0fcd1ed686eb155ec11e0addbff96735f83e7f31764a85650f0483b6e76d3a8bee16f71b2751fe4a9  fix_socktest.patch"
diff --git a/testing/libcouchbase/fix_socktest.patch b/testing/libcouchbase/fix_socktest.patch
new file mode 100644
index 0000000..2ee7cc6
--- /dev/null
+++ b/testing/libcouchbase/fix_socktest.patch
@@ -0,0 +1,11 @@
+--- libcouchbase-2.5.6/tests/socktests/t_basic.cc
++++ libcouchbase-2.5.6-2/tests/socktests/t_basic.cc
+@@ -48,7 +49,7 @@
+ 
+ static bool isRefused(lcbio_OSERR err)
+ {
+-    if (err == ECONNREFUSED || err == ECONNABORTED) {
++    if (err == ECONNREFUSED || err == ECONNABORTED || err == EAFNOSUPPORT) {
+         return true;
+     }
+ #ifdef _WIN32
-- 
2.6.4

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---