summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEm Zhan2021-02-17 20:02:53 -0500
committerEm Zhan2021-02-17 20:35:53 -0500
commit5e3fc263f1fd5624030f91bdb003bce54e68526a (patch)
tree2535cba06390a53c1e3a511146de2bfef17eaceb
parenta890b1eeecbdb297736214dd675b9259adeaf9b5 (diff)
downloadaur-5e3fc263f1fd5624030f91bdb003bce54e68526a.tar.gz
Upgrade for v3.0.0
Now uses the built-in statically linked libraries instead of trying to modify the makefile to work with Arch dependencies. See https://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/_README.nolib for details.
-rw-r--r--.SRCINFO26
-rw-r--r--PKGBUILD50
-rw-r--r--wgrib2.patch290
3 files changed, 34 insertions, 332 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6a5bcc78c1a..ede381ab8ae 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,25 +1,17 @@
pkgbase = wgrib2
- pkgdesc = A program to manipulate, inventory and decode GRIB-2 files
- pkgver = 2.0.8
+ pkgdesc = Utility to read and write grib2 files
+ pkgver = 3.0.0
pkgrel = 1
url = https://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/
- arch = i686
arch = x86_64
+ license = GPL
license = custom
- makedepends = g2clib
- makedepends = gctpc
- depends = netcdf
- depends = jasper
- depends = libpng
- depends = libmariadbclient
- depends = proj
- depends = libaec
- source = ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2_nolib.tgz.v2.0.8
- source = wgrib2.patch
- source = http://www.ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/iplib_hwrf.tgz
- md5sums = 131729175e4fffdb1a56f6fc500f1694
- md5sums = 2e7bfddc4a4fd57b3f9a768124964cd5
- md5sums = 6d672b9d5823a0cb3bdd12131175250a
+ makedepends = gcc-fortran
+ depends = gcc-libs
+ source = https://www.ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/wgrib2.tgz.v3.0.0
+ source = https://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/makefile_v2_for_wgrib2_v3.0.0
+ md5sums = 83f1b3f68c26a97c50af137b92804d95
+ md5sums = 11bf2c1f8669aaf8123ad5f928d14d33
pkgname = wgrib2
diff --git a/PKGBUILD b/PKGBUILD
index 4f7fcf490a4..ac3b7d9af25 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,36 +1,36 @@
+# Maintainer: Em Zhan <zqianem@gmail.com>
# Contributor: Anton Bazhenov <anton.bazhenov at gmail>
# Contributor: Graziano Giuliani <giuliani@lamma.rete.toscana.it>
pkgname=wgrib2
-pkgver=2.0.8
+pkgver=3.0.0
pkgrel=1
-pkgdesc="A program to manipulate, inventory and decode GRIB-2 files"
-arch=('i686' 'x86_64')
+pkgdesc="Utility to read and write grib2 files"
+arch=('x86_64')
url="https://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/"
-license=('custom')
-depends=('netcdf' 'jasper' 'libpng' 'libmariadbclient' 'proj' 'libaec')
-makedepends=('g2clib' 'gctpc')
-source=(ftp://ftp.cpc.ncep.noaa.gov/wd51we/${pkgname}/${pkgname}_nolib.tgz.v${pkgver}
- wgrib2.patch
- http://www.ftp.cpc.ncep.noaa.gov/wd51we/${pkgname}/iplib_hwrf.tgz)
-md5sums=('131729175e4fffdb1a56f6fc500f1694'
- '2e7bfddc4a4fd57b3f9a768124964cd5'
- '6d672b9d5823a0cb3bdd12131175250a')
+license=('GPL' 'custom')
+depends=('gcc-libs')
+makedepends=('gcc-fortran')
+source=("https://www.ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/$pkgname.tgz.v$pkgver"
+ "https://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/makefile_v2_for_wgrib2_v$pkgver")
+md5sums=('83f1b3f68c26a97c50af137b92804d95'
+ '11bf2c1f8669aaf8123ad5f928d14d33')
+
+prepare() {
+ cp "makefile_v2_for_wgrib2_v$pkgver" grib2/makefile
+}
build() {
- cd ${srcdir}/iplib_hwrf
- rm -f *.o *.a
- FC=gfortran FFLAGS='${CFLAGS} -fPIC -DPIC' make
- cd ${srcdir}/grib2
- patch -p0 -i ${srcdir}/wgrib2.patch
- sed -i 's/image.inmem_.*=.*1;//' wgrib2/enc_jpeg2000_clone.c
- FC=gfortran F90=gfortran F77=gfortran make
+ cd grib2
+ CC=gcc FC=gfortran make
}
-package()
-{
- cd ${srcdir}/grib2
- install -Dm755 ${pkgname}/${pkgname} ${pkgdir}/usr/bin/${pkgname}
- install -Dm644 ${pkgname}/LICENSE-${pkgname} \
- ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
+package() {
+ cd grib2/wgrib2
+ install -Dm755 wgrib2 "${pkgdir}/usr/bin/wgrib2"
+ install -Dm644 LICENSE-jasper "$pkgdir/usr/share/licenses/$pkgname/LICENSE-jasper"
+ install -Dm644 LICENSE-libpng "$pkgdir/usr/share/licenses/$pkgname/LICENSE-libpng"
+ install -Dm644 LICENSE-netcdf "$pkgdir/usr/share/licenses/$pkgname/LICENSE-netcdf"
+ install -Dm644 LICENSE-wgrib2 "$pkgdir/usr/share/licenses/$pkgname/LICENSE-wgrib2"
+ install -Dm644 LICENSE-zlib "$pkgdir/usr/share/licenses/$pkgname/LICENSE-zlib"
}
diff --git a/wgrib2.patch b/wgrib2.patch
deleted file mode 100644
index 675569fde31..00000000000
--- a/wgrib2.patch
+++ /dev/null
@@ -1,290 +0,0 @@
---- makefile.orig 2019-02-07 18:53:47.000000000 +0100
-+++ makefile 2019-09-22 17:13:59.812083455 +0200
-@@ -101,8 +101,8 @@
- # export COMP_SYS=intel_linux
- #
- # can uncomment following two lines to use gcc/gfortran
--#export CC=gcc
--#export FC=gfortran
-+export CC=gcc
-+export FC=gfortran
- #
- # for OS-X: uncomment line for makefile -f scripts/makefile.darwin
- #
-@@ -115,22 +115,22 @@
-
-
- # Warning do not set both USE_NETCDF3 and USE_NETCDF4 to one
--USE_NETCDF3=1
--USE_NETCDF4=0
-+USE_NETCDF3=0
-+USE_NETCDF4=1
- USE_REGEX=1
- USE_TIGGE=1
--USE_MYSQL=0
--USE_IPOLATES=3
-+USE_MYSQL=1
-+USE_IPOLATES=1
- USE_SPECTRAL=0
--USE_UDF=0
-+USE_UDF=1
- USE_OPENMP=1
--USE_PROJ4=0
--USE_WMO_VALIDATION=0
-+USE_PROJ4=1
-+USE_WMO_VALIDATION=1
- DISABLE_TIMEZONE=0
- MAKE_FTN_API=1
- DISABLE_ALARM=0
-
--USE_G2CLIB=0
-+USE_G2CLIB=1
- USE_PNG=1
- USE_JASPER=1
- USE_AEC=1
-@@ -222,9 +222,11 @@
- ifeq ($(USE_IPOLATES),1)
- # for HWRF iplib:=${lib}/libipolate_hwrf.a
- # for HWRF wLDFLAGS+=-lipolate_hwrf
-- ipdir:=${cwd}/iplib.v3.0.0
-- iplib:=${lib}/libipolate.a
-- wLDFLAGS+=-lipolate
-+ iplib:=../iplib_hwrf/libipolate.a
-+ wLDFLAGS+=-L../../iplib_hwrf -lipolate
-+ #ipdir:=${cwd}/iplib.v3.0.0
-+ #iplib:=${lib}/libipolate.a
-+ #wLDFLAGS+=-lipolate
- else ifeq ($(USE_IPOLATES),3)
- ipdir:=${cwd}/ip2lib_d
- iplib=${lib}/libip2_d.a
-@@ -302,9 +304,11 @@
- ifneq "$(GFORTLIBDIR)" './'
- wLDFLAGS+=-L$(GFORTLIBDIR)
- endif
-+ wFFLAGS+=$(CFLAGS) -fPIC
-+ wCPPFLAGS+=$(CPPFLAGS) -DGFORTRAN -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H
- wLDFLAGS+=-lgfortran
-- wCPPFLAGS+=-DGFORTRAN
-- wFFLAGS+=-c -O2
-+# wCPPFLAGS+=-DGFORTRAN
-+# wFFLAGS+=-c -O2
- FTN_REAL8:="-fdefault-real-8 -fdefault-double-8"
- endif
- ifeq ($(USE_OPENMP),1)
-@@ -435,28 +439,27 @@
-
- g2cdir:=${cwd}/g2clib-1.4.0
- ifeq ($(USE_G2CLIB),1)
-- g2clib:=${lib}/libgrib2c.a
-- wLDFLAGS+=-lgrib2c
-- wCPPFLAGS+=-I$g
-+ glib:=/usr/lib/libg2c.a
-+ wLDFLAGS+=-L/usr/lib -lg2c
-+ wCPPFLAGS+=-I/usr/include
- a:=$(shell echo "\#define USE_G2CLIB" >> ${CONFIG_H})
- else
- a:=$(shell echo "//\#define USE_G2CLIB" >> ${CONFIG_H})
- endif
-
- # gctpc library
--gctpcdir:=${cwd}/gctpc
--gctpcsrc:=gctpc20a.tgz
--gctpclib:=${lib}/libgeo.a
-+gctpc:=/usr/lib
-+gctpclib:=/usr/lib/libgeo.a
- wLDFLAGS+=-lgeo
--# wCPPFLAGS+=-I${gctpc}/source
-+wCPPFLAGS+=-I/usr/include/gctpc
-
- # proj4 library
- proj4dir:=${cwd}/proj-4.8.0
- ifeq ($(USE_PROJ4),1)
-- proj4src:=${cwd}/proj-4.8.0.tar.gz
-- proj4lib:=${lib}/libproj.a
-- wLDFLAGS+=-lproj
--# wCPPFLAGS+=-I${proj4dir}/src
-+ proj4:=
-+ proj4lib:=/usr/lib/libproj.so
-+ wLDFLAGS+=-L/usr/lib -lproj
-+ wCPPFLAGS+=-I/usr/include
- a:=$(shell echo "\#define USE_PROJ4" >> ${CONFIG_H})
- else
- a:=$(shell echo "//\#define USE_PROJ4" >> ${CONFIG_H})
-@@ -466,10 +469,9 @@
-
- jasperdir=${cwd}/jasper-1.900.1
- ifeq ($(USE_JASPER),1)
-- jsrc=jasper-1.900.1-14ubuntu3.2.debian.tgz
-- jlib=${lib}/libjasper.a
-- wLDFLAGS+=-ljasper
-- wCPPFLAGS+=-I${jasperdir}/src/libjasper/include
-+ jlib=/usr/lib/libjasper.so
-+ wLDFLAGS+=-L/usr/lib -ljasper
-+ wCPPFLAGS+=-I/usr/include
- a:=$(shell echo "\#define USE_JASPER" >> ${CONFIG_H})
- else
- a:=$(shell echo "//\#define USE_JASPER" >> ${CONFIG_H})
-@@ -480,8 +482,8 @@
- aecdir=${cwd}/libaec-1.0.2
- ifeq ($(USE_AEC),1)
- aecsrc=libaec-1.0.2.tar.gz
-- aeclib=${lib}/libaec.a
-- wLDFLAGS+=-laec
-+ aeclib=/usr/lib/libaec.so
-+ wLDFLAGS+=-L/usr/lib -laec
- a:=$(shell echo "\#define USE_AEC \"${aecsrc}\"" >> ${CONFIG_H})
- else
- a:=$(shell echo "//\#define USE_AEC" >> ${CONFIG_H})
-@@ -509,11 +511,17 @@
- hdf5dir:=${cwd}/hdf5-1.10.4
- netcdf4dir:=${cwd}/netcdf-4.6.1
- ifeq ($(USE_NETCDF4),1)
-- netcdf4src=netcdf-4.6.1.tar.gz
-- netcdf4lib:=${lib}/libnetcdf.a
-- hdf5src:=hdf5-1.10.4.tar.gz
-- hdf5lib:=${lib}/libhdf5.a
-- wLDFLAGS+=-lnetcdf -lhdf5_hl -lhdf5 -ldl
-+ netcdf4src=
-+ n4lib:=/usr/lib/libnetcdf.so
-+ h5:=
-+ h5lib:=
-+ wLDFLAGS+=`nc-config --libs`
-+ wCPPFLAGS+=`nc-config --cflags`
-+# netcdf4src=netcdf-4.6.1.tar.gz
-+# netcdf4lib:=${lib}/libnetcdf.a
-+# hdf5src:=hdf5-1.10.4.tar.gz
-+# hdf5lib:=${lib}/libhdf5.a
-+# wLDFLAGS+=-lnetcdf -lhdf5_hl -lhdf5 -ldl
- # wCPPFLAGS+=-I${netcdf4dir}/include -I${hdf5dir}/src -I${hdf5dir}/hl/src
- a:=$(shell echo "\#define USE_NETCDF4" >> ${CONFIG_H})
- a:=$(shell echo "\#define HDF5 \"${hdf5src}\"" >> ${CONFIG_H})
-@@ -573,18 +581,16 @@
-
- pngdir=${cwd}/libpng-1.2.57
- ifeq ($(USE_PNG),1)
-- pngsrc=${cwd}/libpng-1.2.57.tar.gz
-- pnglib=${lib}/libpng.a
-+ pnglib=/usr/lib/libpng.so
- wLDFLAGS+=-lpng
- # wCPPFLAGS+=-I$p
- a:=$(shell echo "\#define USE_PNG" >> ${CONFIG_H})
-
- zdir=${cwd}/zlib-1.2.11
- # z
-- zsrc=${cwd}/zlib-1.2.11.tar.gz
-- zlib=${lib}/libz.a
-- wLDFLAGS+=-lz
-- # wCPPFLAGS+=-I$z
-+ zlib=/usr/lib/libz.so
-+ wLDFLAGS+=-L/usr/lib -lz
-+ wCPPFLAGS+=-I/usr/include
- else
- a:=$(shell echo "//\#define USE_PNG" >> ${CONFIG_H})
- endif
-@@ -638,106 +644,6 @@
- export CPPFLAGS="${wCPPFLAGS}" && export FFLAGS="${wFFLAGS}" && cd c_api && ${MAKE}
- cd lib && ${MAKE}
-
--${jasperdir}:
-- cp ${jsrc} tmpj.tar.gz
-- gunzip -n -f tmpj.tar.gz
-- tar -xvf tmpj.tar
-- rm tmpj.tar
--
--${jlib}: ${jasperdir}
-- cd ${jasperdir} && export CC=${CCjasper} && ./configure --without-x --disable-libjpeg --disable-opengl --prefix=${cwd} && ${MAKE} -j 1 check install
--
--${aecdir}:
-- cp ${aecsrc} tmpaec.tar.gz
-- gunzip -n -f tmpaec.tar.gz
-- tar -xvf tmpaec.tar
-- rm tmpaec.tar
--
--${aeclib}: ${aecdir}
-- cd "${aecdir}" && export CFLAGS="${wCPPFLAGS}" && ./configure --disable-shared --prefix=${cwd} && ${MAKE} check install
--
--${pngdir}:
-- cp ${pngsrc} tmpp.tar.gz
-- gunzip -n -f tmpp.tar.gz
-- tar -xvf tmpp.tar
-- rm tmpp.tar
--
--${pnglib}: ${zlib} ${pngdir}
--# for OSX
--# export LDFLAGS="-L${lib}" && cd "${pngdir}" && export CPPFLAGS="${wCPPFLAGS}" && ${MAKE} -f scripts/makefile.darwin
--# for everybody else
-- export LDFLAGS="-L${lib}" && cd "${pngdir}" && export CFLAGS="-DPNG_USER_WIDTH_MAX=200000000L -I${cwd}/include" && ./configure --disable-shared --prefix=${cwd} && ${MAKE} check install
--
--${zdir}:
-- cp ${zsrc} tmpz.tar.gz
-- gunzip -f tmpz.tar.gz
-- tar -xvf tmpz.tar
-- rm tmpz.tar
--
--${zlib}: ${zdir}
-- cd ${zdir} && export CFLAGS="${wCPPFLAGS}" && ./configure --prefix=${cwd} --static && ${MAKE} install
--
--${g2clib}: ${jlib} ${pnglib} ${zlib}
-- cd "$g2cdir" && export CPPFLAGS="${wCPPFLAGS}" && ${MAKE} && cp libgrib2c.a ${lib}
--
--${gctpcdir}/source/makefile.gctpc:
-- cp ${gctpcsrc} tmpgctpc.tar.gz
-- gunzip -n -f tmpgctpc.tar.gz
-- tar -xvf tmpgctpc.tar
-- rm tmpgctpc.tar
-- cp makefile.gctpc proj.h sominv.c somfor.c ${gctpcdir}/source/
--
--${gctpclib}: ${gctpcdir}/source/makefile.gctpc
-- cd "${gctpcdir}/source" && export CPPFLAGS="${wCPPFLAGS}" && ${MAKE} -f makefile.gctpc
-- cp ${gctpcdir}/source/libgeo.a ${lib}
-- cp ${gctpcdir}/source/proj.h ${cwd}/include/
--
--${proj4lib}:
-- cp ${proj4src} tmpproj4.tar.gz
-- gunzip -f tmpproj4.tar.gz
-- tar -xvf tmpproj4.tar
-- rm tmpproj4.tar
-- cd ${proj4dir} && ./configure --disable-shared --prefix=${cwd} && ${MAKE} check install
--
--${netcdf3dir}:
-- cp ${netcdf3src} tmpn.tar.gz
-- gunzip -f tmpn.tar.gz
-- tar -xvf tmpn.tar
-- rm tmpn.tar
--
--${netcdf3lib}: ${netcdf3dir}
-- cd ${netcdf3dir} && export CPPFLAGS="${netcdf3CPPFLAGS}" && ./configure --enable-c-only --prefix=${cwd} && ${MAKE} check install
--
--${netcdf4src}:
-- $(error ERROR, get netcdf4 source by "wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-4.6.1.tar.gz" )
--
--${netcdf4dir}: ${netcdf4src}
-- cp ${netcdf4src} tmpn4.tar.gz
-- gunzip -n -f tmpn4.tar.gz
-- tar -xvf tmpn4.tar
-- rm tmpn4.tar
--
--${netcdf4lib}: ${zlib} ${netcdf4dir} ${hdf5lib}
-- cd "${netcdf4dir}" && export CPPFLAGS="${netcdf4CPPFLAGS}" && export LDFLAGS="-L${lib}" && export LIBS="-lhdf5 -ldl" && ./configure --disable-fortran --disable-cxx --disable-dap --enable-netcdf-4 --prefix=${cwd} --disable-shared && ${MAKE} install
--
--${hdf5src}:
-- $(error ERROR, get hdf5 source by "wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.4/src/hdf5-1.10.4.tar.gz" )
--
--${hdf5dir}: ${hdf5src}
-- cp ${hdf5src} tmph5.tar.gz
-- gunzip -n -f tmph5.tar.gz
-- tar -xvf tmph5.tar
-- rm tmph5.tar
--
--${hdf5lib}: ${hdf5dir}
-- cd "${hdf5dir}" && export CFLAGS="${hdf5CFLAGS}" && export LDFLAGS="${LDFLAGS}" && ./configure --disable-shared --with-zlib=$z --prefix=${cwd} && ${MAKE} all check install
--
--${iplib}:
-- cd "${ipdir}" && export FFLAGS="${wFFLAGS}" && export FTN_REAL8=${FTN_REAL8} && ${MAKE} && cp $(notdir ${iplib}) ${iplib}
--
--${spectrallib}:
-- cd "${spectraldir}" && export FFLAGS="${wFFLAGS}" && export FTN_REAL8=${FTN_REAL8} && ${MAKE} && cp $(notdir ${spectrallib}) ${spectrallib}
--
- aux_progs/gmerge: aux_progs/gmerge.c
- cd aux_progs && ${MAKE} -f gmerge.make
-