From 57c7228a865a6ee577cef4abe93c68cafeb6c16f Mon Sep 17 00:00:00 2001 From: sthen Date: Fri, 5 Jun 2026 11:16:50 +0000 Subject: [PATCH] unbreak i386 by building the generic version, not mmx fix some time_t and missing prototype issues --- mail/hashcash/Makefile | 9 ++-- mail/hashcash/patches/patch-getopt_c | 12 ++++++ mail/hashcash/patches/patch-hashcash_c | 58 ++++++++++++++++++++++++++ 3 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 mail/hashcash/patches/patch-getopt_c create mode 100644 mail/hashcash/patches/patch-hashcash_c diff --git a/mail/hashcash/Makefile b/mail/hashcash/Makefile index 91a8227824b..210c28d50c9 100644 --- a/mail/hashcash/Makefile +++ b/mail/hashcash/Makefile @@ -1,9 +1,10 @@ -BROKEN-powerpc64 = non-portable altivec / gcc-isms +BROKEN-powerpc64= non-portable altivec / gcc-isms COMMENT= hashcash anti-spam / denial of service counter-measure tool DISTNAME= hashcash-1.22 -CATEGORIES= mail +REVISION= 1 +CATEGORIES= mail HOMEPAGE= http://www.hashcash.org/ @@ -17,11 +18,7 @@ WANTLIB= c SITES= ${HOMEPAGE}/source/ EXTRACT_SUFX= .tgz -.if ${MACHINE_ARCH} == "i386" -ALL_TARGET= x86 -.else ALL_TARGET= generic -.endif NO_TEST= Yes diff --git a/mail/hashcash/patches/patch-getopt_c b/mail/hashcash/patches/patch-getopt_c new file mode 100644 index 00000000000..a3ac3229ebc --- /dev/null +++ b/mail/hashcash/patches/patch-getopt_c @@ -0,0 +1,12 @@ +Index: getopt.c +--- getopt.c.orig ++++ getopt.c +@@ -156,7 +156,7 @@ static enum + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER + } ordering; + +-#ifdef __GNU_LIBRARY__ ++#if defined(_GNU_LIBRARY__) || defined(__OpenBSD__) + /* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work diff --git a/mail/hashcash/patches/patch-hashcash_c b/mail/hashcash/patches/patch-hashcash_c new file mode 100644 index 00000000000..67c8154ed8d --- /dev/null +++ b/mail/hashcash/patches/patch-hashcash_c @@ -0,0 +1,58 @@ +Index: hashcash.c +--- hashcash.c.orig ++++ hashcash.c +@@ -569,9 +569,9 @@ int main( int argc, char* argv[] ) + } + + if ( anon_flag ) { +- VPRINTF( stderr, "anon period: %ld seconds\n", +- (long)anon_period ); +- VPRINTF( stderr, "adding: %ld seconds\n", anon_random ); ++ VPRINTF( stderr, "anon period: %lld seconds\n", ++ (long long)anon_period ); ++ VPRINTF( stderr, "adding: %lld seconds\n", (long long)anon_random ); + } + + VPRINTF( stderr, "tries: %.0f", tries_taken ); +@@ -860,8 +860,8 @@ int main( int argc, char* argv[] ) + if ( left_flag || verbose_flag ) { + QPRINTF( stderr, "valid: " ); + if ( valid_for > 0 ) { +- QPRINTF( stderr, "for %ld seconds\n", +- (long)valid_for ); ++ QPRINTF( stderr, "for %lld seconds\n", ++ (long long)valid_for ); + if ( name_flag || width_flag ) { + PPUTS( stdout, " " ); + } +@@ -877,22 +877,22 @@ int main( int argc, char* argv[] ) + PPUTS( stdout, "0" ); + break; + case HASHCASH_VALID_IN_FUTURE: +- QPRINTF( stderr, "in %ld seconds\n", +- token_time-(now_time+grace_period) ); ++ QPRINTF( stderr, "in %lld seconds\n", ++ (long long)token_time-(now_time+grace_period) ); + if ( name_flag || width_flag ) { + PPUTS( stdout, " " ); + } +- PPRINTF( stdout, "+%ld", +- token_time-(now_time+grace_period) ); ++ PPRINTF( stdout, "+%lld", ++ (long long)token_time-(now_time+grace_period) ); + break; + case HASHCASH_EXPIRED: +- QPRINTF( stderr, "expired %ld seconds ago\n", +- now_time-(expiry_time+grace_period) ); ++ QPRINTF( stderr, "expired %lld seconds ago\n", ++ (long long)now_time-(expiry_time+grace_period) ); + if ( name_flag || width_flag ) { + PPUTS( stdout, " " ); + } +- PPRINTF( stdout, "-%ld", +- now_time-(expiry_time+grace_period) ); ++ PPRINTF( stdout, "-%lld", ++ (long long)now_time-(expiry_time+grace_period) ); + break; + default: + QPRINTF( stderr, "not valid\n" );