Skip to content

Commit

Permalink
Feature: Use poppler library from vcpkg (#170)
Browse files Browse the repository at this point in the history
* Use poppler library from vcpkg

* Enable private API for poppler

* Fix macos-14 runner due to actions/runner-images#10703
  • Loading branch information
MaxRev-Dev authored Nov 13, 2024
1 parent cc53713 commit bc268e5
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
api-user-nuget: ${{ secrets.API_USER_NUGET }}

- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_14.3.1.app/Contents/Developer'
run: sudo xcode-select -s '/Applications/Xcode_15.2.app/Contents/Developer'

- name: Restore cached packages
id: build-packages-cache-restore
Expand Down
2 changes: 2 additions & 0 deletions osx/gdal-makefile
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ configure_gdal:
-DCSHARP_APPLICATION_VERSION=$(GDAL_CSHARP_VERSION) \
-DBUILD_JAVA_BINDINGS=OFF \
-DBUILD_SHARED_LIBS=ON \
-DPoppler_INCLUDE_DIR=$(VCPKG_INSTALLED_DYNAMIC)/include/poppler \
-DPoppler_LIBRARY=$(VCPKG_INSTALLED_DYNAMIC)/lib/libpoppler.dylib \
-DSQLite3_INCLUDE_DIR=$(VCPKG_INSTALLED_DYNAMIC)/include \
-DSQLite3_LIBRARY=$(VCPKG_INSTALLED_DYNAMIC)/lib/libsqlite3.dylib \
-DHDF4_INCLUDE_DIR=$(BUILD_ROOT)/hdf-build/include \
Expand Down
4 changes: 2 additions & 2 deletions shared/GdalCore.opt
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ VCPKG_ROOT=$(BUILD_ROOT)/vcpkg
VCPKG_REPO=https://github.com/microsoft/vcpkg.git
VCPKG_COMMIT_VER=2024.10.21

# base requirements for both runtimes
VCPKG_REQUIRE=geos "tiff[zstd,zip,jpeg,tools,lzma,cxx,webp]" curl
# base requirements for all runtimes
VCPKG_REQUIRE=geos "tiff[zstd,zip,jpeg,tools,lzma,cxx,webp]" curl "poppler[cairo,cms,zlib,glib,curl,private-api]"
VCPKG_REQUIRE_DYNAMIC=unixodbc openssl zlib expat xerces-c zlib libxml2 libpq openjpeg cfitsio "openexr[tools]" libwebp giflib hdf5 pcre freexl libkml libpng "libjxl[tools]" netcdf-c "libgeotiff[tools]" "sqlite3[tool,rtree]" cryptopp blosc
# windows runtime now depends on GisInternals SDK
# we have nothing to install except custom geos and proj
Expand Down
2 changes: 2 additions & 0 deletions unix/gdal-makefile
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ configure_gdal:
-DGDAL_CSHARP_BUILD_NUPKG=OFF \
-DBUILD_PYTHON_BINDINGS=OFF \
-DBUILD_CSHARP_BINDINGS=ON \
-DPoppler_INCLUDE_DIR=$(VCPKG_INSTALLED_DYNAMIC)/include/poppler \
-DPoppler_LIBRARY=$(VCPKG_INSTALLED_DYNAMIC)/lib/libpoppler.so \
-DCSHARP_LIBRARY_VERSION=$(GDAL_CSHARP_VERSION) \
-DCSHARP_APPLICATION_VERSION=$(GDAL_CSHARP_VERSION) \
-DBUILD_JAVA_BINDINGS=OFF \
Expand Down
6 changes: 4 additions & 2 deletions win/partials.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,12 @@ function Build-Gdal {
$env:CMAKE_INSTALL_PREFIX = "-DCMAKE_INSTALL_PREFIX=$env:GDAL_INSTALL_DIR"
$env:PROJ_ROOT = "-DPROJ_ROOT=$env:PROJ_INSTALL_DIR"
$env:MYSQL_LIBRARY = "-DMYSQL_LIBRARY=$env:SDK_LIB\libmysql.lib"
$env:POPPLER_EXTRA_LIBRARIES = "-DPOPPLER_EXTRA_LIBRARIES=$env:SDK_LIB\freetype.lib;$env:SDK_LIB\harfbuzz.lib"
$env:WEBP_INCLUDE = "-DWEBP_INCLUDE_DIR=$env:WEBP_ROOT\include"
$env:WEBP_LIB = "-DWEBP_LIBRARY=$env:WEBP_ROOT\lib\libwebp.lib"

$env:Poppler_INCLUDE_DIR = "-DPoppler_INCLUDE_DIR=$env:VCPKG_INSTALLED\include\poppler"
$env:Poppler_LIBRARY = "-DPoppler_LIBRARY=$env:VCPKG_INSTALLED\lib\poppler.lib"

Write-BuildStep "Configuring GDAL"
Set-Location "$env:BUILD_ROOT"

Expand Down Expand Up @@ -270,7 +272,7 @@ function Build-Gdal {
-DCMAKE_CXX_FLAGS="$env:ARCH_FLAGS" `
$env:WEBP_INCLUDE $env:WEBP_LIB `
$env:PROJ_ROOT $env:MYSQL_LIBRARY `
$env:POPPLER_EXTRA_LIBRARIES `
$env:Poppler_INCLUDE_DIR $env:Poppler_LIBRARY `
-DGDAL_USE_KEA=OFF `
-DGDAL_USE_ZLIB_INTERNAL=ON `
-DGDAL_CSHARP_APPS=ON `
Expand Down

0 comments on commit bc268e5

Please sign in to comment.