Skip to content

Commit

Permalink
* hdf4: update to 4.2.16
Browse files Browse the repository at this point in the history
* hdf5: update to 1.14.0
* netcdf: update to 4.9.2
* python3-h5py: update to 3.8.0
* python3-netcdf4: update to 1.6.3 (fixes #785)
* python3-isort added
* python3-pip: update to 23.
* gdal{,-dev}, kealib: rebuild
* qgis-full-dev: python3-autopep8 dependency added
  • Loading branch information
jef-n committed Apr 28, 2023
1 parent 6573a3b commit d23267c
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 56 deletions.
33 changes: 15 additions & 18 deletions scripts/pippkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
# OSGEO4W_ROOT: private install directory
# MAINTAINER: OSGeo4W maintainer
# OSGEO4W_REP: local osgeo4w repository
# OSGEO4W_ROOT: OSGeo4W maintainer
# adddepends: additional (eg. non-python) dependencies
# addsrcfiles: additional packaging files

Expand All @@ -16,12 +15,12 @@
import re
import tarfile

from os import makedirs, environ, sep, system # chdir
from os.path import abspath, join, isdir, isfile, exists
from os import makedirs, environ, sep, system
from os.path import abspath, join, isdir, isfile

try:
from win32file import GetLongPathName
except:
except Exception:
def GetLongPathName(p):
return p

Expand All @@ -42,16 +41,15 @@ def GetLongPathName(p):
sys.exit(1)

try:
rep = GetLongPathName(environ['OSGEO4W_REP']).replace(sep,'/')+'/'
except:
rep = environ['OSGEO4W_REP'].replace(sep,'/')+'/'
rep = GetLongPathName(environ['OSGEO4W_REP']).replace(sep, '/') + '/'
except Exception:
rep = environ['OSGEO4W_REP'].replace(sep, '/') + '/'

if not isdir(rep):
print(f"OSGEO4W repository not found at {rep}.", file=sys.stderr)
sys.exit(1)

o4wroot = GetLongPathName(environ['OSGEO4W_ROOT']).replace(sep,'/')+'/'
# chdir(o4wroot)
o4wroot = GetLongPathName(environ['OSGEO4W_ROOT']).replace(sep, '/') + '/'

prefix = re.compile("^" + re.escape(o4wroot), re.IGNORECASE)

Expand Down Expand Up @@ -116,7 +114,7 @@ def GetLongPathName(p):
continue

if not line.startswith(" "):
m = re.search('(\S+):\s*(.*)', line)
m = re.search('(\\S+):\\s*(.*)', line)
if m:
section, val = m.group(1), m.group(2)
if val == "":
Expand Down Expand Up @@ -173,9 +171,9 @@ def GetLongPathName(p):
preremove = None
haspy = False

scriptspath = abspath(join(props['Location'], '..\\..\\Scripts')).replace(sep,'/') + "/"
scriptspath = abspath(join(props['Location'], '..\\..\\Scripts')).replace(sep, '/') + "/"

for f in map( lambda x: abspath(join(props['Location'], x)).replace(sep,'/'), props['Files']):
for f in map(lambda x: abspath(join(props['Location'], x)).replace(sep, '/'), props['Files']):
if f.endswith(".pyc"):
continue

Expand Down Expand Up @@ -249,12 +247,11 @@ def GetLongPathName(p):
category: Libs
requires: python3-core{2}{3}
""" .format(
props['Summary'],
environ['MAINTAINER'],
(" " + " ".join(sorted('python3-{}'.format(p.replace('_', '-')) for p in props['Requires']))) if props['Requires'] else "",
(" " + environ['adddepends']) if 'adddepends' in environ else ''
).encode("utf-8")
)
props['Summary'],
environ['MAINTAINER'],
(" " + " ".join(sorted('python3-{}'.format(p.replace('_', '-')) for p in props['Requires']))) if props['Requires'] else "",
(" " + environ['adddepends']) if 'adddepends' in environ else ''
).encode("utf-8"))
sf.close()

tn = join(d, "{0}-{1}-{2}-src.tar.bz2".format(pname, props['Version'], b))
Expand Down
1 change: 1 addition & 0 deletions src/gdal-dev/osgeo4w/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ export MRSID_SDK=$(cygpath -am gdaldeps/$MRSID_SDK)
-D OGDI_INCLUDE_DIRS=$(cygpath -am ../osgeo4w/include/ogdi) \
-D OGDI_LIBRARY=$(cygpath -am ../osgeo4w/lib/ogdi.lib) \
-D KEA_LIBRARY=$(cygpath -am ../osgeo4w/lib/libkea.lib) \
-D HDF5_DIR=$(cygpath -am ../osgeo4w/share/cmake) \
-D LERC_LIBRARY=$(cygpath -am ../osgeo4w/lib/Lerc.lib) \
-D SWIG_EXECUTABLE=$(cygpath -am ../osgeo4w/bin/swig.bat) \
-D GDAL_EXTRA_LINK_LIBRARIES="$(cygpath -am ../osgeo4w/lib/freetype.lib);$(cygpath -am ../osgeo4w/lib/jpeg.lib);$(cygpath -am ../osgeo4w/lib/tiff.lib);$(cygpath -am ../osgeo4w/lib/uriparser.lib);$(cygpath -am ../osgeo4w/lib/minizip.lib)" \
Expand Down
1 change: 1 addition & 0 deletions src/gdal/osgeo4w/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export MRSID_SDK=$(cygpath -am gdaldeps/$MRSID_SDK)
-D OGDI_INCLUDE_DIRS=$(cygpath -am ../osgeo4w/include/ogdi) \
-D OGDI_LIBRARY=$(cygpath -am ../osgeo4w/lib/ogdi.lib) \
-D KEA_LIBRARY=$(cygpath -am ../osgeo4w/lib/libkea.lib) \
-D HDF5_DIR=$(cygpath -am ../osgeo4w/share/cmake) \
-D LERC_LIBRARY=$(cygpath -am ../osgeo4w/lib/Lerc.lib) \
-D SWIG_EXECUTABLE=$(cygpath -am ../osgeo4w/bin/swig.bat) \
-D GDAL_EXTRA_LINK_LIBRARIES="$(cygpath -am ../osgeo4w/lib/freetype.lib);$(cygpath -am ../osgeo4w/lib/jpeg.lib);$(cygpath -am ../osgeo4w/lib/tiff.lib);$(cygpath -am ../osgeo4w/lib/uriparser.lib);$(cygpath -am ../osgeo4w/lib/minizip.lib)" \
Expand Down
2 changes: 1 addition & 1 deletion src/hdf4/osgeo4w/package.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export P=hdf4
export V=4.2.15
export V=4.2.16
export B=next
export MAINTAINER=JuergenFischer
export BUILDDEPENDS="libjpeg-turbo-devel zlib-devel szip-devel"
Expand Down
12 changes: 6 additions & 6 deletions src/hdf5/osgeo4w/package.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export P=hdf5
export V=1.10.7
export V=1.14.0
export B=next
export MAINTAINER=JuergenFischer
export BUILDDEPENDS="libjpeg-turbo-devel szip-devel zlib-devel"
Expand All @@ -9,7 +9,7 @@ source ../../../scripts/build-helpers
startlog

[ -f $P-$V.tar.bz2 ] || wget https://support.hdfgroup.org/ftp/${P^^}/releases/$P-${V%.*}/$P-$V/src/$P-$V.tar.bz2
[ -f ../CMakeLists.txt ] || tar -C .. --xform s,$P-$V/,, -xjf $P-$V.tar.bz2
[ -f ../$P-$V/CMakeLists.txt ] || tar -C .. -xjf $P-$V.tar.bz2

vs2019env
cmakeenv
Expand Down Expand Up @@ -41,7 +41,7 @@ cmake -G Ninja \
-D ZLIB_INCLUDE_DIR=$(cygpath -aw ../osgeo4w/include) \
-D HDF5_INSTALL_DATA_DIR=. \
-D HDF5_INSTALL_CMAKE_DIR=share/cmake \
../..
../../$P-$V
cmake --build .
cmake --install . || cmake --install .

Expand Down Expand Up @@ -76,9 +76,9 @@ external-source: $P
maintainer: $MAINTAINER
EOF

cp ../COPYING $R/$P-$V-$B.txt
cp ../COPYING $R/$P-devel/$P-devel-$V-$B.txt
cp ../COPYING $R/$P-tools/$P-tools-$V-$B.txt
cp ../$P-$V/COPYING $R/$P-$V-$B.txt
cp ../$P-$V/COPYING $R/$P-devel/$P-devel-$V-$B.txt
cp ../$P-$V/COPYING $R/$P-tools/$P-tools-$V-$B.txt

tar -C install -cjf $R/$P-$V-$B.tar.bz2 \
bin/hdf5.dll \
Expand Down
32 changes: 16 additions & 16 deletions src/netcdf/osgeo4w/package.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export P=netcdf
export V=4.7.4
export V=4.9.2
export B=next
export MAINTAINER=JuergenFischer
export BUILDDEPENDS="hdf4-devel hdf5-devel curl-devel zlib-devel hdf5-tools szip-devel"
Expand All @@ -8,11 +8,11 @@ source ../../../scripts/build-helpers

startlog

[ -f $P-c-$V.tar.gz ] || wget ftp://ftp.unidata.ucar.edu/pub/$P/$P-c-$V.tar.gz
[ -f ../CMakeLists.txt ] || tar -C .. --xform s,$P-c-$V/,, -xzf $P-c-$V.tar.gz
[ -f $P-c-$V.tar.gz ] || wget https://downloads.unidata.ucar.edu/$P-c/$V/$P-c-$V.tar.gz
[ -f ../$P-c-$V/CMakeLists.txt ] || tar -C .. -xzf $P-c-$V.tar.gz

if ! [ -f patched ]; then
patch -d .. -p0 <<EOF
if ! [ -f ../$P-c-$V/patched ]; then
patch -d ../$P-c-$V -p0 <<EOF
--- ../CMakeLists.txt 2016-11-21 19:27:08.000000000 +0100
+++ CMakeLists.txt 2017-05-21 18:55:29.046949000 +0200
@@ -110,7 +110,7 @@
Expand All @@ -36,7 +36,7 @@ if ! [ -f patched ]; then
#####
# Configure and print the libnetcdf.settings file.
EOF
touch patched
touch ../$P-c-$V/patched
fi

vs2019env
Expand All @@ -50,13 +50,13 @@ cmake -G Ninja \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_INSTALL_PREFIX=$(cygpath -aw ../install) \
-D CMAKE_MODULE_PATH='${CMAKE_ROOT}/cmake/modules/ ${CMAKE_SOURCE_DIR}/cmake/modules/ ${CMAKE_SOURCE_DIR}/cmake/modules/windows' \
-D HDF5_DIR=$(cygpath -aw ../osgeo4w/share/cmake/hdf5) \
-D HDF5_INCLUDE_DIR=$(cygpath -aw ../osgeo4w/include) \
-D CURL_INCLUDE_DIR=$(cygpath -aw ../osgeo4w/include) \
-D CURL_LIBRARY=$(cygpath -aw ../osgeo4w/lib/libcurl.lib) \
-D ZLIB_INCLUDE_DIR=$(cygpath -aw ../osgeo4w/include) \
-D ZLIB_LIBRARY=$(cygpath -aw ../osgeo4w/lib/zlib.lib) \
../..
-D HDF5_DIR=$(cygpath -am ../osgeo4w/share/cmake) \
-D HDF5_INCLUDE_DIR=$(cygpath -am ../osgeo4w/include) \
-D CURL_INCLUDE_DIR=$(cygpath -am ../osgeo4w/include) \
-D CURL_LIBRARY=$(cygpath -am ../osgeo4w/lib/libcurl.lib) \
-D ZLIB_INCLUDE_DIR=$(cygpath -am ../osgeo4w/include) \
-D ZLIB_LIBRARY=$(cygpath -am ../osgeo4w/lib/zlib.lib) \
../../$P-c-$V
ninja
ninja install

Expand Down Expand Up @@ -91,9 +91,9 @@ external-source: $P
maintainer: $MAINTAINER
EOF

cp ../COPYRIGHT $R/$P-$V-$B.txt
cp ../COPYRIGHT $R/$P-devel/$P-devel-$V-$B.txt
cp ../COPYRIGHT $R/$P-tools/$P-tools-$V-$B.txt
cp ../$P-c-$V/COPYRIGHT $R/$P-$V-$B.txt
cp ../$P-c-$V/COPYRIGHT $R/$P-devel/$P-devel-$V-$B.txt
cp ../$P-c-$V/COPYRIGHT $R/$P-tools/$P-tools-$V-$B.txt

sed -e "s#$(cygpath -am install)#@osgeo4w_msys@#" install/bin/nc-config >install/bin/nc-config.tmpl

Expand Down
19 changes: 12 additions & 7 deletions src/python3-h5py/osgeo4w/package.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
export P=python3-h5py
export V=pip
export B=pip
export V=3.8.0
export B=next
export MAINTAINER=JuergenFischer
export BUILDDEPENDS="python3-pip python3-wheel python3-setuptools python3-numpy python3-six hdf5-devel"
export BUILDDEPENDS="python3-pip python3-devel python3-wheel python3-setuptools python3-numpy python3-six hdf5-devel"

source ../../../scripts/build-helpers

startlog

cat <<EOF >pip.env
export LIB="$(cygpath -am osgeo4w/lib);\$LIB"
export INCLUDE="$(cygpath -am osgeo4w/include);\$INCLUDE"
EOF
[ -f h5py-$V.tar.gz ] || wget https://files.pythonhosted.org/packages/69/f4/3172bb63d3c57e24aec42bb93fcf1da4102752701ab5ad10b3ded00d0c5b/h5py-$V.tar.gz
[ -d ../h5py-$V ] || tar -C .. -xzf h5py-$V.tar.gz

export LIB="$(cygpath -am osgeo4w/lib);$LIB"
export INCLUDE="$(cygpath -am osgeo4w/include);$INCLUDE"

fetchenv osgeo4w/bin/o4w_env.bat

pip3 install ../h5py-$V

adddepends=netcdf packagewheel

Expand Down
13 changes: 13 additions & 0 deletions src/python3-isort/osgeo4w/package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export P=python3-isort
export V=pip
export B=pip
export MAINTAINER=JuergenFischer
export BUILDDEPENDS="python3-pip python3-wheel python3-setuptools python3-packaging"

source ../../../scripts/build-helpers

startlog

packagewheel

endlog
21 changes: 14 additions & 7 deletions src/python3-netcdf4/osgeo4w/package.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
export P=python3-netcdf4
export V=pip
export B=pip
export V=1.6.3
export B=next
export MAINTAINER=JuergenFischer
export BUILDDEPENDS="python3-pip python3-wheel python3-setuptools python3-cftime python3-numpy netcdf-devel hdf5-devel zlib-devel"
export BUILDDEPENDS="python3-pip python3-wheel python3-devel python3-setuptools python3-cftime python3-numpy netcdf-devel hdf5-devel zlib-devel"

tag=v${V}rel

source ../../../scripts/build-helpers

startlog

cat <<EOF >pip.env
[ -f netCDF4-$V.tar.gz ] || wget https://files.pythonhosted.org/packages/8b/92/ff3b18a2f5fe03ffc2807c2ac8b55bee2c8ee730d1100b79bc8a7ab96134/netCDF4-$V.tar.gz
[ -d ../netCDF4-$V ] || tar -C .. -xzf netCDF4-$V.tar.gz

export HDF5_DIR=$(cygpath -am osgeo4w)
export NETCDF4_DIR=$(cygpath -am osgeo4w)
export LIB="$(cygpath -am osgeo4w/lib);\$LIB"
export INCLUDE="$(cygpath -am osgeo4w/include);\$INCLUDE"
EOF
export LIB="$(cygpath -am osgeo4w/lib);$LIB"
export INCLUDE="$(cygpath -am osgeo4w/include);$INCLUDE"

fetchenv osgeo4w/bin/o4w_env.bat

pip3 install ../netCDF4-$V

adddepends="netcdf hdf5 zlib" packagewheel

Expand Down
3 changes: 3 additions & 0 deletions src/python3-pip/osgeo4w/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ source ../../../scripts/build-helpers

startlog

fetchenv osgeo4w/bin/o4w_env.bat
python3 -m pip install --upgrade pip

packagewheel

endlog
2 changes: 1 addition & 1 deletion src/qgis-dev/osgeo4w/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ sdesc: "QGIS nightly build of the $LABEL branch (metapackage with additional fre
ldesc: "QGIS nightly build of the $LABEL branch (metapackage with additional free dependencies)"
maintainer: $MAINTAINER
category: Desktop
requires: $P proj python3-pyparsing python3-simplejson python3-shapely python3-matplotlib python3-pygments qt5-tools python3-networkx python3-scipy python3-pyodbc python3-xlrd python3-xlwt setup python3-exifread python3-lxml python3-jinja2 python3-markupsafe python3-python-dateutil python3-pytz python3-nose2 python3-mock python3-httplib2 python3-pypiwin32 python3-future python3-pip python3-pillow python3-geopandas python3-geographiclib grass8 python3-pyserial saga gdal-dev-sosi
requires: $P proj python3-pyparsing python3-simplejson python3-shapely python3-matplotlib python3-pygments qt5-tools python3-networkx python3-scipy python3-pyodbc python3-xlrd python3-xlwt setup python3-exifread python3-lxml python3-jinja2 python3-markupsafe python3-python-dateutil python3-pytz python3-nose2 python3-mock python3-httplib2 python3-pypiwin32 python3-future python3-pip python3-pillow python3-geopandas python3-geographiclib grass8 python3-pyserial saga gdal-dev-sosi python3-autopep8
external-source: $P
EOF

Expand Down

0 comments on commit d23267c

Please sign in to comment.