| 1 |
name: "Install proj Dependency" |
| 2 |
description: "Install proj Dependency using cache when possible" |
| 3 |
inputs: |
| 4 |
cpu: |
| 5 |
description: "CPU architecture to build for" |
| 6 |
required: false |
| 7 |
default: "x86_64" |
| 8 |
version: |
| 9 |
description: "Version of proj to build" |
| 10 |
required: true |
| 11 |
sqlite_csb_version: |
| 12 |
description: "Version of csb providing sqlite to build against" |
| 13 |
required: true |
| 14 |
global_cache_index: |
| 15 |
description: "Global cache index" |
| 16 |
required: true |
| 17 |
|
| 18 |
runs: |
| 19 |
using: "composite" |
| 20 |
steps: |
| 21 |
- name: Check required inputs |
| 22 |
shell: bash |
| 23 |
run: | |
| 24 |
[[ "${{ inputs.version }}" ]] || { echo "version input is empty" ; exit 1; } |
| 25 |
[[ "${{ inputs.sqlite_csb_version }}" ]] || { echo "sqlite_csb_version input is empty" ; exit 1; } |
| 26 |
[[ "${{ inputs.global_cache_index }}" ]] || { echo "global_cache_index input is empty" ; exit 1; } |
| 27 |
|
| 28 |
- name: Cache proj |
| 29 |
id: cache-proj |
| 30 |
uses: actions/cache/restore@v5 |
| 31 |
with: |
| 32 |
path: dependencies/proj_install |
| 33 |
key: proj-${{inputs.version}}-${{ inputs.sqlite_csb_version }}-${{runner.os}}-${{inputs.cpu}}-${{inputs.global_cache_index}}-2 |
| 34 |
|
| 35 |
# Dependents: gdal geotiff |
| 36 |
- name: Checkout proj |
| 37 |
if: steps.cache-proj.outputs.cache-hit != 'true' |
| 38 |
uses: actions/checkout@v6 |
| 39 |
with: |
| 40 |
repository: OSGeo/PROJ |
| 41 |
path: "./dependencies/proj" |
| 42 |
ref: ${{inputs.version}} |
| 43 |
|
| 44 |
# Patch for compilation of minver |
| 45 |
- name: Patch proj include |
| 46 |
if: steps.cache-proj.outputs.cache-hit != 'true' && inputs.version == '9.0.0' |
| 47 |
working-directory: ${{github.workspace}}/dependencies/proj |
| 48 |
shell: bash |
| 49 |
run: patch -p1 < $GITHUB_ACTION_PATH/add-missing-cstdint-includes.patch |
| 50 |
|
| 51 |
- name: Setup proj |
| 52 |
if: steps.cache-proj.outputs.cache-hit != 'true' |
| 53 |
working-directory: ${{github.workspace}}/dependencies |
| 54 |
shell: bash |
| 55 |
run: | |
| 56 |
mkdir proj_build |
| 57 |
mkdir proj_install |
| 58 |
|
| 59 |
- name: Configure proj |
| 60 |
if: steps.cache-proj.outputs.cache-hit != 'true' |
| 61 |
working-directory: ${{github.workspace}}/dependencies/proj_build |
| 62 |
shell: bash |
| 63 |
run: > |
| 64 |
cmake ../proj |
| 65 |
-DBUILD_APPS:BOOL=OFF |
| 66 |
-DBUILD_BENCHMARKS:BOOL=OFF |
| 67 |
-DBUILD_CCT:BOOL=OFF |
| 68 |
-DBUILD_CS2CS:BOOL=OFF |
| 69 |
-DBUILD_GEOD:BOOL=OFF |
| 70 |
-DBUILD_GIE:BOOL=OFF |
| 71 |
-DBUILD_PROJINFO:BOOL=OFF |
| 72 |
-DBUILD_PROJSYNC:BOOL=OFF |
| 73 |
-DBUILD_SHARED_LIBS=ON |
| 74 |
-DBUILD_TESTING:BOOL=OFF |
| 75 |
-DCMAKE_BUILD_TYPE=Release |
| 76 |
-DCMAKE_INSTALL_PREFIX=../proj_install |
| 77 |
-DCMAKE_PREFIX_PATH:PATH=../install/ |
| 78 |
-DENABLE_CURL:BOOL=OFF |
| 79 |
-DENABLE_TIFF:BOOL=OFF |
| 80 |
${{ runner.os == 'macOS' && '-DCMAKE_OSX_DEPLOYMENT_TARGET=14.0' || null }} |
| 81 |
${{ runner.os == 'Windows' && '-Ax64 -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL' || null }} |
| 82 |
|
| 83 |
- name: Build proj |
| 84 |
if: steps.cache-proj.outputs.cache-hit != 'true' |
| 85 |
working-directory: ${{github.workspace}}/dependencies/proj_build |
| 86 |
shell: bash |
| 87 |
run: cmake --build . --parallel 2 --target install --config Release |
| 88 |
|
| 89 |
- name: Copy to install |
| 90 |
working-directory: ${{github.workspace}}/dependencies/proj_install |
| 91 |
shell: bash |
| 92 |
run: cp -r ./* ../install/ |
| 93 |
|
| 94 |
- name: Save cache |
| 95 |
if: steps.cache-proj.outputs.cache-hit != 'true' |
| 96 |
uses: actions/cache/save@v5 |
| 97 |
with: |
| 98 |
key: ${{ steps.cache-proj.outputs.cache-primary-key }} |
| 99 |
path: dependencies/proj_install |