diff options
author | tnn <tnn@pkgsrc.org> | 2021-06-28 11:20:55 +0000 |
---|---|---|
committer | tnn <tnn@pkgsrc.org> | 2021-06-28 11:20:55 +0000 |
commit | 86e8e609811f05ee09454b011ca0be6cfd643b97 (patch) | |
tree | 4320a809faf216884ef4ccb65947a6b953ca3206 /games | |
parent | 119db50d0cd76fc84a96701c2c1718b164208eb7 (diff) | |
download | pkgsrc-86e8e609811f05ee09454b011ca0be6cfd643b97.tar.gz |
fortune: fix build on Linux
Diffstat (limited to 'games')
-rw-r--r-- | games/fortune/distinfo | 4 | ||||
-rw-r--r-- | games/fortune/patches/patch-fortune_fortune.c | 13 |
2 files changed, 11 insertions, 6 deletions
diff --git a/games/fortune/distinfo b/games/fortune/distinfo index bef2cda4aa8..be85dbc2012 100644 --- a/games/fortune/distinfo +++ b/games/fortune/distinfo @@ -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-Makefile) = b2429bba09ffdc7d571c5d98833a4ff5a6e2fb21 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 --git a/games/fortune/patches/patch-fortune_fortune.c b/games/fortune/patches/patch-fortune_fortune.c index 5e739ee0087..9b2200e624c 100644 --- a/games/fortune/patches/patch-fortune_fortune.c +++ b/games/fortune/patches/patch-fortune_fortune.c @@ -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 @@ Make fortune compatible with BSD strfile datfiles. +#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 @@ Make fortune compatible with BSD strfile datfiles. 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); |