pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/games/fortune fortune: fix build on Linux
details: https://anonhg.NetBSD.org/pkgsrc/rev/852970f30987
branches: trunk
changeset: 455116:852970f30987
user: tnn <tnn%pkgsrc.org@localhost>
date: Mon Jun 28 11:20:55 2021 +0000
description:
fortune: fix build on Linux
diffstat:
games/fortune/distinfo | 4 ++--
games/fortune/patches/patch-fortune_fortune.c | 13 +++++++++----
2 files changed, 11 insertions(+), 6 deletions(-)
diffs (60 lines):
diff -r f1f3008af7cd -r 852970f30987 games/fortune/distinfo
--- a/games/fortune/distinfo Mon Jun 28 10:43:00 2021 +0000
+++ b/games/fortune/distinfo Mon Jun 28 11:20:55 2021 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.1 2017/08/07 11:10:32 jperkin Exp $
+$NetBSD: distinfo,v 1.2 2021/06/28 11:20:55 tnn Exp $
SHA1 (fortune-mod-9708.tar.gz) = 9f96a00dbf5d2c6b0e7324af0eae988ce6adc5ad
RMD160 (fortune-mod-9708.tar.gz) = bf40efcfde2e854166bccdbccf7cf23bfb443e61
@@ -8,5 +8,5 @@
SHA1 (patch-datfiles_Makefile) = fd0d1b87bd2532bada57517970cf7676ee678720
SHA1 (patch-datfiles_html_Makefile) = aef5d7d6275943e94e4f79f2db64445605d329ce
SHA1 (patch-datfiles_off_Makefile) = 31aa90703d86df0c1d50e5cadfb0ec92a5800199
-SHA1 (patch-fortune_fortune.c) = 734f7c2bd5ebfc3c8d28148e0674bccacdccfc1f
+SHA1 (patch-fortune_fortune.c) = b19d3af94f2708012f36ca1739b85a7ce5c97ed0
SHA1 (patch-util_strfile.h) = dd58d46bf13f5a7eeb245a3b747a26fa1e946113
diff -r f1f3008af7cd -r 852970f30987 games/fortune/patches/patch-fortune_fortune.c
--- a/games/fortune/patches/patch-fortune_fortune.c Mon Jun 28 10:43:00 2021 +0000
+++ b/games/fortune/patches/patch-fortune_fortune.c Mon Jun 28 11:20:55 2021 +0000
@@ -1,10 +1,10 @@
-$NetBSD: patch-fortune_fortune.c,v 1.1 2017/08/07 11:10:32 jperkin Exp $
+$NetBSD: patch-fortune_fortune.c,v 1.2 2021/06/28 11:20:55 tnn Exp $
Make fortune compatible with BSD strfile datfiles.
--- fortune/fortune.c.orig 1997-08-28 19:43:52.000000000 +0000
+++ fortune/fortune.c
-@@ -142,6 +142,15 @@ static char rcsid[] = "$NetBSD: fortune.
+@@ -142,6 +142,20 @@ static char rcsid[] = "$NetBSD: fortune.
#define NDEBUG 1
#endif
@@ -15,12 +15,17 @@
+#elif defined __sun
+#define BE32TOH(x) x = BE_IN32(&(x))
+#define BE64TOH(x) x = BE_IN64(&(x))
++#elif defined __linux__
++#define _BSD_SOURCE
++#include <endian.h>
++#define BE32TOH(x) x = be32toh(x)
++#define BE64TOH(x) x = be64toh(x)
+#endif
+
typedef struct fd
{
int percent;
-@@ -925,10 +934,10 @@ void get_tbl(FILEDESC * fp)
+@@ -925,10 +939,10 @@ void get_tbl(FILEDESC * fp)
exit(1);
}
/* fp->tbl.str_version = ntohl(fp->tbl.str_version); */
@@ -35,7 +40,7 @@
close(fd);
}
else
-@@ -1098,8 +1107,8 @@ void get_fort(void)
+@@ -1098,8 +1112,8 @@ void get_fort(void)
lseek(fp->datfd,
(off_t) (sizeof fp->tbl + fp->pos * sizeof Seekpts[0]), 0);
read(fp->datfd, Seekpts, sizeof Seekpts);
Home |
Main Index |
Thread Index |
Old Index