Skip to content

Commit

Permalink
Update workfow
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxRev-Dev committed Jan 22, 2024
1 parent a961bd4 commit 1a93492
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 18 deletions.
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# gdal.netcore [![Mentioned in Awesome Geospatial](https://awesome.re/mentioned-badge.svg)](https://github.com/sacridini/Awesome-Geospatial) ![Packages CI](https://github.com/MaxRev-Dev/gdal.netcore/workflows/CI/badge.svg?branch=master)
# gdal.netcore [![Mentioned in Awesome Geospatial](https://awesome.re/mentioned-badge.svg)](https://github.com/sacridini/Awesome-Geospatial)

A simple (as is) build engine of [GDAL](https://gdal.org/) 3.7.0 library for [.NET](https://dotnet.microsoft.com/download).
[![Linux Build](https://github.com/MaxRev-Dev/gdal.netcore/actions/workflows/unix.yml/badge.svg)](https://github.com/MaxRev-Dev/gdal.netcore/actions/workflows/unix.yml)
[![MacOS Build](https://github.com/MaxRev-Dev/gdal.netcore/actions/workflows/macos.yml/badge.svg)](https://github.com/MaxRev-Dev/gdal.netcore/actions/workflows/macos.yml)
[![Windows Build](https://github.com/MaxRev-Dev/gdal.netcore/actions/workflows/windows.yml/badge.svg)](https://github.com/MaxRev-Dev/gdal.netcore/actions/workflows/windows.yml)

A simple (as is) build engine of [GDAL](https://gdal.org/) 3.7.3 library for [.NET](https://dotnet.microsoft.com/download).

Provides a minimal setup without requirements to install heavy [GDAL binaries](https://gdal.org/download.html#binaries) into your system.

## Packages (NuGet)

[MaxRev.Gdal.Core](https://www.nuget.org/packages/MaxRev.Gdal.Core/) <br/>
[MaxRev.Gdal.LinuxRuntime.Minimal](https://www.nuget.org/packages/MaxRev.Gdal.LinuxRuntime.Minimal/) <br/>
[MaxRev.Gdal.WindowsRuntime.Minimal](https://www.nuget.org/packages/MaxRev.Gdal.WindowsRuntime.Minimal/)<br/>
[MaxRev.Gdal.MacosRuntime.Minimal.x64](https://www.nuget.org/packages/MaxRev.Gdal.MacosRuntime.Minimal.x64/)<br/>
[MaxRev.Gdal.Core](https://www.nuget.org/packages/MaxRev.Gdal.Core/) <br>
[MaxRev.Gdal.WindowsRuntime.Minimal](https://www.nuget.org/packages/MaxRev.Gdal.WindowsRuntime.Minimal/)<br>
[MaxRev.Gdal.LinuxRuntime.Minimal.x64](https://www.nuget.org/packages/MaxRev.Gdal.LinuxRuntime.Minimal.x64/) <br>
[MaxRev.Gdal.LinuxRuntime.Minimal.arm64](https://www.nuget.org/packages/MaxRev.Gdal.LinuxRuntime.Minimal.arm64/) <br>
[MaxRev.Gdal.MacosRuntime.Minimal.x64](https://www.nuget.org/packages/MaxRev.Gdal.MacosRuntime.Minimal.x64/)<br>
[MaxRev.Gdal.MacosRuntime.Minimal.arm64](https://www.nuget.org/packages/MaxRev.Gdal.MacosRuntime.Minimal.arm64/)

## Table Of Contents
Expand Down Expand Up @@ -62,7 +69,8 @@ A simple (as is) build engine of [GDAL](https://gdal.org/) 3.7.0 library for [.N
2. Install [libraries](#packages) for your runtime. You can install one of them or all with no conflicts.
```powershell
Install-Package MaxRev.Gdal.WindowsRuntime.Minimal
Install-Package MaxRev.Gdal.LinuxRuntime.Minimal
Install-Package MaxRev.Gdal.LinuxRuntime.Minimal.arm64
Install-Package MaxRev.Gdal.LinuxRuntime.Minimal.x64
Install-Package MaxRev.Gdal.MacosRuntime.Minimal.arm64
Install-Package MaxRev.Gdal.MacosRuntime.Minimal.x64
```
Expand Down Expand Up @@ -101,16 +109,16 @@ Detailed guide is here - [osx](osx/).

## About build configuration

The current version targets **GDAL 3.7.0** with **minimal drivers**. What stands for 'minimal' - drivers that require no additional dependencies (mainly boost). For example, `MySQL` driver is not included, because it requires 15+ boost deps. Same goes for `Poppler` driver. They can be packaged upon request.
The package configuration is marked as **minimal**. That means you don't have to install [GDAL binaries](https://gdal.org/download.html#binaries). Also, some uncommon drivers are not available (were not built).

Drivers included PROJ(9.2.0), GEOS(3.11.1), and more than 200 other drivers.
Drivers included PROJ, GEOS, and more than 200 other drivers.
To view full list of drivers, To view the complete list of drivers, you can view the full list with GDAL's API or see property `DriversInCurrentVersion` [here](tests/MaxRev.Gdal.Core.Tests.XUnit/CommonTests.cs).

**NOTE**: Runtime drivers availability may differ. Ask me about a specific driver for runtime. Please issue if I need to mention any packages.

## Building runtime libraries

Current version is targeting **GDAL 3.7.0** version. Each runtime has to be build separately, but this can be done concurrently as they are using different contexts (build folders). Primary operating bindings (in gdal.core package) are build from **windows**. Still, the resulting core bindings are the same on each runtime package (OS).
Each runtime has to be build separately, but this can be done concurrently as they are using different contexts (build folders). Primary operating bindings (in gdal.core package) are build from **windows**. Still, the resulting core bindings are the same on each runtime package (OS).

To make everything work smoothly, each configuration targets the same drivers and their versions, respectively.

Expand Down
14 changes: 8 additions & 6 deletions shared/GdalCore.opt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ BUILD_NUMBER_TAIL=10
### build (drivers) root
BUILD_ROOT=$(ROOTDIR_)/build-$(BASE_RUNTIME_RID)

# May 2, 2023
GDAL_VERSION=3.7.0
# Nov 3, 2023
GDAL_VERSION=3.7.3
GDAL_ROOT=$(BUILD_ROOT)/gdal-source
GDAL_REPO=https://github.com/OSGeo/gdal.git
GDAL_COMMIT_VER=v$(GDAL_VERSION)

# Mar 1, 2023
PROJ_VERSION=9.2.0
# Dec 1, 2023
PROJ_VERSION=9.3.1
PROJ_ROOT=$(BUILD_ROOT)/proj-source
PROJ_REPO=https://github.com/OSGeo/PROJ.git
PROJ_COMMIT_VER=$(PROJ_VERSION)
Expand All @@ -29,7 +29,7 @@ VCPKG_COMMIT_VER=2024.01.12

# base requirements for both runtimes
VCPKG_REQUIRE=geos "tiff[zstd,zip,jpeg,tools,lzma,cxx,webp]" curl
VCPKG_REQUIRE_DYNAMIC=openssl zlib expat xerces-c zlib libxml2 libpq openjpeg cfitsio unixodbc libwebp giflib "hdf5[cpp]" pcre freexl libkml "icu[core,tools]" libpng "libjxl[tools]" netcdf-c "libgeotiff[tools]"
VCPKG_REQUIRE_DYNAMIC=openssl zlib expat xerces-c zlib libxml2 libpq openjpeg cfitsio unixodbc libwebp giflib "hdf5[cpp]" pcre freexl libkml libpng "libjxl[tools]" netcdf-c "libgeotiff[tools]"
# windows runtime now depends on GisInternals SDK
# we have nothing to install except custom geos and proj
VCPKG_REQUIRE_WIN=$(VCPKG_REQUIRE) "sqlite3[tool,rtree]"
Expand Down Expand Up @@ -74,7 +74,7 @@ BASE_SWIG_=$(GDAL_ROOT)/swig
BASE_CSHARP_=$(BASE_SWIG_)/csharp
SWIG_INCLUDE_=$(BASE_SWIG_)/include

##### HDF build location
##### HDF build location (only for osx)
HDF_BUILD=$(BUILD_ROOT)/hdf-build
HDF_CMAKE_TMP=$(BUILD_ROOT)/hdf-cmake-temp
HDF_VERSION=4.2.16-2
Expand All @@ -99,12 +99,14 @@ GDALCORE_PROJECT=$(ROOTDIR_)/shared/templates/gdalcore.loader.csproj.in
RUNTIME_PROJECT_LINUX=$(ROOTDIR_)/shared/templates/gdalcore.linuxruntime.csproj.in
RUNTIME_PROJECT_OSX=$(ROOTDIR_)/shared/templates/gdalcore.macosruntime.csproj.in
RUNTIME_PROJECT_WIN=$(ROOTDIR_)/shared/templates/gdalcore.windowsruntime.csproj.in
RUNTIME_PROJECT_BUNDLE=$(ROOTDIR_)/shared/templates/gdalcore.bundle.csproj.in

# Generated project files
GDALCORE_PROJECT_FINAL=$(PACKAGE_BUILD_ROOT)/gdalcore.loader.final.csproj
RUNTIME_PROJECT_LINUX_FINAL=$(PACKAGE_BUILD_ROOT)/gdalcore.linuxruntime.final.csproj
RUNTIME_PROJECT_OSX_FINAL=$(PACKAGE_BUILD_ROOT)/gdalcore.macosruntime.final.csproj
RUNTIME_PROJECT_WIN_FINAL=$(PACKAGE_BUILD_ROOT)/gdalcore.windowsruntime.final.csproj
RUNTIME_PROJECT_BUNDLE_FINAL=$(PACKAGE_BUILD_ROOT)/gdalcore.bundle.final.csproj

GIT=git
GIT_CLEAN=$(GIT) clean -fqdx
Expand Down
40 changes: 40 additions & 0 deletions shared/templates/gdalcore.bundle.csproj.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Platforms>arm64;x64</Platforms>
<DebugType>portable</DebugType>
<TargetFrameworks>netstandard2.0;netstandard2.1;netcoreapp3.1;net6.0;net7.0;net8.0</TargetFrameworks>
<Copyright>MaxRev © 2024</Copyright>
<Authors>MaxRev</Authors>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PackageId>MaxRev.Gdal.Bundle.Minimal</PackageId>
<AssemblyName>MaxRev.Gdal.Bundle.Minimal</AssemblyName>
<PackageTags>gdal;netcore;docker</PackageTags>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/MaxRev-Dev/gdal.netcore</RepositoryUrl>
<Version>${_PACKAGE_BUILD_NUMBER}</Version>
<Description>GDAL (${_GDAL_VERSION}) minimal libraries package.
Drivers included PROJ (${_PROJ_VERSION}), GEOS (${_GEOS_VERSION}), SQLITE3, CURL, JPEG, PNG, HDF4, HDF5
Targets linux-${_BUILD_ARCH} runtime. Target Frameworks: netstandard[2.1|2.0], netcoreapp[2.1,3.1], net6.0, net7.0, net8.0
</Description>
<PackageReleaseNotes>
- GDAL ${_GDAL_VERSION}
- PROJ ${_PROJ_VERSION}</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MaxRev.Gdal.Core" Version="${_GDAL_VERSION}.*" />
<PackageReference Include="MaxRev.Gdal.LinuxRuntime.Minimal.arm64" Version="${_GDAL_VERSION}.*" />
<PackageReference Include="MaxRev.Gdal.LinuxRuntime.Minimal.x64" Version="${_GDAL_VERSION}.*" />
<PackageReference Include="MaxRev.Gdal.MacosRuntime.Minimal.arm64" Version="${_GDAL_VERSION}.*" />
<PackageReference Include="MaxRev.Gdal.MacosRuntime.Minimal.x64" Version="${_GDAL_VERSION}.*" />
<PackageReference Include="MaxRev.Gdal.WindowsRuntime.Minimal.x64" Version="${_GDAL_VERSION}.*" />
</ItemGroup>

<ItemGroup>
<None Include="${_ROOT_RELATIVE_PATH}/README.md" Pack="true" PackagePath="/" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion shared/templates/gdalcore.linuxruntime.csproj.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Version>${_PACKAGE_BUILD_NUMBER}</Version>
<Description>GDAL (${_GDAL_VERSION}) minimal libraries package.
Drivers included PROJ (${_PROJ_VERSION}), GEOS (${_GEOS_VERSION}), SQLITE3, CURL, JPEG, PNG, HDF4, HDF5
Targets linux-${BUILD_ARCH} runtime. Target Frameworks: netstandard[2.1|2.0], netcoreapp[2.1,3.1], net6.0, net7.0, net8.0
Targets linux-${_BUILD_ARCH} runtime. Target Frameworks: netstandard[2.1|2.0], netcoreapp[2.1,3.1], net6.0, net7.0, net8.0
</Description>
<AssemblyName>MaxRev.Gdal.LinuxRuntime.Minimal.${_BUILD_ARCH}</AssemblyName>
<PackageReleaseNotes>
Expand Down
2 changes: 1 addition & 1 deletion shared/templates/gdalcore.windowsruntime.csproj.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<Version>${_PACKAGE_BUILD_NUMBER}</Version>
<Description>GDAL (${_GDAL_VERSION}) minimal libraries package.
Drivers included PROJ (${_PROJ_VERSION}), GEOS (${_GEOS_VERSION}), SQLITE3, CURL, JPEG, PNG, HDF4, HDF5
Targets win-${BUILD_ARCH} runtime. Target Frameworks: netstandard[2.1|2.0], netcoreapp[2.1,3.1], net6.0, net7.0, net8.0
Targets win-${_BUILD_ARCH} runtime. Target Frameworks: netstandard[2.1|2.0], netcoreapp[2.1,3.1], net6.0, net7.0, net8.0
</Description>
<AssemblyName>MaxRev.Gdal.WindowsRuntime.Minimal</AssemblyName>
<PackageReleaseNotes>
Expand Down
1 change: 1 addition & 0 deletions unix/generate-projects-makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ generate-projects:
@cat $(RUNTIME_PROJECT_LINUX) | envsubst $${ONSUBST} > $(RUNTIME_PROJECT_LINUX_FINAL)
@cat $(RUNTIME_PROJECT_OSX) | envsubst $${ONSUBST} > $(RUNTIME_PROJECT_OSX_FINAL)
@cat $(RUNTIME_PROJECT_WIN) | envsubst $${ONSUBST} > $(RUNTIME_PROJECT_WIN_FINAL)
@cat $(RUNTIME_PROJECT_BUNDLE) | envsubst $${ONSUBST} > $(RUNTIME_PROJECT_BUNDLE_FINAL)

get-version:
@grep -o "[Vv]ersion:\s.*" $(IN_FILE) | cut -d: -f2 | xargs
Expand Down

0 comments on commit 1a93492

Please sign in to comment.