From 360bbf91ae160eb8e804ed7bfcdae27cee0e373e Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Wed, 27 Sep 2023 08:57:33 +0200 Subject: [PATCH] jbig2dec: Update to 0.20 --- .../03-avoid-mingw-macro-name-conflict.patch | 24 +++++++++++++++++++ mingw-w64-jbig2dec/PKGBUILD | 16 ++++++++----- 2 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 mingw-w64-jbig2dec/03-avoid-mingw-macro-name-conflict.patch diff --git a/mingw-w64-jbig2dec/03-avoid-mingw-macro-name-conflict.patch b/mingw-w64-jbig2dec/03-avoid-mingw-macro-name-conflict.patch new file mode 100644 index 0000000000..25118be878 --- /dev/null +++ b/mingw-w64-jbig2dec/03-avoid-mingw-macro-name-conflict.patch @@ -0,0 +1,24 @@ +--- jbig2dec-0.20/getopt.h.orig 2023-09-27 09:07:07.056641700 +0200 ++++ jbig2dec-0.20/getopt.h 2023-09-27 09:07:24.616292300 +0200 +@@ -141,17 +141,17 @@ + /* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +-extern int getopt(int __argc, char *const *__argv, const char *__shortopts); ++extern int getopt(int argc, char *const *argv, const char *__shortopts); + # else /* not __GNU_LIBRARY__ */ + extern int getopt(); + # endif /* __GNU_LIBRARY__ */ + + # ifndef __need_getopt +-extern int getopt_long(int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind); +-extern int getopt_long_only(int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind); ++extern int getopt_long(int argc, char *const *argv, const char *__shortopts, const struct option *__longopts, int *__longind); ++extern int getopt_long_only(int argc, char *const *argv, const char *__shortopts, const struct option *__longopts, int *__longind); + + /* Internal only. Users should not call this directly. */ +-extern int _getopt_internal(int __argc, char *const *__argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only); ++extern int _getopt_internal(int argc, char *const *argv, const char *__shortopts, const struct option *__longopts, int *__longind, int __long_only); + # endif + #else /* not __STDC__ */ + extern int getopt(); diff --git a/mingw-w64-jbig2dec/PKGBUILD b/mingw-w64-jbig2dec/PKGBUILD index aeda47ab86..d8128499c4 100644 --- a/mingw-w64-jbig2dec/PKGBUILD +++ b/mingw-w64-jbig2dec/PKGBUILD @@ -3,26 +3,31 @@ _realname=jbig2dec pkgbase=mingw-w64-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") -pkgver=0.19 +pkgver=0.20 pkgrel=1 pkgdesc='Decoder implementation of the JBIG2 image compression format (mingw-w64)' url='https://jbig2dec.com/' arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64') -license=('AGPL') +license=('spdx:AGPL-3.0-or-later') depends=("${MINGW_PACKAGE_PREFIX}-libpng") makedepends=("${MINGW_PACKAGE_PREFIX}-autotools" "${MINGW_PACKAGE_PREFIX}-cc") source=("${_realname}-${pkgver}.tar.gz"::https://github.com/ArtifexSoftware/jbig2dec/archive/${pkgver}.tar.gz 01-dont-run-configure-from-autogen.patch - 02-mingw-no-inlines.patch) -sha256sums=('e81b787ad0b147a437a52d9ce7de1a8f429655e8aa030383b6b2dd8919373717' + 02-mingw-no-inlines.patch + 03-avoid-mingw-macro-name-conflict.patch) +sha256sums=('a9705369a6633aba532693450ec802c562397e1b824662de809ede92f67aff21' '8715e0b3dfd738f9db57c656859897a41bc43d308ba86318ced625736784b54b' - '18731257e8bddcf76663c0734ba3711b2e5c7c13f0841b6833ec17f90aa23186') + '18731257e8bddcf76663c0734ba3711b2e5c7c13f0841b6833ec17f90aa23186' + '7e4090fe884384b6e1c4f2c35b6127661a0ebbd75f3e9830425fa425c8d475a0') prepare() { cd "${srcdir}/${_realname}-${pkgver}" patch -p1 -i ${srcdir}/01-dont-run-configure-from-autogen.patch patch -p1 -i ${srcdir}/02-mingw-no-inlines.patch + + # mingw-w64 defines __argc and __argv as macros, which leads to wrong types there + patch -p1 -i ${srcdir}/03-avoid-mingw-macro-name-conflict.patch ./autogen.sh } @@ -30,7 +35,6 @@ build() { cd "${srcdir}/${_realname}-${pkgver}" [[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH} mkdir -p "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH} - #cp -r ${_realname}-${pkgver} "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH} export lt_cv_deplibs_check_method='pass_all' ../${_realname}-${pkgver}/configure \