diff --git a/ports/graphics/jbig2dec/diffs/Makefile.diff b/ports/graphics/jbig2dec/diffs/Makefile.diff index 55fdbd3958f3..c96a9a2f55f7 100644 --- a/ports/graphics/jbig2dec/diffs/Makefile.diff +++ b/ports/graphics/jbig2dec/diffs/Makefile.diff @@ -1,11 +1,18 @@ ---- Makefile.orig 2021-02-23 17:51:13 UTC +--- Makefile.orig 2023-10-24 09:16:20 UTC +++ Makefile -@@ -25,8 +25,4 @@ PNG_CONFIGURE_OFF= --without-libpng - PNG_CONFIGURE_ON= --with-libpng=${LOCALBASE} +@@ -15,7 +15,6 @@ USES= cpe libtool pathfix python:env,te + CONFIGURE_ENV= ac_cv_func_getopt_long=yes + GNU_CONFIGURE= yes + INSTALL_TARGET= install-strip +-LDFLAGS+= -lmd + TEST_TARGET= check + USE_LDCONFIG= yes + +@@ -29,7 +28,4 @@ OPTIONS_DEFAULT=PNG + PNG_CONFIGURE_WITH= libpng=${LOCALBASE} PNG_LIB_DEPENDS= libpng.so:graphics/png -post-patch: - @${RM} ${WRKSRC}/getopt* ${WRKSRC}/sha1.h -- @${REINPLACE_CMD} -E 's|SHA1_Final\( *([^,]+), *([^\)]+)\)|SHA1_Final(\2, \1)|' ${WRKSRC}/jbig2dec.c ${WRKSRC}/sha1.c - .include diff --git a/ports/graphics/jbig2dec/dragonfly/patch-jbig2dec.c b/ports/graphics/jbig2dec/dragonfly/patch-jbig2dec.c index 89d1deb0f6eb..848380a2fc84 100644 --- a/ports/graphics/jbig2dec/dragonfly/patch-jbig2dec.c +++ b/ports/graphics/jbig2dec/dragonfly/patch-jbig2dec.c @@ -1,6 +1,6 @@ ---- jbig2dec.c.bak.intermediate 2019-04-22 17:03:22 UTC +--- jbig2dec.c.orig 2023-10-24 09:18:19 UTC +++ jbig2dec.c -@@ -40,7 +40,7 @@ +@@ -33,7 +33,7 @@ #endif #include "os_types.h" @@ -9,7 +9,7 @@ #ifndef SHA1_DIGEST_SIZE # define SHA1_DIGEST_SIZE 20 #endif -@@ -66,7 +66,7 @@ typedef enum { +@@ -65,7 +65,7 @@ typedef enum { typedef struct { jbig2dec_mode mode; int verbose, hash, embedded; @@ -17,8 +17,8 @@ + SHA_CTX *hash_ctx; char *output_filename; jbig2dec_format output_format; - } jbig2dec_params_t; -@@ -78,7 +78,7 @@ static int print_usage(void); + size_t memory_limit; +@@ -213,7 +213,7 @@ static void *jbig2dec_realloc(Jbig2Alloc static void hash_init(jbig2dec_params_t *params) { @@ -27,12 +27,3 @@ if (params->hash_ctx == NULL) { fprintf(stderr, "unable to allocate hash state\n"); params->hash = 0; -@@ -103,7 +103,7 @@ hash_print(jbig2dec_params_t *params, FI - char digest[2 * SHA1_DIGEST_SIZE + 1]; - int i; - -- SHA1_Final(params->hash_ctx, md); -+ SHA1_Final(md, params->hash_ctx); - for (i = 0; i < SHA1_DIGEST_SIZE; i++) { - snprintf(&(digest[2 * i]), 3, "%02x", md[i]); - } diff --git a/ports/graphics/jbig2dec/dragonfly/patch-sha1.c b/ports/graphics/jbig2dec/dragonfly/patch-sha1.c index e8c3af963ad0..1a2bdc28772f 100644 --- a/ports/graphics/jbig2dec/dragonfly/patch-sha1.c +++ b/ports/graphics/jbig2dec/dragonfly/patch-sha1.c @@ -1,4 +1,4 @@ ---- sha1.c.intermediate 2019-04-22 17:03:22 UTC +--- sha1.c.orig 2023-10-24 09:27:08 UTC +++ sha1.c @@ -87,7 +87,7 @@ A million repetitions of "a" @@ -40,7 +40,7 @@ /* Add padding and return the message digest. */ void --SHA1_Final(SHA1_CTX *context, uint8_t digest[SHA1_DIGEST_SIZE]) +-SHA1_Final(uint8_t digest[SHA1_DIGEST_SIZE], SHA1_CTX *context) +SHA1_Final(uint8_t digest[SHA1_DIGEST_SIZE], SHA_CTX *context) { uint32_t i; @@ -63,21 +63,3 @@ uint8_t digest[20]; char output[80]; -@@ -350,7 +350,7 @@ main(int argc, char **argv) - for (k = 0; k < 2; k++) { - SHA1_Init(&context); - SHA1_Update(&context, (uint8_t *) test_data[k], strlen(test_data[k])); -- SHA1_Final(&context, digest); -+ SHA1_Final(digest, &context); - digest_to_hex(digest, output); - - if (strcmp(output, test_results[k])) { -@@ -365,7 +365,7 @@ main(int argc, char **argv) - SHA1_Init(&context); - for (k = 0; k < 1000000; k++) - SHA1_Update(&context, (uint8_t *) "a", 1); -- SHA1_Final(&context, digest); -+ SHA1_Final(digest, &context); - digest_to_hex(digest, output); - if (strcmp(output, test_results[2])) { - fprintf(stdout, "FAIL\n");