Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI(OSGeo4W): Osgeo4w patch package #286

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
cc4e522
patch from https://github.com/jef-n/OSGeo4W/blob/master/src/grass/osg…
landam Jul 31, 2024
d904476
Merge branch 'main' into osgeo4w_patch
landam Jul 31, 2024
42ef646
v.out.ogr: Add basic unit tests (#3848)
ldesousa Jul 31, 2024
3b2313f
attempt to fix osgeo4w CI
landam Jul 31, 2024
fd270e0
Revert "v.out.ogr: Add basic unit tests (#3848)"
landam Jul 31, 2024
907a884
Merge branch 'main' into osgeo4w_patch
landam Jul 31, 2024
daba1e6
re-introduce mingw-w64-x86_64-libpng
landam Aug 4, 2024
feb3a5c
Merge branch 'main' into osgeo4w_patch
landam Aug 4, 2024
56dc8ef
sync with osgeo4w patch
landam Aug 6, 2024
b435503
add numpy into deps in order to fix some tests
landam Aug 22, 2024
a78f378
Merge branch 'main' into osgeo4w_patch
landam Aug 22, 2024
3d1af45
Merge remote-tracking branch 'origin/main' into osgeo4w_patch
echoix Sep 21, 2024
5c4bd6a
CI(OSGeo4W): Sort OSGeo4W packages in a multiline list
echoix Sep 21, 2024
cb11b60
Merge branch 'main' into osgeo4w_patch
echoix Sep 23, 2024
f9f9d52
Merge branch 'main' into osgeo4w_patch
landam Oct 1, 2024
ba31883
Add back matplotlib package
echoix Oct 6, 2024
6e7532a
style: Sort packages and configure flags in mswindows build scripts
echoix Nov 10, 2024
b4a86c4
Merge branch 'main' into osgeo4w_patch
echoix Nov 10, 2024
b5770df
Remove LLVM's OpenMP library and use GCC's OpenMP library
echoix Nov 12, 2024
8fb0a36
Remove OPENMP_CFLAGS from OPENMP_LIB in Platform.make.in
echoix Nov 12, 2024
21c8c5a
Compile and upload package using package.sh
echoix Nov 12, 2024
86020a1
Use mingw-w64-x86_64-omp
echoix Nov 12, 2024
48316e1
Add mingw-w64-x86_64-lapack package
echoix Nov 12, 2024
d9368a1
Do not fail step print_version.sh missing msys2 paths
echoix Nov 12, 2024
b113692
Update osgeo4w workflow to continue on error
echoix Nov 12, 2024
81593b6
Merge branch 'main' into osgeo4w_patch-package
echoix Nov 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 51 additions & 14 deletions .github/workflows/osgeo4w.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,24 @@ 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-pcre
mingw-w64-x86_64-libtre-git mingw-w64-x86_64-libwinpthread-git
mingw-w64-x86_64-pcre mingw-w64-x86_64-omp mingw-w64-x86_64-lapack

- name: Setup OSGeo4W environment
uses: echoix/setup-OSGeo4W@17deecd39e077a80bf1081443998ea8edd6f15bf # v0.1.0
with:
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
Expand All @@ -74,10 +69,30 @@ jobs:
python3-ply
python3-pytest
python3-pywin32
python3-six
python3-wxpython
regex-devel
sqlite3-devel
zstd-devel

- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H-%M-%S" UTC)
file(APPEND "$ENV{GITHUB_OUTPUT}" "timestamp=${current_date}")
- name: ccache cache files
uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
path: .ccache
key: ${{ matrix.os }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
restore-keys: |
${{ matrix.os }}-ccache-
save-always: true
- name: Configure ccache
run: |
echo "CCACHE_BASEDIR=${GITHUB_WORKSPACE}" >> "${GITHUB_ENV}"
echo "CCACHE_DIR=${GITHUB_WORKSPACE}/.ccache" >> "${GITHUB_ENV}"
echo "CCACHE_MAXSIZE=400M" >> "${GITHUB_ENV}"
shell: msys2 {0}
- name: Set number of cores for compilation
run: |
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
Expand All @@ -88,26 +103,48 @@ jobs:
run: |
export CFLAGS="${CFLAGS} -pipe"
export CXXFLAGS="${CXXFLAGS} -pipe"
.github/workflows/build_osgeo4w.sh
ccache --show-stats
MSYSPATH=$(cygpath -a msys64/usr/bin):$OSGEO4W_ROOT_MSYS/bin:$(cygpath --sysdir)
MSYSPATH=${MSYSPATH//\/cygdrive/}
ccache --show-config
ccache --zero-stats
PATH=$MSYSPATH:$PATH mswindows/osgeo4w/package.sh
ccache --show-stats --verbose --verbose
env:
PACKAGE_POSTFIX: "-dev"
OSGEO4W_ROOT: "C:\\OSGeo4W"
OSGEO4W_ROOT_MSYS: "/c/OSGeo4W"
PACKAGE_PATCH: ${{ github.sha }}-1
- name: Upload OSGeo4W grass package artifact
if: ${{ !cancelled() }}
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: grass-osgeo4w-package-${{ matrix.os }}
path: mswindows/osgeo4w/package
include-hidden-files: true
retention-days: 3

- name: Print installed versions
if: always()
shell: msys2 {0}
run: .github/workflows/print_versions.sh
# TODO: find the step that adds back msys2 env into a file loaded by osgeo4w shell
continue-on-error: true

- name: Test executing of the grass command
run: .github/workflows/test_simple.bat 'C:\OSGeo4W\opt\grass\grass85.bat'
run: .github/workflows/test_simple.bat 'C:\OSGeo4W\bin\grass85.bat'

- name: Test executing of the grass command in bash
shell: msys2 {0}
run: .github/workflows/test_simple.sh
continue-on-error: true # TODO

- name: Install pytest plugins
run: python -m pip install pytest-timeout
shell: cmd /D /E:ON /V:OFF /S /C "CALL C:/OSGeo4W/OSGeo4W.bat "{0}""
- name: Run pytest with a single worker
run: |
call %OSGEO4W_ROOT%\opt\grass\etc\env.bat
call %OSGEO4W_ROOT%\apps\grass\grass85\etc\env.bat
set PYTHONPATH=%GISBASE%\etc\python;%PYTHONPATH%
path %GISBASE%\lib;%GISBASE%\bin;%PATH%
pytest --verbose --color=yes ^
Expand All @@ -116,7 +153,7 @@ jobs:
shell: cmd /D /E:ON /V:OFF /S /C "CALL C:/OSGeo4W/OSGeo4W.bat "{0}""

- name: Run tests
run: .github/workflows/test_thorough.bat 'C:\OSGeo4W\opt\grass\grass85.bat' 'C:\OSGeo4W\bin\python3'
run: .github/workflows/test_thorough.bat 'C:\OSGeo4W\bin\grass85.bat' 'C:\OSGeo4W\bin\python3'

- name: Make HTML test report available
if: ${{ always() }}
Expand Down
2 changes: 1 addition & 1 deletion include/Make/Grass.make
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ DSPFDEPS = $(GISLIB)
FORMDEPS = $(DBMILIB) $(GISLIB)
RASTER3DDEPS = $(RASTERLIB) $(GISLIB)
GISDEPS = $(DATETIMELIB) $(ZLIBLIBPATH) $(ZLIB) $(BZIP2LIBPATH) $(BZIP2LIB) $(ZSTDLIBPATH) $(ZSTDLIB) $(INTLLIB) $(REGEXLIBPATH) $(REGEXLIB) $(ICONVLIB) $(PTHREADLIBPATH) $(PTHREADLIB) $(MATHLIB)
GMATHDEPS = $(GISLIB) $(FFTWLIB) $(LAPACKLIB) $(BLASLIB) $(CCMATHLIB) $(OPENMP_CFLAGS) $(OPENMP_LIBPATH) $(OPENMP_LIB)
GMATHDEPS = $(GISLIB) $(FFTWLIB) $(LAPACKLIB) $(BLASLIB) $(CCMATHLIB) $(OPENMP_LIBPATH) $(OPENMP_LIB)
GPDEDEPS = $(RASTER3DLIB) $(RASTERLIB) $(GISLIB) $(GMATHLIB) $(OPENMP_LIBPATH) $(OPENMP_LIB) $(MATHLIB)
GPROJDEPS = $(GISLIB) $(GDALLIBS) $(PROJLIB) $(MATHLIB)
HTMLDRIVERDEPS = $(DRIVERLIB) $(GISLIB) $(MATHLIB)
Expand Down
3 changes: 2 additions & 1 deletion mswindows/osgeo4w/build_osgeo4w.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,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 \
Expand All @@ -44,6 +44,7 @@ export ARCH=x86_64-w64-mingw32
--with-includes=${OSGEO4W_ROOT_MSYS}/include \
--with-lapack \
--with-liblas=${SRC}/mswindows/osgeo4w/liblas-config \
--with-libpng=$PWD/mswindows/osgeo4w/libpng-config \
--with-libs="${OSGEO4W_ROOT_MSYS}/lib ${OSGEO4W_ROOT_MSYS}/bin" \
--with-netcdf=${OSGEO4W_ROOT_MSYS}/bin/nc-config \
--with-nls \
Expand Down
2 changes: 2 additions & 0 deletions mswindows/osgeo4w/env.bat.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion mswindows/osgeo4w/libpng-config
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
47 changes: 20 additions & 27 deletions mswindows/osgeo4w/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,26 +108,16 @@ exec 3>&1 > >(tee mswindows/osgeo4w/package.log) 2>&1

DLLS="
/mingw64/bin/libblas.dll
/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/liblapack.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
Expand All @@ -148,45 +138,46 @@ if ! [ -f mswindows/osgeo4w/configure-stamp ]; then
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
./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 \
--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$PWD/mswindows/osgeo4w/lib -lcairo" \
--with-cxx \
--with-fftw \
--with-freetype \
--with-freetype-includes=/mingw64/include/freetype2 \
--with-freetype-includes=${OSGEO4W_ROOT_MSYS}/include/freetype2 \
--with-gdal=$PWD/mswindows/osgeo4w/gdal-config \
--with-geos=$PWD/mswindows/osgeo4w/geos-config \
--with-includes=$OSGEO4W_ROOT_MSYS/include \
--with-includes=${OSGEO4W_ROOT_MSYS}/include \
--with-lapack \
--with-lapack-includes=/mingw64/include \
--with-liblas=$PWD/mswindows/osgeo4w/liblas-config \
--with-libs="$OSGEO4W_ROOT_MSYS/lib" \
--with-libpng=$PWD/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-regex \
--with-sqlite \
--with-sqlite-includes=$OSGEO4W_ROOT_MSYS/include \
Expand Down Expand Up @@ -248,7 +239,9 @@ if [ -n "$PACKAGE_PATCH" ]; then

# 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 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 \
Expand Down
Loading