git.iko.soy/typeable/nixpkgs
on master help sign in
rethinkdb: patch for glibc 2.23
commite5069c1be590df367f9f2e3085bc238cf053d285 authorDomen Kožar <domen@dev.si> dateTue 1 Mar 2016, 14:13 (11 years ago) parent7eb1526
2 files changed+113
pkgs/servers/nosql/rethinkdb/default.nix+2 pkgs/servers/nosql/rethinkdb/glibc-2.23.patch+111
pkgs/servers/nosql/rethinkdb/default.nix+2
@@ -11,6 +11,8 @@ stdenv.mkDerivation rec {
1111 sha256 = "0zs07g7arrrvm85mqbkffyzgd255qawn64r6iqdws25lj1kq2qim";
1212 };
1313
14+ patches = [ ./glibc-2.23.patch ];
15+
1416 postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
1517 sed -i 's/raise.*No Xcode or CLT version detected.*/version = "7.0.0"/' external/v8_3.30.33.16/build/gyp/pylib/gyp/xcode_emulation.py
1618
pkgs/servers/nosql/rethinkdb/glibc-2.23.patchnew file+111
@@ -0,0 +1,111 @@
1+From 84be09f314c4cbf88b4ac8fe9dbff1d36f0f5781 Mon Sep 17 00:00:00 2001
2+From: Daniel Mewes <daniel@rethinkdb.com>
3+Date: Fri, 5 Feb 2016 18:45:28 -0800
4+Subject: [PATCH] Alpinelinux compilation fixes
5+
6+by @clandmeter
7+---
8+ src/containers/buffer_group.hpp | 1 +
9+ src/containers/printf_buffer.hpp | 1 +
10+ src/errors.cc | 2 +-
11+ src/rdb_protocol/geo/s2/util/math/exactfloat/exactfloat.cc | 4 ++--
12+ src/rdb_protocol/geo/s2/util/math/mathlimits.h | 12 ++++++------
13+ src/threading.hpp | 2 ++
14+ 6 files changed, 13 insertions(+), 9 deletions(-)
15+
16+diff --git a/src/containers/buffer_group.hpp b/src/containers/buffer_group.hpp
17+index 865c5cb..0403db6 100644
18+--- a/src/containers/buffer_group.hpp
19++++ b/src/containers/buffer_group.hpp
20+@@ -3,6 +3,7 @@
21+ #define CONTAINERS_BUFFER_GROUP_HPP_
22+
23+ #include <stdlib.h>
24++#include <sys/types.h>
25+ #include <unistd.h>
26+ #include <vector>
27+
28+diff --git a/src/containers/printf_buffer.hpp b/src/containers/printf_buffer.hpp
29+index b7a5154..76959f3 100644
30+--- a/src/containers/printf_buffer.hpp
31++++ b/src/containers/printf_buffer.hpp
32+@@ -5,6 +5,7 @@
33+ #include <stdarg.h>
34+ #include <stdio.h>
35+ #include <string.h>
36++#include <sys/types.h>
37+
38+ // Cannot include utils.hpp, we are included by utils.hpp.
39+ #include "errors.hpp"
40+diff --git a/src/errors.cc b/src/errors.cc
41+index d40c04f..39efc9f 100644
42+--- a/src/errors.cc
43++++ b/src/errors.cc
44+@@ -89,7 +89,7 @@ void report_fatal_error(const char *file, int line, const char *msg, ...) {
45+ }
46+
47+ const char *errno_string_maybe_using_buffer(int errsv, char *buf, size_t buflen) {
48+-#ifdef _GNU_SOURCE
49++#ifdef __GLIBC__
50+ return strerror_r(errsv, buf, buflen);
51+ #elif defined(_WIN32)
52+ UNUSED errno_t res = strerror_s(buf, buflen, errsv);
53+diff --git a/src/rdb_protocol/geo/s2/util/math/exactfloat/exactfloat.cc b/src/rdb_protocol/geo/s2/util/math/exactfloat/exactfloat.cc
54+index 3b07392..aa1a1d3 100644
55+--- a/src/rdb_protocol/geo/s2/util/math/exactfloat/exactfloat.cc
56++++ b/src/rdb_protocol/geo/s2/util/math/exactfloat/exactfloat.cc
57+@@ -110,9 +110,9 @@ static int BN_ext_count_low_zero_bits(const BIGNUM* bn) {
58+ ExactFloat::ExactFloat(double v) {
59+ BN_init(&bn_);
60+ sign_ = signbit(v) ? -1 : 1;
61+- if (isnan(v)) {
62++ if (std::isnan(v)) {
63+ set_nan();
64+- } else if (isinf(v)) {
65++ } else if (std::isinf(v)) {
66+ set_inf(sign_);
67+ } else {
68+ // The following code is much simpler than messing about with bit masks,
69+diff --git a/src/rdb_protocol/geo/s2/util/math/mathlimits.h b/src/rdb_protocol/geo/s2/util/math/mathlimits.h
70+index 5148422..86af72d 100644
71+--- a/src/rdb_protocol/geo/s2/util/math/mathlimits.h
72++++ b/src/rdb_protocol/geo/s2/util/math/mathlimits.h
73+@@ -14,7 +14,7 @@
74+ #define UTIL_MATH_MATHLIMITS_H__
75+
76+ #include <string.h>
77+-#include <math.h>
78++#include <cmath>
79+ #include <cfloat>
80+
81+ #include "rdb_protocol/geo/s2/base/basictypes.h"
82+@@ -195,11 +195,11 @@ DECL_UNSIGNED_INT_LIMITS(unsigned long long int)
83+ static bool IsNegInf(const Type x) { return _fpclass(x) == _FPCLASS_NINF; }
84+ #else
85+ #define DECL_FP_LIMIT_FUNCS \
86+- static bool IsFinite(const Type x) { return !isinf(x) && !isnan(x); } \
87+- static bool IsNaN(const Type x) { return isnan(x); } \
88+- static bool IsInf(const Type x) { return isinf(x); } \
89+- static bool IsPosInf(const Type x) { return isinf(x) && x > 0; } \
90+- static bool IsNegInf(const Type x) { return isinf(x) && x < 0; }
91++ static bool IsFinite(const Type x) { return !std::isinf(x) && !std::isnan(x); } \
92++ static bool IsNaN(const Type x) { return std::isnan(x); } \
93++ static bool IsInf(const Type x) { return std::isinf(x); } \
94++ static bool IsPosInf(const Type x) { return std::isinf(x) && x > 0; } \
95++ static bool IsNegInf(const Type x) { return std::isinf(x) && x < 0; }
96+ #endif
97+
98+ // We can't put floating-point constant values in the header here because
99+diff --git a/src/threading.hpp b/src/threading.hpp
100+index 14fc6a8..9bf033f 100644
101+--- a/src/threading.hpp
102++++ b/src/threading.hpp
103+@@ -1,6 +1,8 @@
104+ #ifndef THREADING_HPP_
105+ #define THREADING_HPP_
106+
107++#include <sys/types.h>
108++#include <unistd.h>
109+ #include <functional>
110+ #include <vector>
111+