From d9d7bc2eac13cd9c52ab05b830c212a1c84f9dd0 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 19 Mar 2015 09:29:57 +0000 Subject: testing/kyotocabinet: new aport A straightforward implementation of DBM http://fallabs.com/kyotocabinet/ --- testing/kyotocabinet/APKBUILD | 55 ++++++++++++++++ .../kyotocabinet-1.2.76-8-byte-atomics.patch | 74 ++++++++++++++++++++++ 2 files changed, 129 insertions(+) create mode 100644 testing/kyotocabinet/APKBUILD create mode 100644 testing/kyotocabinet/kyotocabinet-1.2.76-8-byte-atomics.patch diff --git a/testing/kyotocabinet/APKBUILD b/testing/kyotocabinet/APKBUILD new file mode 100644 index 000000000..3551888b2 --- /dev/null +++ b/testing/kyotocabinet/APKBUILD @@ -0,0 +1,55 @@ +# Contributor: Natanael Copa +# Maintainer: +pkgname=kyotocabinet +pkgver=1.2.76 +pkgrel=0 +pkgdesc="A straightforward implementation of DBM" +url="http://fallabs.com/kyotocabinet/" +arch="all" +license="GPLv3" +depends="" +depends_dev="" +makedepends="$depends_dev zlib-dev lzo-dev xz-dev" +install="" +subpackages="$pkgname-dev $pkgname-doc $pkgname-libs" +source="http://fallabs.com/kyotocabinet/pkg/kyotocabinet-$pkgver.tar.gz + kyotocabinet-1.2.76-8-byte-atomics.patch + " + +_builddir="$srcdir"/kyotocabinet-$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" + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var \ + || return 1 + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install || return 1 + rm -f "$pkgdir"/usr/lib/*.la +} + +md5sums="b925d369d7ed4a37cf0013409046738c kyotocabinet-1.2.76.tar.gz +bb24d2950afee01e8933d87d5ca683e4 kyotocabinet-1.2.76-8-byte-atomics.patch" +sha256sums="812a2d3f29c351db4c6f1ff29d94d7135f9e601d7cc1872ec1d7eed381d0d23c kyotocabinet-1.2.76.tar.gz +2ffa53de979c5a9bde3b147a6842482ba102ada77d134b6f503297350882883e kyotocabinet-1.2.76-8-byte-atomics.patch" +sha512sums="278db7b327eb4c21bf0137d9aa14fb67d74d5ce7ed1cb29fc9120d157a60de165ec0cf842903eb7952e8f998045ae585b958977fa973ba0e0773381de71d9f6a kyotocabinet-1.2.76.tar.gz +cac619578fa354052976a286f6b3630c52eeb41350cc2bf72227b53a759b982c8dc5ddf9a558cd74441830d9ec544edafbd138295522fe1ad239c8a3d0862730 kyotocabinet-1.2.76-8-byte-atomics.patch" diff --git a/testing/kyotocabinet/kyotocabinet-1.2.76-8-byte-atomics.patch b/testing/kyotocabinet/kyotocabinet-1.2.76-8-byte-atomics.patch new file mode 100644 index 000000000..f9417e93c --- /dev/null +++ b/testing/kyotocabinet/kyotocabinet-1.2.76-8-byte-atomics.patch @@ -0,0 +1,74 @@ +Patch by Shawn Landden for kyotocabinet >= 1.2.76, which fixes +the configure test to handle lack of 8 byte atomics correctly as is the case with ARM 32 +bit on all Fedora releases, Intel 32 bit on RHEL 5 and PowerPC 32 bit on RHEL 5 and all +Fedora releases. + +--- kyotocabinet-1.2.76/configure.in 2012-05-24 13:31:42.000000000 +0200 ++++ kyotocabinet-1.2.76/configure.in.8-byte-atomics 2013-03-01 00:21:21.000000000 +0100 +@@ -238,9 +238,22 @@ + # Atomic operations + if test "$enable_atomic" != "no" + then +- printf 'checking for atomic operations... ' +- AC_TRY_COMPILE([], [__sync_fetch_and_add], [MYGCCATOMIC=yes], [MYGCCATOMIC=no]) +- if test "$MYGCCATOMIC" = "yes" ++ printf 'checking for 8 byte atomic operations... ' ++ if printf ' ++/* Some targets support 4 byte atomics, but not 8 byte atomics, ++ * and will fail at link time if they are used. ++ * ++ * http://gcc.gnu.org/onlinedocs/gcc-4.6.3/gcc/Atomic-Builtins.html ++ * http://gcc.gnu.org/wiki/Atomic ++ */ ++#include ++int ++main () ++{ ++uint64_t n = 0xdeadbeaf; ++__sync_bool_compare_and_swap(&n, 0xdeadbeaf, 0); ++return n; ++}' | $CC -xc -o config.tmp - >/dev/null 2>&1 + then + MYCPPFLAGS="$MYCPPFLAGS -D_MYGCCATOMIC" + printf 'yes\n' +--- kyotocabinet-1.2.76/configure 2012-05-24 13:31:45.000000000 +0200 ++++ kyotocabinet-1.2.76/configure.8-byte-atomics 2013-03-01 00:22:37.000000000 +0100 +@@ -4012,25 +4012,22 @@ + # Atomic operations + if test "$enable_atomic" != "no" + then +- printf 'checking for atomic operations... ' +- cat confdefs.h - <<_ACEOF >conftest.$ac_ext +-/* end confdefs.h. */ +- ++ printf 'checking for 8 byte atomic operations... ' ++ if printf ' ++/* Some targets support 4 byte atomics, but not 8 byte atomics, ++ * and will fail at link time if they are used. ++ * ++ * http://gcc.gnu.org/onlinedocs/gcc-4.6.3/gcc/Atomic-Builtins.html ++ * http://gcc.gnu.org/wiki/Atomic ++ */ ++#include + int + main () + { +-__sync_fetch_and_add +- ; +- return 0; +-} +-_ACEOF +-if ac_fn_cxx_try_compile "$LINENO"; then : +- MYGCCATOMIC=yes +-else +- MYGCCATOMIC=no +-fi +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +- if test "$MYGCCATOMIC" = "yes" ++uint64_t n = 0xdeadbeaf; ++__sync_bool_compare_and_swap(&n, 0xdeadbeaf, 0); ++return n; ++}' | $CC -xc -o config.tmp - >/dev/null 2>&1 + then + MYCPPFLAGS="$MYCPPFLAGS -D_MYGCCATOMIC" + printf 'yes\n' -- cgit v1.2.3