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

Shapely 1.8.5 #28

Merged
merged 4 commits into from
Mar 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ jobs:
- pydevd
- pyinstrument
- PyYAML
- shapely
- yappi
- zope.interface

steps:
- uses: actions/checkout@v4

# temporary fix needed for shapely
- run: apt-get update && apt-get install -y bzip2

# temporary fix
- run: /build/venv/bin/cross-python -m pip config set global.extra-index-url https://wpilib.jfrog.io/artifactory/api/pypi/wpilib-python-release-2025/simple

Expand Down
13 changes: 13 additions & 0 deletions packages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@ build_pip_requirements = [
# [packages.scipy]
# version = "1.5.3"

[packages.shapely]
version = "1.8.5"
build_pip_requirements = [
"setuptools",
"Cython>=3.0",
"numpy",
]
pre_script = "scripts/build_geos.sh"

[packages.shapely.environment]
GEOS_CONFIG = "/usr/local/arm-nilrt-linux-gnueabi/sysroot/usr/bin/geos-config"


[packages."zope.interface"]
version = "7.1.0"
# mod_version = "6.1+r2"
Expand Down
17 changes: 17 additions & 0 deletions roborio-toolchain.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# the name of the target operating system
set(CMAKE_SYSTEM_NAME Linux)

# which compilers to use for C and C++
set(CMAKE_C_COMPILER arm-frc2025-linux-gnueabi-gcc)
set(CMAKE_CXX_COMPILER arm-frc2025-linux-gnueabi-g++)

# where is the target environment located
set(CMAKE_FIND_ROOT_PATH /usr/local/arm-nilrt-linux-gnueabi/sysroot)

# adjust the default behavior of the FIND_XXX() commands:
# search programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)

# search headers and libraries in the target environment
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
25 changes: 25 additions & 0 deletions scripts/build_geos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash -e

/build/venv/bin/build-pip install cmake ninja

[ -f geos-3.13.0.tar.bz2 ] || wget https://download.osgeo.org/geos/geos-3.13.0.tar.bz2
[ -d geos-3.13.0 ] || tar -xf geos-3.13.0.tar.bz2

cd geos-3.13.0/

mkdir build
cd build
/build/venv/build/bin/cmake \
-DCMAKE_TOOLCHAIN_FILE=../../roborio-toolchain.cmake \
-DCMAKE_MAKE_PROGRAM=/build/venv/build/bin/ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local/arm-nilrt-linux-gnueabi/sysroot/usr \
-DBUILD_DOCUMENTATION=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-G Ninja \
..

/build/venv/build/bin/cmake --build .
/build/venv/build/bin/cmake --install .
7 changes: 7 additions & 0 deletions whl_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@

name = pkgdata.get("name", args.project)

try:
pre_script = pkgdata["pre_script"]
except KeyError:
pass
else:
os.system(pre_script)

env = os.environ.copy()
env["PATH"] = f"{env['PATH']}:/build/venv/build/bin"
if "environment" in pkgdata:
Expand Down
Loading