diff -Nru orig/rgdal/src/Makevars.ucrt patched/rgdal/src/Makevars.ucrt --- orig/rgdal/src/Makevars.ucrt 2023-04-18 15:23:01.000000000 +0200 +++ patched/rgdal/src/Makevars.ucrt 2023-10-10 12:24:03.316441300 +0200 @@ -1,9 +1,10 @@ PKG_CPPFLAGS =\ -DPROJ_H_API -LIBSHARPYUV = $(or $(and $(wildcard $(R_TOOLS_SOFT)/lib/libsharpyuv.a),-lsharpyuv),) +ifeq (,$(shell pkg-config --version 2>/dev/null)) + LIBSHARPYUV = $(or $(and $(wildcard $(R_TOOLS_SOFT)/lib/libsharpyuv.a),-lsharpyuv),) -PKG_LIBS = \ + PKG_LIBS = \ -fopenmp -lgdal -larmadillo -lopenblas -lgfortran -lquadmath -lblosc -lkea -lhdf5_cpp -lhdf5 -lgta -lsqlite3 -lmysqlclient -lspatialite -lminizip -lproj -lgeos_c -lgeos \ -ljson-c -lnetcdf -lpq -lpgcommon -lpgport \ -lpoppler -llcms2 -lfreetype -lharfbuzz -lfreetype -llz4 -lpcre2-8 \ @@ -13,6 +14,9 @@ -lopenjp2 -ljasper -lpng -ljpeg -ltiff -lwebp -lgeotiff -lgif -lxml2 -llzma \ -lodbc32 -lodbccp32 -liconv -lpsapi -lwldap32 -lsecur32 -lgdi32 -lnormaliz \ -lbz2 -lzstd -lz -lcrypto -lcrypt32 -lcfitsio -lws2_32 +else + PKG_LIBS = $(shell pkg-config --libs gdal proj) +endif all: clean winlibs