Skip to content

Commit

Permalink
build from source proj
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioettorre committed Nov 20, 2023
1 parent aaa8072 commit 4ac61c5
Showing 1 changed file with 34 additions and 48 deletions.
82 changes: 34 additions & 48 deletions .github/workflows/test_windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,9 @@ jobs:
arch: [ "auto64" ]
python: [ "3.9", "3.10", "3.11" ]
triplet: [ "x64-windows" ]
vcpkg_cache: [ "c:\\vcpkg\\installed" ]
vcpkg_logs: [ "c:\\vcpkg\\buildtrees\\**\\*.log" ]
env:
REPO_DIR: pyproj
PYPROJ_VERSION: 3.6.1
steps:
- uses: actions/checkout@v4
# - uses: actions/checkout@v4
# with:
# repository: pyproj4/pyproj
# ref: '3.6.1'
- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python }}"
Expand All @@ -31,49 +23,43 @@ jobs:
env:
PROJ_WHEEL: true
PROJ_NETWORK: ON
PROJ_VERSION: 9.1.0
PROJ_DIR: c:/vcpkg/installed/${{ matrix.triplet }}
PROJ_DATA: d:/a/oq-wheels/oq-wheels/bin/pyproj/proj_dir/share/proj/
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
GDAL_VERSION: 3.7.3
shell: bash
PROJ_SOURCE: 9.1.0
BUILD_SHARED_LIBS: ON
PYPROJ_VERSION: 3.6.1
REPO_DIR: pyproj
shell: cmd
run: |
echo ${GITHUB_WORKSPACE}
ls -lrt ${GITHUB_WORKSPACE}
cd "$VCPKG_INSTALLATION_ROOT"
git pull > nul
./bootstrap-vcpkg.bat -disableMetrics
## simple usage is to copy over the file based
## Install gdal since contains all other requirements for Fiona and proj
cp ${GITHUB_WORKSPACE}/windows/vcpkg_gdal.json ${GITHUB_WORKSPACE}/windows/vcpkg.json
cat ${GITHUB_WORKSPACE}/windows/vcpkg.json
vcpkg install --feature-flags="versions,manifests" --x-manifest-root=${GITHUB_WORKSPACE}/windows --x-install-root=$VCPKG_INSTALLATION_ROOT/installed
git clone https://github.com/pyproj4/pyproj.git
cd pyproj
git checkout ${PYPROJ_VERSION}
ls "$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/"*
mkdir -p ${GITHUB_WORKSPACE}/pyproj/proj_dir/share/proj
cp "$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/share/proj/"* ${GITHUB_WORKSPACE}/pyproj/proj_dir/share/proj/
set VCPKG_INSTALLED=C:\tools\vcpkg\installed\%platform%-windows
set
cd \
mkdir c:\tools
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg"
.\bootstrap-vcpkg.bat -disableMetrics
vcpkg install sqlite3[core,tool]:"%platform%"-windows &
vcpkg install tiff:"%platform%"-windows &
vcpkg install curl:"%platform%"-windows
dir %VCPKG_INSTALLED%\bin
set PATH=%VCPKG_INSTALLED%\bin;%PATH%
set BASE_INST_DIR="C:\tools\installed"
set PROJ_DIR=%BASE_INST_DIR%\proj-%PROJ_SOURCE:~0,5%
cd c:\tools
curl -o "proj-%PROJSOURCE:~0,5%.zip" "https://download.osgeo.org/proj/proj-%PROJSOURCE%.zip"
7z x -aoa -y "proj-%PROJSOURCE:~0,5%.zip"
dir
#
export PROJ_DATA=${GITHUB_WORKSPACE}/pyproj/proj_dir/share/proj/
echo ${PROJ_DATA}
ls ${GITHUB_WORKSPACE}/pyproj/proj_dir/share/proj/
python -m pip install delvewheel
python -m pip wheel . --wheel-dir=${GITHUB_WORKSPACE}/wheels_torepair --no-deps
cd ${GITHUB_WORKSPACE}/wheels_torepair
delvewheel repair --add-path C:/vcpkg/installed/${{ matrix.triplet }}/bin -w ${GITHUB_WORKSPACE}/wheelhouse pyproj*.whl
echo "PYPROJ test wheel"
pyproj -v && python -c "import pyproj; pyproj.Proj(init='epsg:4269')"
#
pip download GDAL==${GDAL_VERSION}
ls GDAL-${GDAL_VERSION}.tar.gz
tar xzvf GDAL-${GDAL_VERSION}.tar.gz
mv GDAL-${GDAL_VERSION} gdal
ls
cd gdal
python -m pip wheel . --wheel-dir=${GITHUB_WORKSPACE}/wheels_torepair --no-deps
delvewheel repair --add-path C:/vcpkg/installed/${{ matrix.triplet }}/bin -w ${GITHUB_WORKSPACE}/wheelhouse gdal*.whl
cd "c:\tools\proj-%PROJSOURCE:~0,5%"
set BUILD_PROJ=1
mkdir build
cd build
cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS="%BUILD_SHARED_LIBS%" -DCMAKE_C_FLAGS="/WX" -DCMAKE_CXX_FLAGS="/WX" -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX="%PROJ_DIR%"
ninja -v
ninja install
set PATH=%PROJ_DIR%\bin;%PATH%
set PROJ_DATA=%PROJ_DIR%\share\proj
proj
#python -m pip wheel . --wheel-dir=${GITHUB_WORKSPACE}/wheels_torepair --no-deps
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
Expand Down

0 comments on commit 4ac61c5

Please sign in to comment.