public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-misc/clockspeed/files/, net-misc/clockspeed/
@ 2024-02-01 14:15 Joonas Niilola
  0 siblings, 0 replies; only message in thread
From: Joonas Niilola @ 2024-02-01 14:15 UTC (permalink / raw
  To: gentoo-commits

commit:     00eb1d6f814de72e8ae3e2d5b267e39ebcc0e346
Author:     Pascal Jäger <pascal.jaeger <AT> leimstift <DOT> de>
AuthorDate: Tue Oct  3 11:03:35 2023 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Thu Feb  1 14:15:14 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00eb1d6f

net-misc/clockspeed: fix build for clang16

update EAPI 7 -> 8

Closes: https://bugs.gentoo.org/882307

Signed-off-by: Pascal Jäger <pascal.jaeger <AT> leimstift.de>
Closes: https://github.com/gentoo/gentoo/pull/33166
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 net-misc/clockspeed/clockspeed-0.62-r9.ebuild      |  47 +++++
 .../files/clockspeed-0.62-fix-clang16-build.patch  | 212 +++++++++++++++++++++
 2 files changed, 259 insertions(+)

diff --git a/net-misc/clockspeed/clockspeed-0.62-r9.ebuild b/net-misc/clockspeed/clockspeed-0.62-r9.ebuild
new file mode 100644
index 000000000000..5607768def91
--- /dev/null
+++ b/net-misc/clockspeed/clockspeed-0.62-r9.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit flag-o-matic toolchain-funcs
+
+DESCRIPTION="Simple Network Time Protocol (NTP) client"
+HOMEPAGE="https://cr.yp.to/clockspeed.html"
+
+# this is the trailing part of the name for the latest leapseconds file.
+LEAPSECONDS_DATE="20081114"
+
+SRC_URI="https://cr.yp.to/clockspeed/${P}.tar.gz
+	https://dev.gentoo.org/~pacho/maintainer-needed/leapsecs.dat."$LEAPSECONDS_DATE""
+
+# http://cr.yp.to/distributors.html
+LICENSE="public-domain"
+SLOT="0"
+KEYWORDS="~amd64 ~mips ~x86"
+IUSE="static selinux"
+RESTRICT="mirror bindist test"
+
+DEPEND="sys-apps/groff"
+RDEPEND="net-dns/djbdns"
+
+PATCHES=(
+	"${FILESDIR}"/${P}-gentoo.patch
+	"${FILESDIR}"/${P}-fix-clang16-build.patch
+)
+
+src_configure() {
+	echo "$(tc-getCC) ${CFLAGS} ${ASFLAGS}" > conf-cc || die
+	use static && append-ldflags -static
+	echo "$(tc-getCC) ${LDFLAGS}" > conf-ld || die
+}
+
+src_install() {
+	dobin clockspeed clockadd clockview sntpclock taiclock taiclockd
+	dosbin "${FILESDIR}"/ntpclockset
+
+	doman *.1
+	dodoc BLURB CHANGES INSTALL README THANKS TODO
+
+	insinto /var/lib/clockspeed
+	newins "${DISTDIR}"/leapsecs.dat."$LEAPSECONDS_DATE" leapsecs.dat
+}

diff --git a/net-misc/clockspeed/files/clockspeed-0.62-fix-clang16-build.patch b/net-misc/clockspeed/files/clockspeed-0.62-fix-clang16-build.patch
new file mode 100644
index 000000000000..66bc89d0c261
--- /dev/null
+++ b/net-misc/clockspeed/files/clockspeed-0.62-fix-clang16-build.patch
@@ -0,0 +1,212 @@
+Since clang16 implicit function declarations and implicit integers
+result in a compilation error.
+
+Bug: https://bugs.gentoo.org/882307 
+Patch has been sent upstream via mail
+
+Pascal Jäger <pascal.jaeger@leimstift.de> (2023-10-03)
+
+--- a/clockspeed.c
++++ b/clockspeed.c
+@@ -1,6 +1,7 @@
++#include <stdio.h>
++#include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+-#include "readwrite.h"
+ #include "exit.h"
+ #include "select.h"
+ #include "scan.h"
+@@ -11,11 +12,12 @@
+ #include "error.h"
+ #include "auto_home.h"
+ #include "timing.h"
++#include "unistd.h"
+ 
+ #ifndef HASRDTSC
+ #ifndef HASGETHRTIME
+ 
+-  Error! Need an unadjusted hardware clock.
++#error Need an unadjusted hardware clock.
+ 
+ #endif
+ #endif
+--- a/clockview.c
++++ b/clockview.c
+@@ -1,3 +1,4 @@
++#include <sys/time.h>
+ #include <sys/types.h>
+ #include <time.h>
+ #include "substdio.h"
+--- a/hier.c
++++ b/hier.c
+@@ -1,5 +1,24 @@
+ #include "auto_home.h"
+ 
++extern void h(char *home,
++int uid,
++int gid,
++int mode);
++
++extern void d(char *home,
++char *subdir,
++int uid,
++int gid,
++int mode);
++
++extern void c(
++char *home,
++char *subdir,
++char *file,
++int uid,
++int gid,
++int mode);
++
+ void hier()
+ {
+   d("/var/lib","clockspeed",-1,-1,0755);
+--- a/install.c
++++ b/install.c
+@@ -2,8 +2,9 @@
+ #include "strerr.h"
+ #include "error.h"
+ #include "open.h"
+-#include "readwrite.h"
+ #include "exit.h"
++#include <sys/stat.h>
++#include <unistd.h>
+ 
+ extern void hier();
+ 
+--- a/instcheck.c
++++ b/instcheck.c
+@@ -2,8 +2,9 @@
+ #include <sys/stat.h>
+ #include "strerr.h"
+ #include "error.h"
+-#include "readwrite.h"
+ #include "exit.h"
++#include <sys/stat.h>
++#include <unistd.h>
+ 
+ extern void hier();
+ 
+--- a/leapsecs_read.c
++++ b/leapsecs_read.c
+@@ -1,7 +1,9 @@
++#include <stdlib.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ #include <errno.h>
++#include <unistd.h>
+ #include "tai.h"
+ #include "leapsecs.h"
+ 
+--- a/sntpclock.c
++++ b/sntpclock.c
+@@ -3,12 +3,12 @@
+ #include <sys/param.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
++#include <unistd.h>
+ #include "strerr.h"
+ #include "ip.h"
+ #include "str.h"
+ #include "byte.h"
+ #include "substdio.h"
+-#include "readwrite.h"
+ #include "select.h"
+ #include "scan.h"
+ #include "leapsecs.h"
+@@ -79,7 +79,7 @@ int flagleap;
+ }
+ 
+ char outbuf[16];
+-substdio ssout = SUBSTDIO_FDBUF(write,1,outbuf,sizeof outbuf);
++substdio ssout = SUBSTDIO_FDBUF((int(*)())write,1,outbuf,sizeof outbuf);
+ 
+ #define FATAL "sntpclock: fatal: "
+ #define WARNING "sntpclock: warning: "
+--- a/taiclock.c
++++ b/taiclock.c
+@@ -3,17 +3,17 @@
+ #include <sys/param.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
++#include <unistd.h>
+ #include "strerr.h"
+ #include "ip.h"
+ #include "str.h"
+ #include "byte.h"
+ #include "substdio.h"
+-#include "readwrite.h"
+ #include "select.h"
+ #include "taia.h"
+ 
+ char outbuf[16];
+-substdio ssout = SUBSTDIO_FDBUF(write,1,outbuf,sizeof outbuf);
++substdio ssout = SUBSTDIO_FDBUF((int(*)())write,1,outbuf,sizeof outbuf);
+ 
+ #define FATAL "taiclock: fatal: "
+ #define WARNING "taiclock: warning: "
+
+--- a/auto-str.c
++++ b/auto-str.c
+@@ -5,7 +5,7 @@
+ char buf1[256];
+ substdio ss1 = SUBSTDIO_FDBUF(write,1,buf1,sizeof(buf1));
+ 
+-void puts(s)
++void myputs(s)
+ char *s;
+ {
+   if (substdio_puts(&ss1,s) == -1) _exit(111);
+@@ -25,20 +25,20 @@ char **argv;
+   value = argv[2];
+   if (!value) _exit(100);
+ 
+-  puts("char ");
+-  puts(name);
+-  puts("[] = \"\\\n");
++  myputs("char ");
++  myputs(name);
++  myputs("[] = \"\\\n");
+ 
+   while (ch = *value++) {
+-    puts("\\");
++    myputs("\\");
+     octal[3] = 0;
+     octal[2] = '0' + (ch & 7); ch >>= 3;
+     octal[1] = '0' + (ch & 7); ch >>= 3;
+     octal[0] = '0' + (ch & 7);
+-    puts(octal);
++    myputs(octal);
+   }
+ 
+-  puts("\\\n\";\n");
++  myputs("\\\n\";\n");
+   if (substdio_flush(&ss1) == -1) _exit(111);
+   _exit(0);
+ }
+--- a/trygethr.c
++++ b/trygethr.c
+@@ -1,7 +1,7 @@
+ #include <sys/types.h>
+ #include <sys/time.h>
+ 
+-main()
++int main()
+ {
+   hrtime_t t;
+ 
+--- a/tryrdtsc.c
++++ b/tryrdtsc.c
+@@ -1,4 +1,6 @@
+-main()
++#include <unistd.h>
++
++int main()
+ {
+   unsigned long x[2];
+   unsigned long y[2];


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-01 14:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-01 14:15 [gentoo-commits] repo/gentoo:master commit in: net-misc/clockspeed/files/, net-misc/clockspeed/ Joonas Niilola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox