diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 428d403c798..b99187b8509 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -42,7 +42,7 @@ jobs: mingw-w64-x86_64-fftw mingw-w64-x86_64-openblas mingw-w64-x86_64-pkgconf mingw-w64-x86_64-gcc mingw-w64-x86_64-ccache mingw-w64-x86_64-zlib mingw-w64-x86_64-libiconv mingw-w64-x86_64-bzip2 mingw-w64-x86_64-gettext mingw-w64-x86_64-libsystre - mingw-w64-x86_64-libtre-git mingw-w64-x86_64-libwinpthread-git mingw-w64-x86_64-libpng + mingw-w64-x86_64-libtre-git mingw-w64-x86_64-libwinpthread-git mingw-w64-x86_64-pcre - name: Setup OSGeo4W environment @@ -52,20 +52,15 @@ jobs: package-dir: "D:/OSGeo4W_pkg" packages: | cairo-devel - fftw freetype-devel gdal-devel - gdal-ecw - gdal-mrsid geos-devel + libjpeg-turbo-devel liblas-devel libpng-devel libpq-devel libtiff-devel - libxdr netcdf-devel - pdal-devel - pdcurses proj-devel python3-core python3-jupyter @@ -75,8 +70,9 @@ jobs: python3-ply python3-pytest python3-pywin32 + python3-six python3-wxpython - regex-devel + sqlite3-devel zstd-devel - name: Set number of cores for compilation @@ -87,8 +83,6 @@ jobs: - name: Compile GRASS GIS shell: msys2 {0} run: | - export CFLAGS="${CFLAGS} -pipe" - export CXXFLAGS="${CXXFLAGS} -pipe" .github/workflows/build_osgeo4w.sh - name: Print installed versions diff --git a/mswindows/osgeo4w/build_osgeo4w.sh b/mswindows/osgeo4w/build_osgeo4w.sh index 98ed16aac1e..252b615339f 100755 --- a/mswindows/osgeo4w/build_osgeo4w.sh +++ b/mswindows/osgeo4w/build_osgeo4w.sh @@ -21,6 +21,8 @@ export C_INCLUDE_PATH=".:${OSGEO4W_ROOT_MSYS}/include:${SRC}/dist.${ARCH}/includ export PYTHONHOME=${OSGEO4W_ROOT_MSYS}/apps/Python312 export ARCH=x86_64-w64-mingw32 +CFLAGS="$CFLAGS -pipe" \ +CXXFLAGS="$CXXFLAGS -pipe" \ ./configure \ --bindir=${OSGEO4W_ROOT_MSYS}/bin \ --enable-largefile \ @@ -34,7 +36,7 @@ export ARCH=x86_64-w64-mingw32 --with-cairo \ --with-cairo-includes=${OSGEO4W_ROOT_MSYS}/include \ --with-cairo-ldflags="-L${SRC}/mswindows/osgeo4w/lib -lcairo" \ - --with-cairo-libs=$OSGEO4W_ROOT_MSYS/lib \ + --with-cairo-libs=${OSGEO4W_ROOT_MSYS}/lib \ --with-cxx \ --with-fftw \ --with-freetype \ @@ -44,6 +46,7 @@ export ARCH=x86_64-w64-mingw32 --with-includes=${OSGEO4W_ROOT_MSYS}/include \ --with-lapack \ --with-liblas=${SRC}/mswindows/osgeo4w/liblas-config \ + --with-libpng=${SRC}/mswindows/osgeo4w/libpng-config \ --with-libs="${OSGEO4W_ROOT_MSYS}/lib ${OSGEO4W_ROOT_MSYS}/bin" \ --with-netcdf=${OSGEO4W_ROOT_MSYS}/bin/nc-config \ --with-nls \ diff --git a/mswindows/osgeo4w/env.bat.tmpl b/mswindows/osgeo4w/env.bat.tmpl index 200c86f2687..04065161a78 100644 --- a/mswindows/osgeo4w/env.bat.tmpl +++ b/mswindows/osgeo4w/env.bat.tmpl @@ -8,6 +8,8 @@ REM Uncomment if you want to use Bash instead of Cmd REM Note that msys package must be also installed REM set GRASS_SH=%OSGEO4W_ROOT%\apps\msys\bin\sh.exe +set PYTHONPATH=%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\etc\python;%PYTHONPATH% +set GRASS_COMPATIBILITY_TEST=0 set GRASS_PYTHON=%OSGEO4W_ROOT%\bin\python3.exe set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj diff --git a/mswindows/osgeo4w/libpng-config b/mswindows/osgeo4w/libpng-config index f00a136be1e..e8d8be2f671 100755 --- a/mswindows/osgeo4w/libpng-config +++ b/mswindows/osgeo4w/libpng-config @@ -14,7 +14,7 @@ prefix="${OSGEO4W_ROOT_MSYS}" version="$(sed '/^#define PNG_LIBPNG_VER_STRING/!d; s/^[^"]*"\|"//g' ${prefix}/include/libpng*/png.h)" -dll_version="$(sed '/^#define PNG_LIBPNG_VER_DLLNUM/!d; s/^[^0-9]*\|[^0-9]*$//g' ${prefix}/include/libpng*/png.h)" +dll_version="$(sed '/^#define PNG_LIBPNG_VER_SHAREDLIB/!d; s/^[^0-9]*\|[^0-9]*$//g' ${prefix}/include/libpng*/png.h)" exec_prefix="${prefix}" libdir="${prefix}/lib" includedir="${prefix}/include/libpng${dll_version}" diff --git a/mswindows/osgeo4w/package.sh b/mswindows/osgeo4w/package.sh index 643d6735362..2d62553a5c8 100755 --- a/mswindows/osgeo4w/package.sh +++ b/mswindows/osgeo4w/package.sh @@ -1,8 +1,9 @@ -#!/usr/bin/bash +#!/bin/bash set -e -PWD="$(pwd)" +export ARCH=x86_64-w64-mingw32 +export SRC=$PWD if ! [ -d mswindows ]; then echo Start from GRASS toplevel dir @@ -107,31 +108,24 @@ fi exec 3>&1 > >(tee mswindows/osgeo4w/package.log) 2>&1 DLLS=" - /mingw64/bin/libbrotlicommon.dll - /mingw64/bin/libbrotlidec.dll /mingw64/bin/libbz2-1.dll - /mingw64/bin/libcairo-2.dll /mingw64/bin/libfftw3-3.dll - /mingw64/bin/libfontconfig-1.dll - /mingw64/bin/libfreetype-6.dll /mingw64/bin/libgcc_s_seh-1.dll /mingw64/bin/libgfortran-5.dll - /mingw64/bin/libglib-2.0-0.dll /mingw64/bin/libgomp-1.dll - /mingw64/bin/libgraphite2.dll - /mingw64/bin/libharfbuzz-0.dll /mingw64/bin/libiconv-2.dll /mingw64/bin/libintl-8.dll + /mingw64/bin/libopenblas.dll /mingw64/bin/libpcre-1.dll /mingw64/bin/libpixman-1-0.dll /mingw64/bin/libpng16-16.dll /mingw64/bin/libquadmath-0.dll + /mingw64/bin/libreadline8.dll /mingw64/bin/libstdc++-6.dll /mingw64/bin/libsystre-0.dll /mingw64/bin/libtre-5.dll /mingw64/bin/libwinpthread-1.dll /mingw64/bin/zlib1.dll - /mingw64/bin/libopenblas.dll " if ! [ -f mswindows/osgeo4w/configure-stamp ]; then @@ -143,52 +137,54 @@ if ! [ -f mswindows/osgeo4w/configure-stamp ]; then log remove old logs rm -f mswindows/osgeo4w/package.log.* - mkdir -p dist.x86_64-w64-mingw32/bin - cp -uv $DLLS dist.x86_64-w64-mingw32/bin - mkdir -p mswindows/osgeo4w/lib - cp -uv $OSGEO4W_ROOT_MSYS/lib/libpq.lib mswindows/osgeo4w/lib/pq.lib cp -uv $OSGEO4W_ROOT_MSYS/lib/sqlite3_i.lib mswindows/osgeo4w/lib/sqlite3.lib + log configure + CFLAGS="$CFLAGS -pipe" \ + CXXFLAGS="$CXXFLAGS -pipe" \ ./configure \ - --bindir=$OSGEO4W_ROOT_MSYS/bin \ + --bindir=${OSGEO4W_ROOT_MSYS}/bin \ --enable-largefile \ --enable-shared \ - --host=x86_64-w64-mingw32 \ - --includedir=$OSGEO4W_ROOT_MSYS/include \ - --libexecdir=$OSGEO4W_ROOT_MSYS/bin \ - --prefix=$OSGEO4W_ROOT_MSYS/apps/grass \ + --host=${ARCH} \ + --includedir=${OSGEO4W_ROOT_MSYS}/include \ + --libexecdir=${OSGEO4W_ROOT_MSYS}/bin \ + --prefix=${OSGEO4W_ROOT_MSYS}/apps/grass \ --with-blas \ --with-bzlib \ --with-cairo \ - --with-cairo-includes=$OSGEO4W_ROOT_MSYS/include \ - --with-cairo-ldflags="-L$PWD/mswindows/osgeo4w/lib -lcairo -lfontconfig" \ + --with-cairo-includes=${OSGEO4W_ROOT_MSYS}/include \ + --with-cairo-ldflags="-L${SRC}/mswindows/osgeo4w/lib -lcairo" \ + --with-cairo-libs=${OSGEO4W_ROOT_MSYS}/lib \ --with-cxx \ --with-fftw \ --with-freetype \ - --with-freetype-includes=/mingw64/include/freetype2 \ - --with-gdal=$PWD/mswindows/osgeo4w/gdal-config \ - --with-geos=$PWD/mswindows/osgeo4w/geos-config \ - --with-includes=$OSGEO4W_ROOT_MSYS/include \ + --with-freetype-includes=${OSGEO4W_ROOT_MSYS}/include/freetype2 \ + --with-gdal=${SRC}/mswindows/osgeo4w/gdal-config \ + --with-geos=${SRC}/mswindows/osgeo4w/geos-config \ + --with-includes=${OSGEO4W_ROOT_MSYS}/include \ --with-lapack \ - --with-liblas=$PWD/mswindows/osgeo4w/liblas-config \ - --with-libs="$OSGEO4W_ROOT_MSYS/lib" \ + --with-liblas=${SRC}/mswindows/osgeo4w/liblas-config \ + --with-libpng=${SRC}/mswindows/osgeo4w/libpng-config \ + --with-libs="${OSGEO4W_ROOT_MSYS}/lib ${OSGEO4W_ROOT_MSYS}/bin" \ --with-netcdf=${OSGEO4W_ROOT_MSYS}/bin/nc-config \ --with-nls \ --with-odbc \ --with-opengl=windows \ --with-openmp \ --with-postgres \ - --with-postgres-includes=$OSGEO4W_ROOT_MSYS/include \ - --with-postgres-libs=$PWD/mswindows/osgeo4w/lib \ - --with-proj-includes=$OSGEO4W_ROOT_MSYS/include \ - --with-proj-libs=$OSGEO4W_ROOT_MSYS/lib \ - --with-proj-share=$OSGEO4W_ROOT_MSYS/share/proj \ + --with-postgres-includes=${OSGEO4W_ROOT_MSYS}/include \ + --with-postgres-libs=${OSGEO4W_ROOT_MSYS}/lib \ + --with-proj-includes=${OSGEO4W_ROOT_MSYS}/include \ + --with-proj-libs=${OSGEO4W_ROOT_MSYS}/lib \ + --with-proj-share=${OSGEO4W_ROOT_MSYS}/share/proj \ + --with-readline \ --with-regex \ --with-sqlite \ - --with-sqlite-includes=$OSGEO4W_ROOT_MSYS/include \ - --with-sqlite-libs=$PWD/mswindows/osgeo4w/lib \ + --with-sqlite-includes=${OSGEO4W_ROOT_MSYS}/include \ + --with-sqlite-libs=${OSGEO4W_ROOT_MSYS}/lib \ --with-zstd \ --without-pdal \ --without-x @@ -244,9 +240,11 @@ if [ -n "$PACKAGE_PATCH" ]; then unix2dos etc/postinstall/grass${PACKAGE_POSTFIX}.bat unix2dos etc/preremove/grass${PACKAGE_POSTFIX}.bat - # copy dependencies (TODO: to be reduced) - cp -uv $DLLS apps/grass/grass$POSTFIX/bin - cp -uv /mingw64/etc/fonts/fonts.conf apps/grass/grass$POSTFIX/etc + # copy dependencies + cp -uv $(/usr/bin/find apps/grass/grass$POSTFIX -iname "*.dll" -o -iname "*.exe" | PATH=$PWD/apps/grass/grass$POSTFIX/lib:$PWD/bin:/mingw64/bin:/usr/bin /usr/bin/xargs /usr/bin/ldd | /usr/bin/sed -ne 's#^.* => \(/mingw64/bin/.*\) (.*)$#\1#p' | /usr/bin/sort -u) apps/grass/grass$POSTFIX/bin + + # copy R batch files + cp -uv $SRC/mswindows/external/rbatch/* apps/grass/grass$POSTFIX/bin # creating grass package /bin/tar -cjf $PDIR/grass$PACKAGE_POSTFIX-$VERSION-$PACKAGE_PATCH.tar.bz2 \