From 2a6d816f4e2c5604f719991bf3496b0199cead5a Mon Sep 17 00:00:00 2001 From: Sergey Fedorov Date: Fri, 27 Sep 2024 05:11:31 +0800 Subject: [PATCH] libmd: fix build with gcc Closes: https://trac.macports.org/ticket/70706 --- devel/libmd/Portfile | 6 ++++-- devel/libmd/files/patch-sha2.diff | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 devel/libmd/files/patch-sha2.diff diff --git a/devel/libmd/Portfile b/devel/libmd/Portfile index 93172d652c85b..0418b6d052018 100644 --- a/devel/libmd/Portfile +++ b/devel/libmd/Portfile @@ -1,6 +1,6 @@ # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 -PortSystem 1.0 +PortSystem 1.0 name libmd epoch 1 @@ -8,7 +8,6 @@ version 1.1.0 revision 0 categories devel license BSD ISC Permissive -platforms darwin maintainers {raimue @raimue} \ openmaintainer @@ -30,3 +29,6 @@ checksums rmd160 1d8cfb5504ac71a50dc4c9372dee56fa721f5ac4 \ # hide away a bunch of generically-named header files # see https://trac.macports.org/ticket/66832 configure.args --includedir=${prefix}/include/libmd + +# https://trac.macports.org/ticket/70706 +patchfiles-append patch-sha2.diff diff --git a/devel/libmd/files/patch-sha2.diff b/devel/libmd/files/patch-sha2.diff new file mode 100644 index 0000000000000..294992b3c7909 --- /dev/null +++ b/devel/libmd/files/patch-sha2.diff @@ -0,0 +1,18 @@ +--- src/sha2.c 2023-04-09 18:24:46.000000000 +0800 ++++ src/sha2.c 2024-09-27 05:04:13.000000000 +0800 +@@ -280,13 +280,13 @@ + context->bitcount[0] = 0; + } + +-#ifdef libmd_strong_alias ++#if defined(libmd_strong_alias) && defined(__clang__) + libmd_strong_alias(SHA224Transform, SHA256Transform); + libmd_strong_alias(SHA224Update, SHA256Update); + libmd_strong_alias(SHA224Pad, SHA256Pad); + #else + void +-SHA224Transform(uint64_t state[8], const uint8_t data[SHA256_BLOCK_LENGTH]) ++SHA224Transform(uint32_t state[8], const uint8_t data[SHA256_BLOCK_LENGTH]) + { + SHA256Transform(state, data); + }