Skip to content

Commit 8bb8408

Browse files
committed
cowsql: fix build failure from libuv conflict
1 parent 0e2d1a7 commit 8bb8408

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

pkgs/by-name/co/cowsql/37.patch

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
From c0d7c99632ea2ee01066988708cbb41f335cbdc3 Mon Sep 17 00:00:00 2001
2+
From: Brahmajit Das <[email protected]>
3+
Date: Sat, 14 Jun 2025 00:18:38 +0530
4+
Subject: [PATCH] src/lib/serialize.h: don't define double as float_t
5+
6+
libuv with commit 85b526f makes uv.h include math.h for the definitions
7+
of NAN/INFINITY. That header also defines the ISO C standard float_t
8+
type. Now that that definition is in scope, the cowsql definition in
9+
src/lib/serialize.h conflicts with it.
10+
11+
Fixes: 451cff63b29366237a9502823299b05bbff8662b
12+
Closes: https://github.com/cowsql/cowsql/issues/35
13+
Signed-off-by: Brahmajit Das <[email protected]>
14+
---
15+
src/lib/serialize.h | 8 ++++----
16+
1 file changed, 4 insertions(+), 4 deletions(-)
17+
18+
diff --git a/src/lib/serialize.h b/src/lib/serialize.h
19+
index 9fbd49c..a7f9147 100644
20+
--- a/src/lib/serialize.h
21+
+++ b/src/lib/serialize.h
22+
@@ -37,7 +37,7 @@ static_assert(sizeof(double) == sizeof(uint64_t),
23+
* Basic type aliases to used by macro-based processing.
24+
*/
25+
typedef const char *text_t;
26+
-typedef double float_t;
27+
+typedef double cowsql_float;
28+
typedef uv_buf_t blob_t;
29+
30+
/**
31+
@@ -143,7 +143,7 @@ COWSQL_INLINE size_t int64__sizeof(const int64_t *value)
32+
return sizeof(int64_t);
33+
}
34+
35+
-COWSQL_INLINE size_t float__sizeof(const float_t *value)
36+
+COWSQL_INLINE size_t float__sizeof(const cowsql_float *value)
37+
{
38+
(void)value;
39+
return sizeof(double);
40+
@@ -190,7 +190,7 @@ COWSQL_INLINE void int64__encode(const int64_t *value, void **cursor)
41+
*cursor += sizeof(int64_t);
42+
}
43+
44+
-COWSQL_INLINE void float__encode(const float_t *value, void **cursor)
45+
+COWSQL_INLINE void float__encode(const cowsql_float *value, void **cursor)
46+
{
47+
*(uint64_t *)(*cursor) = ByteFlipLe64(*(uint64_t *)value);
48+
*cursor += sizeof(uint64_t);
49+
@@ -273,7 +273,7 @@ COWSQL_INLINE int int64__decode(struct cursor *cursor, int64_t *value)
50+
return 0;
51+
}
52+
53+
-COWSQL_INLINE int float__decode(struct cursor *cursor, float_t *value)
54+
+COWSQL_INLINE int float__decode(struct cursor *cursor, cowsql_float *value)
55+
{
56+
size_t n = sizeof(double);
57+
if (n > cursor->cap) {

pkgs/by-name/co/cowsql/package.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ stdenv.mkDerivation (finalAttrs: {
2222
hash = "sha256-rwTa9owtnkyI9OpUKLk6V7WbAkqlYucpGzPnHHvKW/A=";
2323
};
2424

25+
patches = [
26+
# fix libuv changes. review removal in > 1.15.8
27+
# https://github.com/cowsql/cowsql/pull/37
28+
./37.patch
29+
];
30+
2531
nativeBuildInputs = [
2632
autoreconfHook
2733
pkg-config

0 commit comments

Comments
 (0)