From 05efbaf306a19988b50bb088b1072e26bb3cdcde Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Mon, 3 May 2021 10:38:31 +0530 Subject: [PATCH] netcdf: Fix multiple definition error. --- ...100-fix-typo.patch => 0010-fix-typo.patch} | 0 mingw-w64-netcdf/0011-fix-multiple-def.patch | 38 +++++++++++++++++++ mingw-w64-netcdf/PKGBUILD | 16 ++++++-- 3 files changed, 50 insertions(+), 4 deletions(-) rename mingw-w64-netcdf/{0100-fix-typo.patch => 0010-fix-typo.patch} (100%) create mode 100644 mingw-w64-netcdf/0011-fix-multiple-def.patch diff --git a/mingw-w64-netcdf/0100-fix-typo.patch b/mingw-w64-netcdf/0010-fix-typo.patch similarity index 100% rename from mingw-w64-netcdf/0100-fix-typo.patch rename to mingw-w64-netcdf/0010-fix-typo.patch diff --git a/mingw-w64-netcdf/0011-fix-multiple-def.patch b/mingw-w64-netcdf/0011-fix-multiple-def.patch new file mode 100644 index 0000000000..0cecc47424 --- /dev/null +++ b/mingw-w64-netcdf/0011-fix-multiple-def.patch @@ -0,0 +1,38 @@ +diff --unified '--color=auto' -r netcdf-c-4.7.4.orig/ncdump/ncvalidator.c netcdf-c-4.7.4/ncdump/ncvalidator.c +--- netcdf-c-4.7.4.orig/ncdump/ncvalidator.c 2020-03-27 21:03:36.000000000 +0530 ++++ netcdf-c-4.7.4/ncdump/ncvalidator.c 2021-05-02 20:51:53.185118600 +0530 +@@ -73,12 +73,10 @@ + #include /* read() getopt() */ + #endif + +-#ifdef _WIN32 ++#ifdef _MSC_VER + #include +-#define snprintf _snprintf + #include "XGetopt.h" +-int opterr; +-int optind; ++#define snprintf _snprintf + #endif + + #define X_ALIGN 4 +diff --unified '--color=auto' -r netcdf-c-4.7.4.orig/ncdump/ocprint.c netcdf-c-4.7.4/ncdump/ocprint.c +--- netcdf-c-4.7.4.orig/ncdump/ocprint.c 2020-03-27 21:03:36.000000000 +0530 ++++ netcdf-c-4.7.4/ncdump/ocprint.c 2021-05-02 20:49:16.023788600 +0530 +@@ -29,6 +29,7 @@ + + #include "oc.h" + #include "ocx.h" ++#include "ocdebug.h" + + #ifdef _MSC_VER + #include "XGetopt.h" +@@ -56,8 +57,6 @@ + /*Mnemonic*/ + #define TOPLEVEL 1 + +-int ocdebug; +- + static OCerror ocstat; + static OClink glink; + diff --git a/mingw-w64-netcdf/PKGBUILD b/mingw-w64-netcdf/PKGBUILD index fcc8da63b4..4c54f7f932 100644 --- a/mingw-w64-netcdf/PKGBUILD +++ b/mingw-w64-netcdf/PKGBUILD @@ -4,7 +4,7 @@ _realname=netcdf pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=4.7.4 -pkgrel=1 +pkgrel=2 pkgdesc="Interface for scientific data access to large binary data (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64') @@ -23,7 +23,8 @@ source=(${_realname}-${pkgver}.tar.gz::"https://github.com/Unidata/netcdf-c/arch 0007-mingw-config.patch 0008-mingw-and-msvc-common.patch 0009-mingw-getopt.patch - 0100-fix-typo.patch) + 0010-fix-typo.patch + 0011-fix-multiple-def.patch) sha256sums=('99930ad7b3c4c1a8e8831fb061cb02b2170fc8e5ccaeda733bd99c3b9d31666b' 'a306c20f6593d314701147323f952d4df80e77174c45ab201949f402d191e221' 'da666e1f762b3ecd2becc9ad55fe1e32be9a47b5bae4f7990e7d94aae69697cd' @@ -33,7 +34,8 @@ sha256sums=('99930ad7b3c4c1a8e8831fb061cb02b2170fc8e5ccaeda733bd99c3b9d31666b' 'a1aa112779a83ec74acd7de8a0a57915f5d37cae44633d0a4d0d20784a2d288c' '0c42dc0e93cff6e2f0a85340e08335f2eaed0a6f24f11152728b2739e0fcb7cc' '37e50632b805ea6de48c466010247b8e5ec30615248eb994204059dbe025a7e9' - '278bea47ffc0566d5b6a60b3ccdb244405a64124f5905af01f6b834261dc72ac') + '278bea47ffc0566d5b6a60b3ccdb244405a64124f5905af01f6b834261dc72ac' + 'e7bebd703c23d1473b27de1d66832bd505076b073c49f2dc737c213796a1faf2') prepare() { cd "${srcdir}/${_realname}-c-${pkgver}" @@ -45,7 +47,10 @@ prepare() { patch -p1 -i ${srcdir}/0007-mingw-config.patch patch -p1 -i ${srcdir}/0008-mingw-and-msvc-common.patch patch -p1 -i ${srcdir}/0009-mingw-getopt.patch - patch -p1 -i ${srcdir}/0100-fix-typo.patch + patch -p1 -i ${srcdir}/0010-fix-typo.patch + + # Fixed in upstream, just copy-paste :) + patch -p1 -i ${srcdir}/0011-fix-multiple-def.patch } build() { @@ -100,4 +105,7 @@ package() { for pcfile in "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/*.pc; do sed -s "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i "${pcfile}" done + + sed -s "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i "${pkgdir}${MINGW_PREFIX}/bin/nc-config" + sed -s "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i "${pkgdir}${MINGW_PREFIX}/lib/libnetcdf.settings" }