Skip to content

Commit

Permalink
Apply more osgeo4w patches (#1921)
Browse files Browse the repository at this point in the history
* 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 e74163b.

* 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>
  • Loading branch information
ninsbl and landam committed Oct 22, 2021
1 parent 5cf8f89 commit f52bc7a
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
1 change: 1 addition & 0 deletions mswindows/osgeo4w/config.h.vc
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,5 @@
/* define if langinfo.h exists */
/* #undef HAVE_LANGINFO_H */

#define HAVE_PROJ_H 1
#endif /* _config_h */
12 changes: 10 additions & 2 deletions mswindows/osgeo4w/mklibs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -20,12 +29,11 @@ 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}

(cd mswindows/osgeo4w/vc ;
lib -nologo -def:${defname} -subsystem:windows -machine:x64
lib -nologo $libname || exit)
done

26 changes: 19 additions & 7 deletions mswindows/osgeo4w/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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

Expand All @@ -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
Expand Down

0 comments on commit f52bc7a

Please sign in to comment.