uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
35
pkgs/development/libraries/libmemcached/default.nix
Normal file
35
pkgs/development/libraries/libmemcached/default.nix
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
{ lib, stdenv, fetchurl, fetchpatch, cyrus_sasl, libevent }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "libmemcached";
|
||||
version = "1.0.18";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://launchpad.net/libmemcached/${lib.versions.majorMinor version}/${version}/+download/libmemcached-${version}.tar.gz";
|
||||
sha256 = "10jzi14j32lpq0if0p9vygcl2c1352hwbywzvr9qzq7x6aq0nb72";
|
||||
};
|
||||
|
||||
# Fix linking against libpthread (patch from Fedora)
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1037707
|
||||
# https://bugs.launchpad.net/libmemcached/+bug/1281907
|
||||
# Fix building on macOS (patch from Homebrew)
|
||||
# https://bugs.launchpad.net/libmemcached/+bug/1245562
|
||||
patches = lib.optional stdenv.isLinux ./libmemcached-fix-linking-with-libpthread.patch
|
||||
++ lib.optional stdenv.isDarwin (fetchpatch {
|
||||
url = "https://raw.githubusercontent.com/Homebrew/homebrew/bfd4a0a4626b61c2511fdf573bcbbc6bbe86340e/Library/Formula/libmemcached.rb";
|
||||
sha256 = "1gjf3vd7hiyzxjvlg2zfc3y2j0lyr6nhbws4xb5dmin3csyp8qb8";
|
||||
})
|
||||
++ lib.optional stdenv.hostPlatform.isMusl ./musl-fixes.patch;
|
||||
|
||||
buildInputs = [ libevent ];
|
||||
propagatedBuildInputs = [ cyrus_sasl ];
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-fpermissive";
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://libmemcached.org";
|
||||
description = "Open source C/C++ client library and tools for the memcached server";
|
||||
license = licenses.bsd3;
|
||||
platforms = platforms.linux ++ platforms.darwin;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
diff -up libmemcached-1.0.16/build-aux/ltmain.sh.orig libmemcached-1.0.16/build-aux/ltmain.sh
|
||||
--- libmemcached-1.0.16/build-aux/ltmain.sh.orig 2013-12-03 16:36:53.222107642 +0100
|
||||
+++ libmemcached-1.0.16/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
|
||||
;;
|
||||
|
||||
58
pkgs/development/libraries/libmemcached/musl-fixes.patch
Normal file
58
pkgs/development/libraries/libmemcached/musl-fixes.patch
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
diff --git a/libhashkit/fnv_64.cc b/libhashkit/fnv_64.cc
|
||||
index 68e4dd0..64656b7 100644
|
||||
--- a/libhashkit/fnv_64.cc
|
||||
+++ b/libhashkit/fnv_64.cc
|
||||
@@ -37,8 +37,9 @@
|
||||
|
||||
|
||||
#include <libhashkit/common.h>
|
||||
+#include <limits.h>
|
||||
|
||||
-#if __WORDSIZE == 64 && defined(HAVE_FNV64_HASH)
|
||||
+#if (LONG_BITS == 64) && defined(HAVE_FNV64_HASH)
|
||||
|
||||
/* FNV hash'es lifted from Dustin Sallings work */
|
||||
static uint64_t FNV_64_INIT= 0xcbf29ce484222325;
|
||||
diff --git a/libhashkit/has.cc b/libhashkit/has.cc
|
||||
index 843e32e..4153e5e 100644
|
||||
--- a/libhashkit/has.cc
|
||||
+++ b/libhashkit/has.cc
|
||||
@@ -37,6 +37,7 @@
|
||||
|
||||
|
||||
#include <libhashkit/common.h>
|
||||
+#include <limits.h>
|
||||
|
||||
bool libhashkit_has_algorithm(const hashkit_hash_algorithm_t algo)
|
||||
{
|
||||
@@ -44,7 +45,7 @@ bool libhashkit_has_algorithm(const hashkit_hash_algorithm_t algo)
|
||||
{
|
||||
case HASHKIT_HASH_FNV1_64:
|
||||
case HASHKIT_HASH_FNV1A_64:
|
||||
-#if __WORDSIZE == 64 && defined(HAVE_FNV64_HASH)
|
||||
+#if (LONG_BITS == 64) && defined(HAVE_FNV64_HASH)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
diff --git a/libtest/cmdline.cc b/libtest/cmdline.cc
|
||||
index 29a22de..161c646 100644
|
||||
--- a/libtest/cmdline.cc
|
||||
+++ b/libtest/cmdline.cc
|
||||
@@ -61,7 +61,7 @@ using namespace libtest;
|
||||
#include <algorithm>
|
||||
#include <stdexcept>
|
||||
|
||||
-#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
|
||||
Loading…
Add table
Add a link
Reference in a new issue