From b515ac611d9bab492e39798e650985c051b8f77f Mon Sep 17 00:00:00 2001 From: Christopher Chavez Date: Sat, 19 Sep 2020 04:58:50 -0500 Subject: [PATCH] udunits2: update to 2.2.27.14 Add patch defining _XOPEN_SOURCE to 600 to allow using snprintf() and strdup() Still need -Wno-error=implicit-function-declaration because of deliberate implicit declaration of yylex() in parser.c See: https://trac.macports.org/ticket/61032 --- science/udunits2/Portfile | 19 ++++-- .../udunits2/files/patch-_XOPEN_SOURCE.diff | 58 +++++++++++++++++++ 2 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 science/udunits2/files/patch-_XOPEN_SOURCE.diff diff --git a/science/udunits2/Portfile b/science/udunits2/Portfile index 55c037020ece7..8ddda829cc24a 100644 --- a/science/udunits2/Portfile +++ b/science/udunits2/Portfile @@ -4,7 +4,11 @@ PortSystem 1.0 PortGroup github 1.0 PortGroup cmake 1.0 -github.setup Unidata UDUNITS-2 2.2.27.6 v +# Versions 2.2.27.7-2.2.27.14 are untagged +# https://github.com/Unidata/UDUNITS-2/issues/94 +# commit 00ce1e1 on master branch corresponds to 2.2.27.14 +github.setup Unidata UDUNITS-2 00ce1e1 +version 2.2.27.14 name udunits2 maintainers {takeshi @tenomoto} license UCAR-Unidata @@ -25,19 +29,22 @@ long_description \ homepage http://www.unidata.ucar.edu/software/udunits/ -checksums rmd160 04062adf1c45a996fe6a17d093381a03eb5720be \ - sha256 482d1614f03c081f25546420c18357fc93e5968a81c7682b6cdd6194efb3921f \ - size 231773 +checksums rmd160 c1ae6e3887d033980c17fedfe1e95a89ef43d242 \ + sha256 3e607a260155a2cf309fa741d5869dcf14c5aadf07674afdb69ca9b0f592b7ad \ + size 303468 depends_lib port:expat \ port:cunit +# Need snprintf(), strdup() +# See: https://trac.macports.org/ticket/61032 +patchfiles-append patch-_XOPEN_SOURCE.diff + cmake.out_of_source yes worksrcdir UDUNITS-2-${version} -# adhoc fix to avoid implicit declaration of snprintf() -# in spite of #include +# Needed due to deliberate implicit declaration of yylex() in parser.c # See: https://trac.macports.org/ticket/61032 configure.cflags-append \ -Wno-error=implicit-function-declaration diff --git a/science/udunits2/files/patch-_XOPEN_SOURCE.diff b/science/udunits2/files/patch-_XOPEN_SOURCE.diff new file mode 100644 index 0000000000000..5511ee1c7182f --- /dev/null +++ b/science/udunits2/files/patch-_XOPEN_SOURCE.diff @@ -0,0 +1,58 @@ +Need snprintf(), strdup() +See: https://trac.macports.org/ticket/61032 + +--- lib/converter.c.orig ++++ lib/converter.c +@@ -12,7 +12,7 @@ + /*LINTLIBRARY*/ + + #ifndef _XOPEN_SOURCE +-# define _XOPEN_SOURCE 500 ++# define _XOPEN_SOURCE 600 + #endif + + #ifdef _MSC_VER +--- lib/formatter.c.orig ++++ lib/formatter.c +@@ -11,7 +11,7 @@ + /*LINTLIBRARY*/ + + #ifndef _XOPEN_SOURCE +-# define _XOPEN_SOURCE 500 ++# define _XOPEN_SOURCE 600 + #endif + + #ifdef _MSC_VER +--- lib/parser.c.orig ++++ lib/parser.c +@@ -89,7 +89,7 @@ + /*LINTLIBRARY*/ + + #ifndef _XOPEN_SOURCE +-# define _XOPEN_SOURCE 500 ++# define _XOPEN_SOURCE 600 + #endif + + #include +--- lib/unitAndId.c.orig ++++ lib/unitAndId.c +@@ -12,7 +12,7 @@ + /*LINTLIBRARY*/ + + #ifndef _XOPEN_SOURCE +-# define _XOPEN_SOURCE 500 ++# define _XOPEN_SOURCE 600 + #endif + + #include +--- lib/xml.c.orig ++++ lib/xml.c +@@ -15,7 +15,7 @@ + #include + + #ifndef _XOPEN_SOURCE +-# define _XOPEN_SOURCE 500 ++# define _XOPEN_SOURCE 600 + #endif + + #if defined(__linux__)