trickle: fix build (#434711)
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
diff --git i/atomicio.c w/atomicio.c
|
||||
index 3930a07..81a14a4 100644
|
||||
--- i/atomicio.c
|
||||
+++ w/atomicio.c
|
||||
@@ -37,11 +37,7 @@
|
||||
* ensure all of data on socket comes through. f==read || f==write
|
||||
*/
|
||||
ssize_t
|
||||
-atomicio(f, fd, _s, n)
|
||||
- ssize_t (*f) ();
|
||||
- int fd;
|
||||
- void *_s;
|
||||
- size_t n;
|
||||
+atomicio(ssize_t (*f)(int, const void *, size_t), int fd, const void *_s, size_t n)
|
||||
{
|
||||
char *s = _s;
|
||||
ssize_t res, pos = 0;
|
||||
diff --git i/util.h w/util.h
|
||||
index b00059c..f24d0c3 100644
|
||||
--- i/util.h
|
||||
+++ w/util.h
|
||||
@@ -41,7 +41,7 @@
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
-ssize_t atomicio(ssize_t (*)(), int, void *, size_t);
|
||||
+ssize_t atomicio(ssize_t (*f)(int, const void *, size_t), int fd, const void *s, size_t n);
|
||||
char *get_progname(char *);
|
||||
|
||||
|
||||
@@ -1,38 +1,57 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
fetchurl,
|
||||
fetchFromGitHub,
|
||||
autoreconfHook,
|
||||
libevent,
|
||||
libtirpc,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation {
|
||||
pname = "trickle";
|
||||
version = "1.07";
|
||||
version = "1.07-unstable-2019-10-03";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://monkey.org/~marius/trickle/trickle-${version}.tar.gz";
|
||||
sha256 = "0s1qq3k5mpcs9i7ng0l9fvr1f75abpbzfi1jaf3zpzbs1dz50dlx";
|
||||
src = fetchFromGitHub {
|
||||
owner = "mariusae";
|
||||
repo = "trickle";
|
||||
rev = "09a1d955c6554eb7e625c99bf96b2d99ec7db3dc";
|
||||
sha256 = "sha256-cqkNPeTo+noqMCXsxh6s4vKoYwsWusafm/QYX8RvCek=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./trickle-gcc14.patch
|
||||
./atomicio.patch
|
||||
./remove-libtrickle.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
libevent
|
||||
libtirpc
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
sed -i 's|libevent.a|libevent.so|' configure
|
||||
preAutoreconf = ''
|
||||
sed -i -e 's|\s*LIBCGUESS=.*|LIBCGUESS=${stdenv.cc.libc}/lib/libc.so.*|' configure.in
|
||||
grep LIBCGUESS configure.in
|
||||
sed -i 's|libevent.a|libevent.so|' configure.in
|
||||
'';
|
||||
|
||||
preBuild = ''
|
||||
sed -i '/#define in_addr_t/ s:^://:' config.h
|
||||
sed -i 's|^_select(int|select(int|' trickle-overload.c
|
||||
'';
|
||||
|
||||
NIX_LDFLAGS = [
|
||||
"-levent"
|
||||
"-ltirpc"
|
||||
];
|
||||
env.NIX_CFLAGS_COMPILE = toString [ "-I${libtirpc.dev}/include/tirpc" ];
|
||||
env.NIX_CFLAGS_COMPILE = toString [
|
||||
"-I${libtirpc.dev}/include/tirpc"
|
||||
"-Wno-error=incompatible-pointer-types"
|
||||
];
|
||||
|
||||
configureFlags = [ "--with-libevent" ];
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
diff --git i/Makefile.am w/Makefile.am
|
||||
index 9c2bbf3..0b0023e 100644
|
||||
--- i/Makefile.am
|
||||
+++ w/Makefile.am
|
||||
@@ -30,12 +30,6 @@ tricklectl_LDADD = @ERRO@ $(LIBOBJS)
|
||||
|
||||
AM_CFLAGS = -Wall -Icompat @EVENTINC@
|
||||
|
||||
-overloaddir = $(libdir)
|
||||
-overload_DATA = libtrickle.so
|
||||
-
|
||||
-libtrickle.so: trickle-overload.c atomicio.c
|
||||
-$(overload_DATA):
|
||||
-
|
||||
CLEANFILES = *.so
|
||||
|
||||
EXTRA_DIST = LICENSE README strlcat.c strlcpy.c err.c Makefile.am.inc \
|
||||
@@ -0,0 +1,25 @@
|
||||
diff --git a/configure.in b/configure.in
|
||||
index 6ebf3b2..5c85682 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -198,6 +198,7 @@ if test "$HAVEMETHOD" = "no"; then
|
||||
AC_TRY_RUN(
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
+ #include <stdlib.h>
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
diff --git a/xdr.c b/xdr.c
|
||||
index ed8bf5b..a20bbd9 100644
|
||||
--- a/xdr.c
|
||||
+++ b/xdr.c
|
||||
@@ -103,7 +103,7 @@ xdr_msg(XDR *xdrs, struct msg *msg)
|
||||
{
|
||||
X(xdr_short(xdrs, &msg->status));
|
||||
X(xdr_union(xdrs, (int *)&msg->type, (char *)&msg->data,
|
||||
- xdr_msg_discrim, _xdr_void));
|
||||
+ xdr_msg_discrim, (xdrproc_t)_xdr_void));
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
Reference in New Issue
Block a user