commit:     318fd78385c5d25f4015461b8f0242a9c6ec25a1
Author:     Brahmajit Das <listout <AT> listout <DOT> xyz>
AuthorDate: Fri Jun 13 18:55:19 2025 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sat Jun 14 05:12:41 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=318fd783

dev-libs/cowsql: remove libuv 1.50* restriction

cowsql defines float_t to double in src/lib/serialize.h which conflicts
with newer libuv, since uv.h includes math.h for the definitions of
NAN/INFINITY.

This is a hack that changes the definitions of float_t to float_cow to
avoid conflict.

Please refer: cowsql/cowsql#35.

This mainly due to https://bugs.gentoo.org/957996, where
net-libs/nodejs-24.2.0 is failing due to missing new libuv.

Bug: https://bugs.gentoo.org/955693
Signed-off-by: Brahmajit Das <listout <AT> listout.xyz>
Part-of: https://github.com/gentoo/gentoo/pull/42579
Closes: https://github.com/gentoo/gentoo/pull/42579
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 dev-libs/cowsql/cowsql-1.15.7-r2.ebuild            | 56 ++++++++++++++++++++++
 ...erialize.h-don-t-define-double-as-float_t.patch | 54 +++++++++++++++++++++
 2 files changed, 110 insertions(+)

diff --git a/dev-libs/cowsql/cowsql-1.15.7-r2.ebuild 
b/dev-libs/cowsql/cowsql-1.15.7-r2.ebuild
new file mode 100644
index 000000000000..577cc7b107a1
--- /dev/null
+++ b/dev-libs/cowsql/cowsql-1.15.7-r2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 2020-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="Embeddable, replicated and fault tolerant SQL engine (fork of 
dqlite)"
+HOMEPAGE="https://cowsql.dev/ https://github.com/cowsql/cowsql";
+SRC_URI="https://github.com/cowsql/cowsql/archive/refs/tags/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="LGPL-3-with-linking-exception"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="dev-db/sqlite:3
+       dev-libs/libuv:=
+       >=dev-libs/raft-0.18.1:="
+DEPEND="${RDEPEND}
+       test? ( dev-libs/raft[lz4,test] )"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}"/dqlite-1.12.0-disable-werror.patch
+       
"${FILESDIR}"/0001-src-lib-serialize.h-don-t-define-double-as-float_t.patch
+)
+
+src_prepare() {
+       default
+       eautoreconf
+}
+
+src_configure() {
+       local myeconfargs=(
+               --disable-backtrace
+               --disable-debug
+               --disable-sanitize
+               --disable-static
+
+               # Will build a bundled libsqlite3.so.
+               --enable-build-sqlite=no
+       )
+
+       econf "${myeconfargs[@]}"
+}
+
+src_test() {
+       default
+}
+
+src_install() {
+       default
+       find "${ED}" -name '*.la' -delete || die
+}

diff --git 
a/dev-libs/cowsql/files/0001-src-lib-serialize.h-don-t-define-double-as-float_t.patch
 
b/dev-libs/cowsql/files/0001-src-lib-serialize.h-don-t-define-double-as-float_t.patch
new file mode 100644
index 000000000000..29e8a1c2390e
--- /dev/null
+++ 
b/dev-libs/cowsql/files/0001-src-lib-serialize.h-don-t-define-double-as-float_t.patch
@@ -0,0 +1,54 @@
+https://github.com/cowsql/cowsql/pull/37
+From: Brahmajit Das <[email protected]>
+Date: Sat, 14 Jun 2025 00:18:38 +0530
+Subject: [PATCH] src/lib/serialize.h: don't define double as float_t
+
+libuv with commit 85b526f makes uv.h include math.h for the definitions
+of NAN/INFINITY. That header also defines the ISO C standard float_t
+type. Now that that definition is in scope, the cowsql definition in
+src/lib/serialize.h conflicts with it.
+
+Fixes: 451cff63b29366237a9502823299b05bbff8662b
+Closes: https://github.com/cowsql/cowsql/issues/35
+Signed-off-by: Brahmajit Das <[email protected]>
+--- a/src/lib/serialize.h
++++ b/src/lib/serialize.h
+@@ -37,7 +37,7 @@ static_assert(sizeof(double) == sizeof(uint64_t),
+  * Basic type aliases to used by macro-based processing.
+  */
+ typedef const char *text_t;
+-typedef double float_t;
++typedef double cowsql_float;
+ typedef uv_buf_t blob_t;
+ 
+ /**
+@@ -143,7 +143,7 @@ COWSQL_INLINE size_t int64__sizeof(const int64_t *value)
+       return sizeof(int64_t);
+ }
+ 
+-COWSQL_INLINE size_t float__sizeof(const float_t *value)
++COWSQL_INLINE size_t float__sizeof(const cowsql_float *value)
+ {
+       (void)value;
+       return sizeof(double);
+@@ -190,7 +190,7 @@ COWSQL_INLINE void int64__encode(const int64_t *value, 
void **cursor)
+       *cursor += sizeof(int64_t);
+ }
+ 
+-COWSQL_INLINE void float__encode(const float_t *value, void **cursor)
++COWSQL_INLINE void float__encode(const cowsql_float *value, void **cursor)
+ {
+       *(uint64_t *)(*cursor) = ByteFlipLe64(*(uint64_t *)value);
+       *cursor += sizeof(uint64_t);
+@@ -273,7 +273,7 @@ COWSQL_INLINE int int64__decode(struct cursor *cursor, 
int64_t *value)
+       return 0;
+ }
+ 
+-COWSQL_INLINE int float__decode(struct cursor *cursor, float_t *value)
++COWSQL_INLINE int float__decode(struct cursor *cursor, cowsql_float *value)
+ {
+       size_t n = sizeof(double);
+       if (n > cursor->cap) {
+-- 
+2.49.0
+

Reply via email to