Skip to content

Commit c99d790

Browse files
committed
Python: enable proj in wheels
1 parent 40d8e49 commit c99d790

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

python/eckitlib/buildconfig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
# TODO we duplicate information -- pyproject.toml's `name` and `packages` are derivable from $NAME and must stay consistent
1212

1313
NAME="eckit"
14-
CMAKE_PARAMS="-DENABLE_MPI=0 -DENABLE_ECKIT_GEO=1 -DENABLE_BUILD_TOOLS=OFF -DENABLE_AEC=0 -DENABLE_EIGEN=0 -DENABLE_LZ4=1"
14+
if [ "$(uname)" != "Darwin" ] ; then
15+
PROJ_EXTRA="-DPROJ_DIR=/tmp/proj/target/lib64/cmake/proj"
16+
else
17+
PROJ_EXTRA="" # brew install is autodiscovered fine
18+
fi
19+
CMAKE_PARAMS="-DENABLE_MPI=0 -DENABLE_ECKIT_GEO=1 -DENABLE_BUILD_TOOLS=OFF -DENABLE_AEC=0 -DENABLE_EIGEN=0 -DENABLE_LZ4=1 -DENABLE_PROJ=1 $PROJ_EXTRA"
1520
PYPROJECT_DIR="python/eckitlib"
1621
DEPENDENCIES='[]'

python/eckitlib/pre-compile.sh

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,38 @@
1515
set -euo pipefail
1616

1717
mkdir -p python/eckitlib/src/copying
18-
mkdir -p /tmp/eckit/target/eckit/lib64/
1918

2019
if [ "$(uname)" != "Darwin" ] ; then
21-
echo "no deps installation for platform $(uname)"
20+
# echo "no deps installation for platform $(uname)"
21+
prf="lib64"
22+
suf="so"
2223
# echo "installing deps for platform $(uname)"
24+
# NOTE lz4 in the base image already
2325
## lz4
2426
# git clone https://github.com/lz4/lz4 /src/lz4 && cd /src/lz4
2527
# make -j10 && make install DESTDIR=/tmp/lz4
2628
# cd -
29+
echo "installing PROJ platform $(uname)"
30+
# build PROJ -- the DNF install does not seem to work out of the box, ie, cmake doesnt find it
31+
VERSION="9.7.0"
32+
pushd /tmp
33+
wget https://download.osgeo.org/proj/proj-$VERSION.tar.gz
34+
command -v md5sum >/dev/null 2>&1 && echo "MD5 (proj-$VERSION.tar.gz) = b7188aab7a22613a2f5a0bc41c4077b0" | md5sum --check
35+
tar xzf proj-$VERSION.tar.gz
36+
cd proj-$VERSION
37+
mkdir build target && cd build
38+
cmake ..
39+
CMAKE_BUILD_PARALLEL_LEVEL=8 cmake --build .
40+
cmake --install . --prefix /tmp/proj/target
41+
popd
42+
2743
else
2844
echo "no deps installation for platform $(uname)"
45+
prf="lib"
46+
suf="dylib"
2947
fi
3048

31-
3249
wget https://raw.githubusercontent.com/lz4/lz4/dev/LICENSE -O python/eckitlib/src/copying/liblz4.txt
33-
echo '{"liblz4": {"path": "copying/liblz4.txt", "home": "https://github.com/lz4/lz4"}}' > python/eckitlib/src/copying/list.json
50+
wget https://raw.githubusercontent.com/OSGeo/PROJ/refs/heads/master/COPYING -O python/eckitlib/src/copying/proj.txt
51+
echo '{"liblz4": {"path": "copying/liblz4.txt", "home": "https://github.com/lz4/lz4"}, "proj": {"path": "copying/proj.txt", "home": "https://github.com/OSGeo/PROJ"}}' > python/eckitlib/src/copying/list.json
52+

0 commit comments

Comments
 (0)