Browse Source

Apply more osgeo4w patches (#1921)

* apply patches from jef-n/osgeo4w

* apply patches from jef-n/osgeo4w

* apply patches from jef-n/osgeo4w

* mklibs: -x flag not needed

* gisinit.c: keep version check also on Windows

* Revert "apply patches from jef-n/osgeo4w"

This reverts commit e74163b8b5be86b1c57bb541cea758688173ca8f.

* some more OSGeo4W adjustments

* rename grass.py

* configure indentation cosmetics

* package.sh: use consistently tabs for configure

* explain mv: rename grass.py to avoid ModuleNotFoundError

* use VCPATH for dumpbin

* consistent DLL copying

* libgcc_s_dw2 is 32bit; indent

* move openGL up; indent

* fix lapack; EOL

* lapack again

* add back dumpbin path

* add missing patch

* no new variable for path to dumpbin

Co-authored-by: Martin Landa <landa.martin@gmail.com>
Stefan Blumentrath 3 years ago
parent
commit
f52bc7a4a1
3 changed files with 30 additions and 9 deletions
  1. 1 0
      mswindows/osgeo4w/config.h.vc
  2. 10 2
      mswindows/osgeo4w/mklibs.sh
  3. 19 7
      mswindows/osgeo4w/package.sh

+ 1 - 0
mswindows/osgeo4w/config.h.vc

@@ -295,4 +295,5 @@
 /* define if langinfo.h exists */
 /* #undef HAVE_LANGINFO_H */
 
+#define HAVE_PROJ_H 1
 #endif /* _config_h */

+ 10 - 2
mswindows/osgeo4w/mklibs.sh

@@ -2,6 +2,15 @@
 
 set -e
 
+if [ "$CI" ] ; then
+	# dumpbin in GH actions moved to sub-directory
+	export PATH="$PATH:$(cygpath -ua 'C:/Program Files (x86)\Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.29.30133/bin/HostX64/x64/')"
+	# dumpbin in GH actions does not support options starting with "-"
+	DUMPBIN_EXPORT="/EXPORTS"
+else
+	DUMPBIN_EXPORT="-exports"
+fi
+
 [ -d mswindows/osgeo4w/vc ] || mkdir mswindows/osgeo4w/vc
 
 if [ -n "$VCPATH" ]; then
@@ -20,7 +29,7 @@ for dllfile in "$@"; do
 
  	echo "$dllfile => $dllname"
 
-	(cd $dlldir; dumpbin -exports $dllfile) |
+	(cd $dlldir; dumpbin "$DUMPBIN_EXPORT" $dllfile) |
 		sed -nf mswindows/osgeo4w/mklibs.sed |
 		egrep -v "^[	 ]*(_+IMPORT_DESCRIPTOR_.*|_+NULL_IMPORT_DESCRIPTOR)$" >mswindows/osgeo4w/vc/${defname%$VERSION}
 
@@ -28,4 +37,3 @@ for dllfile in "$@"; do
 	    lib -nologo -def:${defname} -subsystem:windows -machine:x64
 	    lib -nologo $libname || exit)
 done
-

+ 19 - 7
mswindows/osgeo4w/package.sh

@@ -129,6 +129,9 @@ DLLS="
 	/mingw64/bin/libstdc++-6.dll
 	/mingw64/bin/libgcc_s_seh-1.dll
 	/mingw64/bin/libfftw3-3.dll
+	/mingw64/bin/libblas.dll
+	/mingw64/bin/liblapack.dll
+	/mingw64/bin/libomp.dll
 "
 
 if ! [ -f mswindows/osgeo4w/configure-stamp ]; then
@@ -149,13 +152,14 @@ if ! [ -f mswindows/osgeo4w/configure-stamp ]; then
 
 	log configure
 	./configure \
-	    --host=x86_64-w64-mingw32 \
+		--host=x86_64-w64-mingw32 \
 		--with-libs="$OSGEO4W_ROOT_MSYS/lib" \
 		--with-includes=$OSGEO4W_ROOT_MSYS/include \
-        --libexecdir=$OSGEO4W_ROOT_MSYS/bin \
-        --prefix=$OSGEO4W_ROOT_MSYS/apps/grass \
-        --bindir=$OSGEO4W_ROOT_MSYS/bin \
-        --includedir=$OSGEO4W_ROOT_MSYS/include \
+		--libexecdir=$OSGEO4W_ROOT_MSYS/bin \
+		--prefix=$OSGEO4W_ROOT_MSYS/apps/grass \
+		--bindir=$OSGEO4W_ROOT_MSYS/bin \
+		--includedir=$OSGEO4W_ROOT_MSYS/include \
+		--with-opengl=windows \
 		--without-x \
 		--with-cxx \
 		--enable-shared \
@@ -178,10 +182,15 @@ if ! [ -f mswindows/osgeo4w/configure-stamp ]; then
 		--with-nls \
 		--with-zstd \
 		--with-odbc \
-	    --with-cairo \
+		--with-netcdf=${OSGEO4W_ROOT_MSYS}/bin/nc-config \
+		--with-blas \
+		--with-lapack \
+		--with-lapack-includes=/mingw64/include \
+		--with-openmp \
+		--with-wxwidgets \
+		--with-cairo \
 		--with-cairo-includes=$OSGEO4W_ROOT_MSYS/include \
 		--with-cairo-ldflags="-L$PWD/mswindows/osgeo4w/lib -lcairo -lfontconfig" \
-	    --with-opengl=windows \
 		--with-bzlib \
 		--with-liblas=$PWD/mswindows/osgeo4w/liblas-config
 
@@ -203,6 +212,9 @@ mv $OSGEO4W_ROOT_MSYS/apps/grass/grass$POSTFIX/include/grass/config.h \
    $OSGEO4W_ROOT_MSYS/apps/grass/grass$POSTFIX/include/grass/config.h.mingw
 cp mswindows/osgeo4w/config.h.switch $OSGEO4W_ROOT_MSYS/apps/grass/grass$POSTFIX/include/grass/config.h
 cp mswindows/osgeo4w/config.h.vc $OSGEO4W_ROOT_MSYS/apps/grass/grass$POSTFIX/include/grass
+# rename grass.py to avoid ModuleNotFoundError
+mv $OSGEO4W_ROOT_MSYS/apps/grass/grass$POSTFIX/etc/grass.py $OSGEO4W_ROOT_MSYS/apps/grass/grass$POSTFIX/etc/grass${POSTFIX}.py
+
 mkdir -p $OSGEO4W_ROOT_MSYS/etc/preremove $OSGEO4W_ROOT_MSYS/etc/postinstall
 sed -e "s#@POSTFIX@#$POSTFIX#g" \
     mswindows/osgeo4w/grass.bat.tmpl >$OSGEO4W_ROOT_MSYS/bin/${GRASS_EXECUTABLE}.bat