From 3710bb24a82bd48ab0413f14309b4f4f3cdce92d Mon Sep 17 00:00:00 2001 From: John Regan Date: Wed, 26 Aug 2015 11:10:51 -0400 Subject: [PATCH] New package: libmemcached --- srcpkgs/libmemcached-devel | 1 + srcpkgs/libmemcached-docs | 1 + ...emcached-fix-linking-with-libpthread.patch | 19 +++++++ srcpkgs/libmemcached/patches/musl-fixes.patch | 51 +++++++++++++++++++ srcpkgs/libmemcached/template | 34 +++++++++++++ 5 files changed, 106 insertions(+) create mode 120000 srcpkgs/libmemcached-devel create mode 120000 srcpkgs/libmemcached-docs create mode 100644 srcpkgs/libmemcached/patches/libmemcached-fix-linking-with-libpthread.patch create mode 100644 srcpkgs/libmemcached/patches/musl-fixes.patch create mode 100644 srcpkgs/libmemcached/template diff --git a/srcpkgs/libmemcached-devel b/srcpkgs/libmemcached-devel new file mode 120000 index 0000000000..f6ef1b236c --- /dev/null +++ b/srcpkgs/libmemcached-devel @@ -0,0 +1 @@ +libmemcached \ No newline at end of file diff --git a/srcpkgs/libmemcached-docs b/srcpkgs/libmemcached-docs new file mode 120000 index 0000000000..f6ef1b236c --- /dev/null +++ b/srcpkgs/libmemcached-docs @@ -0,0 +1 @@ +libmemcached \ No newline at end of file diff --git a/srcpkgs/libmemcached/patches/libmemcached-fix-linking-with-libpthread.patch b/srcpkgs/libmemcached/patches/libmemcached-fix-linking-with-libpthread.patch new file mode 100644 index 0000000000..7660615781 --- /dev/null +++ b/srcpkgs/libmemcached/patches/libmemcached-fix-linking-with-libpthread.patch @@ -0,0 +1,19 @@ +diff -up build-aux/ltmain.sh +--- build-aux/ltmain.sh 2013-12-03 16:36:53.222107642 +0100 ++++ build-aux/ltmain.sh 2013-12-03 16:37:35.770132249 +0100 +@@ -5664,6 +5664,15 @@ func_mode_link () + *" $arg "*) ;; + * ) func_append new_inherited_linker_flags " $arg" ;; + esac ++ # As we are forced to pass -nostdlib to g++ during linking, the option ++ # -pthread{,s} is not in effect; add the -lpthread to $deplist ++ # explicitly to link correctly. ++ if test "$tagname" = CXX -a x"$with_gcc" = xyes; then ++ case "$arg" in ++ -pthread*) func_append deplibs " -lpthread" ;; ++ esac ++ fi ++ + continue + ;; + diff --git a/srcpkgs/libmemcached/patches/musl-fixes.patch b/srcpkgs/libmemcached/patches/musl-fixes.patch new file mode 100644 index 0000000000..3c63bba219 --- /dev/null +++ b/srcpkgs/libmemcached/patches/musl-fixes.patch @@ -0,0 +1,51 @@ +diff --git libhashkit/fnv_64.cc libhashkit/fnv_64.cc +index 68e4dd0..88bbace 100644 +--- libhashkit/fnv_64.cc ++++ libhashkit/fnv_64.cc +@@ -37,6 +37,9 @@ + + + #include ++#ifndef __GLIBC__ ++#include ++#endif + + #if __WORDSIZE == 64 && defined(HAVE_FNV64_HASH) + +diff --git libhashkit/has.cc libhashkit/has.cc +index 843e32e..7dbadc3 100644 +--- libhashkit/has.cc ++++ libhashkit/has.cc +@@ -37,6 +37,9 @@ + + + #include ++#ifndef __GLIBC__ ++#include ++#endif + + bool libhashkit_has_algorithm(const hashkit_hash_algorithm_t algo) + { +diff --git libtest/cmdline.cc libtest/cmdline.cc +index 29a22de..161c646 100644 +--- libtest/cmdline.cc ++++ libtest/cmdline.cc +@@ -61,7 +61,7 @@ using namespace libtest; + #include + #include + +-#ifndef __USE_GNU ++#ifndef _GNU_SOURCE + static char **environ= NULL; + #endif + +@@ -201,7 +201,7 @@ Application::error_t Application::run(const char *args[]) + + fatal_assert(posix_spawnattr_setsigmask(&spawnattr, &mask) == 0); + +-#if defined(POSIX_SPAWN_USEVFORK) || defined(__linux__) ++#if defined(POSIX_SPAWN_USEVFORK) || defined(__GLIBC__) + // Use USEVFORK on linux + flags |= POSIX_SPAWN_USEVFORK; + #endif + diff --git a/srcpkgs/libmemcached/template b/srcpkgs/libmemcached/template new file mode 100644 index 0000000000..ba203546f1 --- /dev/null +++ b/srcpkgs/libmemcached/template @@ -0,0 +1,34 @@ +# Template build file for 'libmemcached' +pkgname=libmemcached +version=1.0.18 +revision=1 +build_style=gnu-configure +configure_args="--prefix=/usr" +short_desc="C/C++ library to memcached" +maintainer="John Regan " +license="BSD" +homepage="http://libmemcached.org" +distfiles="http://launchpad.net/${pkgname}/1.0/${version}/+download/${pkgname}-${version}.tar.gz" +checksum="e22c0bb032fde08f53de9ffbc5a128233041d9f33b5de022c0978a2149885f82" +makedepends="libevent-devel libsasl-devel memcached-devel" +hostmakedepends="perl" +nocross="yes" + +libmemcached-devel_package() { + short_desc+=" - development files" + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove usr/include + vmove usr/lib/*.a + vmove usr/lib/*.so + vmove usr/lib/pkgconfig + } +} + +libmemcached-docs_package() { + short_desc+=" - documentation" + pkg_install() { + vmove "usr/share/man" + } +} +