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

Feature: Enhancements #171

Closed
wants to merge 16 commits into from
Closed
4 changes: 4 additions & 0 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ on:
is-version-branch:
type: boolean
required: true
skip:
type: boolean
required: true

env:
DOTNET_INSTALL_DIR: ${{ github.workspace }}/.dotnet/
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg-archives/

jobs:
BuildNugetPackages-MacOS:
if: ${{ ! inputs.skip }}
strategy:
matrix:
os: [macos-14, macos-13]
Expand Down
26 changes: 24 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,36 @@ jobs:
is-pre-release: ${{ steps.set.outputs.is_pre_release }}
dotnet-version: ${{ steps.set.outputs.dotnet_version }}
is-version-branch: ${{ steps.set.outputs.is_version_branch }}
skip-unix: ${{ steps.set.outputs.skip_unix }}
skip-windows: ${{ steps.set.outputs.skip_windows }}
skip-osx: ${{ steps.set.outputs.skip_osx }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}

- name: Set env for the reusable workflows
id: set
run: |
echo "is_pre_release=$IS_PRE_RELEASE" >> $GITHUB_OUTPUT
echo "is_pre_release=$IS_PRE_RELEASE" >> $GITHUB_OUTPUT
echo "dotnet_version=$DOTNET_VERSION" >> $GITHUB_OUTPUT
if [[ ${{ github.ref }} =~ ^refs/heads/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "is_version_branch=true" >> $GITHUB_OUTPUT
else
echo "is_version_branch=false" >> $GITHUB_OUTPUT
fi
fi;
# Skip build for specific OS
git log -1 --pretty=format:"%B" | cat
for os in unix windows osx; do
if git log -1 --pretty=format:"%B" | grep -Eq "\[(skip|no) $os\]|\[$os skip\]"; then
echo "skip_$os=true" >> $GITHUB_OUTPUT
echo "Skip build for $os"
else
echo "skip_$os=false" >> $GITHUB_OUTPUT
echo "Building for $os"
fi
done

LinuxBuild:
needs: env-context
Expand All @@ -46,6 +65,7 @@ jobs:
is-pre-release: ${{ fromJSON(needs.env-context.outputs.is-pre-release) }}
dotnet-version: ${{ needs.env-context.outputs.dotnet-version }}
is-version-branch: ${{ fromJSON(needs.env-context.outputs.is-version-branch) }}
skip: ${{ fromJSON(needs.env-context.outputs.skip-unix) }}

WindowsBuild:
needs: env-context
Expand All @@ -55,6 +75,7 @@ jobs:
is-pre-release: ${{ fromJSON(needs.env-context.outputs.is-pre-release) }}
dotnet-version: ${{ needs.env-context.outputs.dotnet-version }}
is-version-branch: ${{ fromJSON(needs.env-context.outputs.is-version-branch) }}
skip: ${{ fromJSON(needs.env-context.outputs.skip-windows) }}

MacOSBuild:
needs: env-context
Expand All @@ -64,6 +85,7 @@ jobs:
is-pre-release: ${{ fromJSON(needs.env-context.outputs.is-pre-release) }}
dotnet-version: ${{ needs.env-context.outputs.dotnet-version }}
is-version-branch: ${{ fromJSON(needs.env-context.outputs.is-version-branch) }}
skip: ${{ fromJSON(needs.env-context.outputs.skip-osx) }}

TestAndPushPackages:
needs: [env-context, LinuxBuild, WindowsBuild, MacOSBuild]
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
is-version-branch:
type: boolean
required: true
skip:
type: boolean
required: true

env:
DOCKER_REGISTRY: ghcr.io/maxrev-dev
Expand All @@ -22,6 +25,7 @@ permissions:

jobs:
BuildNugetPackages-Linux:
if: ${{ ! inputs.skip }}
strategy:
matrix:
include:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ on:
is-version-branch:
type: boolean
required: true
skip:
type: boolean
required: true

env:
DOTNET_INSTALL_DIR: ${{ github.workspace }}/.dotnet
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg-archives/

jobs:
BuildNugetPackages-Windows:
if: ${{ ! inputs.skip }}
strategy:
matrix:
os: [windows-latest]
Expand Down
11 changes: 5 additions & 6 deletions osx/gdal-makefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ configure_hdf:
@cd $(HDF_CMAKE_TMP) && cmake $(HDF_SOURCE) \
-DCMAKE_INSTALL_PREFIX=$(BUILD_ROOT)/hdf-build -Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS="-fPIC" \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_C_FLAGS="-fPIC -w" \
-DCMAKE_PREFIX_PATH=$(VCPKG_INSTALLED_DYNAMIC) \
-DCMAKE_OSX_DEPLOYMENT_TARGET=$(OSX_DEPLOYMENT_TARGET) || exit 1

Expand All @@ -124,8 +123,8 @@ configure_gdal:
@cd $(GDAL_CMAKE_TMP) && cmake $(GDAL_ROOT) \
-DCMAKE_INSTALL_PREFIX=$(BUILD_ROOT)/gdal-build -Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS="-fPIC" \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_C_FLAGS="-fPIC -w" \
-DCMAKE_CXX_FLAGS="-fPIC -w" \
-DGDAL_USE_DEFLATE=OFF \
-DGDAL_USE_ZLIB_INTERNAL=ON \
-DGDAL_CSHARP_APPS=OFF \
Expand Down Expand Up @@ -166,8 +165,8 @@ configure_proj:
cmake $(PROJ_ROOT) \
-DCMAKE_BUILD_TYPE=Release -Wno-dev \
-DCMAKE_MAKE_PROGRAM=make \
-DCMAKE_C_FLAGS="-Wno-deprecated-declarations" \
-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
-DCMAKE_C_FLAGS="-w" \
-DCMAKE_CXX_FLAGS="-w" \
-DCMAKE_INSTALL_PREFIX=$(PROJ_BUILD) \
-DBUILD_TESTING=OFF \
-DBUILD_SHARED_LIBS=ON \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<_FunctionsSkipCleanOutput>true</_FunctionsSkipCleanOutput>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MaxRev.Gdal.Universal" Version="3.9.3.*" />
<PackageReference Include="MaxRev.Gdal.Universal" Version="3.10.0.*" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.3" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Platforms>x64;arm64</Platforms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MaxRev.Gdal.Universal" Version="3.9.3.*" />
<PackageReference Include="MaxRev.Gdal.Universal" Version="3.10.0.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
Expand Down
2 changes: 1 addition & 1 deletion tests/MaxRev.Gdal.Core.Tests/MaxRev.Gdal.Core.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<RootNamespace>MaxRev.Gdal.Core.Tests</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MaxRev.Gdal.Universal" Version="3.9.3.*" />
<PackageReference Include="MaxRev.Gdal.Universal" Version="3.10.0.*" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions unix/gdal-makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ configure_gdal:

@cd $(GDAL_CMAKE_TMP) && cmake $(GDAL_ROOT) \
-DCMAKE_BUILD_TYPE=Release -Wno-dev \
-DCMAKE_C_FLAGS="-fPIC" \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_C_FLAGS="-fPIC -w" \
-DCMAKE_CXX_FLAGS="-fPIC -w" \
-DGDAL_USE_DEFLATE=OFF \
-DGDAL_USE_ZLIB_INTERNAL=ON \
-DGDAL_CSHARP_APPS=ON \
Expand Down Expand Up @@ -147,8 +147,8 @@ configure_proj:
cmake $(PROJ_ROOT) \
-DCMAKE_BUILD_TYPE=Release -Wno-dev\
-DCMAKE_MAKE_PROGRAM=make \
-DCMAKE_C_FLAGS="-Wno-deprecated-declarations" \
-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
-DCMAKE_C_FLAGS="-w" \
-DCMAKE_CXX_FLAGS="-w" \
-DCMAKE_INSTALL_PREFIX=$(PROJ_BUILD) \
-DBUILD_TESTING=OFF \
-DBUILD_SHARED_LIBS=ON \
Expand Down
2 changes: 0 additions & 2 deletions win/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ try {

Install-Proj -cleanProjBuild $cleanProjBuild -cleanProjIntermediate $cleanProjIntermediate

Get-ProjDatum

Reset-GdalSourceBindings
$env:INCLUDE = Add-EnvVar $env:INCLUDE "$env:SDK_PREFIX\include"
$env:LIB = Add-EnvVar $env:LIB "$env:SDK_PREFIX\lib"
Expand Down
27 changes: 6 additions & 21 deletions win/partials.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@ function Set-GdalVariables {
$env:VS_VERSION = "Visual Studio 17 2022"
$env:SDK = "release-1930-x64" #2022 x64
$env:SDK_ZIP = "$env:SDK" + "-dev.zip"
$env:PROJ_DATUM = "proj-datumgrid-1.8.zip"
$env:PROJ_DATUM_URL = "http://download.osgeo.org/proj/$env:PROJ_DATUM"
$env:SDK_URL = "http://download.gisinternals.com/sdk/downloads/$env:SDK_ZIP"
$env:LIBWEBP_URL = "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.3.2-windows-x64.zip"
$env:LIBZSTD_URL = "https://github.com/facebook/zstd/releases/download/v1.5.5/zstd-v1.5.5-win64.zip"
$env:LIBDEFLATE_URL = "https://github.com/ebiggers/libdeflate/releases/download/v1.19/libdeflate-1.19-windows-x86_64-bin.zip"
$env:VS_VER = "2022"
$env:ARCHITECTURE = "amd64"
$env:WIN64_ARG = "WIN64=YES"
$env:platform = "x64"
$env:CMAKE_ARCHITECTURE = "x64"
$env:CMAKE_PARALLEL_JOBS = 4

Expand All @@ -26,11 +23,11 @@ function Set-GdalVariables {
$env:GDAL_DRIVER_PATH = "$env:GDAL_INSTALL_DIR\share\gdal"
$env:PROJ_LIB = "$env:PROJ_INSTALL_DIR\share\proj"
$env:GdalCmakeBuild = "$env:BUILD_ROOT\gdal-cmake-temp"
$env:VCPKG_INSTALLED_PKGCONFIG = "$env:BUILD_ROOT\vcpkg\installed\x64-windows\lib\pkgconfig"
$env:SDK_LIB = "$env:SDK_PREFIX\lib"
$env:SDK_BIN = "$env:SDK_PREFIX\bin"
$env:GDAL_INSTALL_DIR = "$env:BUILD_ROOT\gdal-build"
$env:VCPKG_INSTALLED = "$env:BUILD_ROOT\vcpkg\installed\x64-windows"
$env:VCPKG_INSTALLED_PKGCONFIG = "$env:VCPKG_INSTALLED\lib\pkgconfig"

$env:WEBP_ROOT = Get-ForceResolvePath("$env:BUILD_ROOT\sdk\libwebp*")
}
Expand Down Expand Up @@ -152,28 +149,17 @@ function Install-Proj {
cmake -G $env:VS_VERSION -A $env:CMAKE_ARCHITECTURE $env:PROJ_SOURCE `
-DCMAKE_INSTALL_PREFIX="$env:PROJ_INSTALL_DIR" `
-DCMAKE_BUILD_TYPE=Release -Wno-dev `
-DCMAKE_C_FLAGS="/w" `
-DCMAKE_CXX_FLAGS="/w" `
-DPROJ_TESTS=OFF -DBUILD_LIBPROJ_SHARED=ON `
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT\scripts\buildsystems\vcpkg.cmake" `
-DCMAKE_PREFIX_PATH="$env:VCPKG_ROOT\installed\x64-windows;$env:SDK_PREFIX" `
-DCMAKE_PREFIX_PATH="$env:VCPKG_INSTALLED;$env:SDK_PREFIX" `
-DBUILD_SHARED_LIBS=ON -DENABLE_CURL=ON -DENABLE_TIFF=ON

exec { cmake --build . -j $env:CMAKE_PARALLEL_JOBS --config Release --target install }
Write-BuildStep "Done building PROJ"
}

function Get-ProjDatum {
Write-BuildStep "Checking for PROJ datum grid"
Set-Location "$env:BUILD_ROOT\proj-build\share\proj"
if (-Not (Test-Path -Path $env:PROJ_DATUM -PathType Leaf)) {
Write-BuildInfo "Downloading PROJ datum grid"
Invoke-WebRequest $env:PROJ_DATUM_URL -OutFile $env:PROJ_DATUM
Write-BuildStep "PROJ datum grid was downloaded"
}
else {
Write-BuildStep "PROJ datum grid already exists"
}
}

function Get-GdalVersion {
return (Get-Content "$env:GDAL_SOURCE\VERSION")
}
Expand Down Expand Up @@ -253,8 +239,7 @@ function Build-Gdal {
New-FolderIfNotExistsAndSetCurrentLocation $env:GdalCmakeBuild
New-FolderIfNotExists "$PSScriptRoot\..\nuget"

$env:ARCH_FLAGS = "/arch:AVX2 /Ob2 /Oi /Os /Oy"
$env:VCPKG_INSTALLED = "$env:BUILD_ROOT\vcpkg\installed\x64-windows"
$env:ARCH_FLAGS = "/arch:AVX2 /Ob2 /Oi /Os /Oy /w"
# disabling KEA driver as it causes build issues on Windows
# https://github.com/OSGeo/gdal/blob/3b232ee17d8f3d93bf3535b77fbb436cb9a9c2e0/.github/workflows/windows_build.yml#L178

Expand All @@ -267,9 +252,9 @@ function Build-Gdal {
cmake -G $env:VS_VERSION -A $env:CMAKE_ARCHITECTURE "$env:GDAL_SOURCE" `
$env:CMAKE_INSTALL_PREFIX -DCMAKE_BUILD_TYPE=Release -Wno-dev `
-DCMAKE_C_FLAGS="$env:ARCH_FLAGS" `
-DCMAKE_CXX_FLAGS="$env:ARCH_FLAGS" `
-DCMAKE_PREFIX_PATH="$env:VCPKG_INSTALLED;$env:SDK_PREFIX" `
-DGDAL_USE_OPENEXR=OFF `
-DCMAKE_CXX_FLAGS="$env:ARCH_FLAGS" `
$env:WEBP_INCLUDE $env:WEBP_LIB `
$env:PROJ_ROOT $env:MYSQL_LIBRARY `
$env:Poppler_INCLUDE_DIR $env:Poppler_LIBRARY `
Expand Down
Loading