[packages/cowsql] - added cast.patch (memchr const-correctness under -Werror) instead of -Wno-error - raft floors 0.22

arekm arekm at pld-linux.org
Sun Sep 13 00:41:51 CEST 2026


commit d0d43f4235dfdfa14f391a889e94d69f2e9452db
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Sun Sep 13 00:17:08 2026 +0200

    - added cast.patch (memchr const-correctness under -Werror) instead of -Wno-error
    - raft floors 0.22.1, tests bcond, cowsql wording in descriptions

 cast.patch  | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 cowsql.spec | 48 +++++++++++++++++++++++++++-----------------
 2 files changed, 96 insertions(+), 18 deletions(-)
---
diff --git a/cowsql.spec b/cowsql.spec
index 9e39a6f..b43de02 100644
--- a/cowsql.spec
+++ b/cowsql.spec
@@ -1,3 +1,7 @@
+#
+# Conditional build:
+%bcond_without	tests		# do not perform "make check"
+#
 Summary:	Embeddable, replicated and fault tolerant SQL engine
 Name:		cowsql
 Version:	1.15.9
@@ -7,6 +11,7 @@ Group:		Libraries
 #Source0Download: https://github.com/cowsql/cowsql/releases
 Source0:	https://github.com/cowsql/cowsql/archive/v%{version}/%{name}-%{version}.tar.gz
 # Source0-md5:	cf46c3e372eaa2e06addb95ece4a9bd5
+Patch0:		cast.patch
 URL:		https://github.com/cowsql/cowsql
 BuildRequires:	autoconf >= 2.60
 BuildRequires:	automake >= 1:1.11
@@ -16,60 +21,67 @@ BuildRequires:	pkgconfig
 BuildRequires:	raft-devel >= 0.22.1
 BuildRequires:	sqlite3-devel >= 3.22.0
 Requires:	libuv >= 1.8.0
-Requires:	raft >= 0.18.0
+Requires:	raft >= 0.22.1
 Requires:	sqlite3 >= 3.22.0
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
-This package is a fork the dqlite C library (libdqlite), which can be
-used to expose a dqlite database over the network and replicate it
-across a cluster of peers, using the Raft algorithm.
+cowsql is a C library implementing an embeddable, replicated SQL
+database engine with high availability and automatic failover. It is a
+fork of dqlite and uses the Raft algorithm to replicate an SQLite
+database across a cluster of peers.
 
 %description -l pl.UTF-8
-Ten pakiet zawiera fork biblioteki C dqlite (libdqlite), którą można
-wykorzystywać do udostępnienia bazy danych dqlite przez sieć i
-replikować ją na klaster partnerów przy użyciu algorytmu Raft.
+cowsql to biblioteka C implementująca osadzalny, replikowany silnik
+bazodanowy SQL o wysokiej dostępności i automatycznym przełączaniu
+awaryjnym. Jest to fork biblioteki dqlite, wykorzystujący algorytm Raft
+do replikowania bazy SQLite na klastrze węzłów.
 
 %package devel
-Summary:	Header files for dqlite development
-Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki dqlite
+Summary:	Header files for cowsql library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki cowsql
 Group:		Development/Libraries
 Requires:	%{name} = %{version}-%{release}
 Requires:	libuv-devel >= 1.8.0
-Requires:	raft-devel >= 0.14.0
+Requires:	raft-devel >= 0.22.1
 Requires:	sqlite3-devel >= 3.22.0
 
 %description devel
-This package contains development files for the dqlite library.
+Header files for cowsql library.
 
 %description devel -l pl.UTF-8
-Ten pakiet zawiera pliki nagłówkowe biblioteki dqlite.
+Pliki nagłówkowe biblioteki cowsql.
 
 %package static
-Summary:	Static dqlite library
-Summary(pl.UTF-8):	Statyczna biblioteka dqlite
+Summary:	Static cowsql library
+Summary(pl.UTF-8):	Statyczna biblioteka cowsql
 Group:		Development/Libraries
 Requires:	%{name}-devel = %{version}-%{release}
 
 %description static
-This package contains static dqlite library.
+Static cowsql library.
 
 %description static -l pl.UTF-8
-Ten pakiet zawiera bibliotekę statyczną dqlite.
+Statyczna biblioteka cowsql.
 
 %prep
 %setup -q
+%patch -P0 -p1
 
 %build
 %{__libtoolize}
 %{__aclocal} -I m4
 %{__autoconf}
 %{__automake}
-CFLAGS="-Wno-error %{rpmcflags}" %configure \
+%configure \
 	--disable-silent-rules
 
 %{__make}
 
+%if %{with tests}
+%{__make} check
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 
@@ -77,7 +89,7 @@ rm -rf $RPM_BUILD_ROOT
 	DESTDIR=$RPM_BUILD_ROOT
 
 # obsoleted by pkg-config
-%{__rm} -rf $RPM_BUILD_ROOT%{_libdir}/libcowsql.la
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libcowsql.la
 
 %clean
 rm -rf $RPM_BUILD_ROOT
diff --git a/cast.patch b/cast.patch
new file mode 100644
index 0000000..37903dc
--- /dev/null
+++ b/cast.patch
@@ -0,0 +1,66 @@
+glibc >= 2.42 makes memchr() const-correct, so assigning its result to char * fails under upstream's -Werror
+--- cowsql-1.15.9.orig/src/server.c	2025-07-11 12:18:16.000000000 +0200
++++ cowsql-1.15.9/src/server.c	2026-09-12 23:56:08.094235933 +0200
+@@ -1017,7 +1017,7 @@ static int parseNodeStore(char *buf, siz
+ 	struct client_node_info info;
+ 
+ 	version_str = p;
+-	nl = memchr(p, '\n', (size_t)(end - version_str));
++	nl = (char *)memchr(p, '\n', (size_t)(end - version_str));
+ 	if (nl == NULL) {
+ 		return 1;
+ 	}
+@@ -1029,7 +1029,7 @@ static int parseNodeStore(char *buf, siz
+ 
+ 	while (p != end) {
+ 		addr = p;
+-		nl = memchr(p, '\n', (size_t)(end - addr));
++		nl = (char *)memchr(p, '\n', (size_t)(end - addr));
+ 		if (nl == NULL) {
+ 			return 1;
+ 		}
+@@ -1037,7 +1037,7 @@ static int parseNodeStore(char *buf, siz
+ 		p = nl + 1;
+ 
+ 		id_str = p;
+-		nl = memchr(p, '\n', (size_t)(end - id_str));
++		nl = (char *)memchr(p, '\n', (size_t)(end - id_str));
+ 		if (nl == NULL) {
+ 			return 1;
+ 		}
+@@ -1056,7 +1056,7 @@ static int parseNodeStore(char *buf, siz
+ 		}
+ 
+ 		role_str = p;
+-		nl = memchr(p, '\n', (size_t)(end - role_str));
++		nl = (char *)memchr(p, '\n', (size_t)(end - role_str));
+ 		if (nl == NULL) {
+ 			return 1;
+ 		}
+@@ -1153,7 +1153,7 @@ static int parseLocalInfo(char *buf,
+ 	unsigned long long id;
+ 
+ 	version_str = p;
+-	nl = memchr(version_str, '\n', (size_t)(end - version_str));
++	nl = (char *)memchr(version_str, '\n', (size_t)(end - version_str));
+ 	if (nl == NULL) {
+ 		return 1;
+ 	}
+@@ -1164,7 +1164,7 @@ static int parseLocalInfo(char *buf,
+ 	}
+ 
+ 	addr = p;
+-	nl = memchr(addr, '\n', (size_t)(end - addr));
++	nl = (char *)memchr(addr, '\n', (size_t)(end - addr));
+ 	if (nl == NULL) {
+ 		return 1;
+ 	}
+@@ -1172,7 +1172,7 @@ static int parseLocalInfo(char *buf,
+ 	p = nl + 1;
+ 
+ 	id_str = p;
+-	nl = memchr(id_str, '\n', (size_t)(end - id_str));
++	nl = (char *)memchr(id_str, '\n', (size_t)(end - id_str));
+ 	if (nl == NULL) {
+ 		return 1;
+ 	}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cowsql.git/commitdiff/d0d43f4235dfdfa14f391a889e94d69f2e9452db



More information about the pld-cvs-commit mailing list