Add py-s2 0.9.0

S2 Geometry Library is a package for manipulating geometric shapes. Unlike many
geometry libraries, S2 is primarily designed to work with spherical geometry,
i.e., shapes drawn on a sphere rather than on a planar 2D map. This makes it
especially suitable for working with geographic data.

This port is the Python binding of S2 Geometry Library.

WWW: https://s2geometry.io/
WWW: https://github.com/google/s2geometry
This commit is contained in:
Sunpoet Po-Chuan Hsieh 2020-09-12 12:07:17 +00:00
parent 846ae5fac0
commit eddb9d1bf4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=548313
6 changed files with 76 additions and 0 deletions

View file

@ -873,6 +873,7 @@
SUBDIR += py-qt5-svg
SUBDIR += py-rasterio
SUBDIR += py-rawkit
SUBDIR += py-s2
SUBDIR += py-scikit-image
SUBDIR += py-seqdiag
SUBDIR += py-sorl-thumbnail

26
graphics/py-s2/Makefile Normal file
View file

@ -0,0 +1,26 @@
# Created by: Po-Chuan Hsieh <sunpoet@FreeBSD.org>
# $FreeBSD$
PORTNAME= s2
PORTVERSION= 0.9.0
DISTVERSIONPREFIX= v
CATEGORIES= graphics
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Python binding of S2 Geometry Library
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/../../LICENSE
BUILD_DEPENDS= swig:devel/swig
LIB_DEPENDS= libs2.so:graphics/s2
USES= cmake compiler:c++11-lang localbase:ldflags python
WRKSRC_SUBDIR= src/python
GH_ACCOUNT= google
GH_PROJECT= s2geometry
USE_GITHUB= yes
.include <bsd.port.mk>

3
graphics/py-s2/distinfo Normal file
View file

@ -0,0 +1,3 @@
TIMESTAMP = 1599729119
SHA256 (google-s2geometry-v0.9.0_GH0.tar.gz) = 54c09b653f68929e8929bffa60ea568e26f3b4a51e1b1734f5c3c037f1d89062
SIZE (google-s2geometry-v0.9.0_GH0.tar.gz) = 1124554

View file

@ -0,0 +1,35 @@
--- CMakeLists.txt.orig 2019-03-04 16:53:16 UTC
+++ CMakeLists.txt
@@ -1,5 +1,15 @@
+cmake_minimum_required(VERSION 3.5)
+
+project(s2-geometry)
+
+find_path(S2_INCLUDE_DIR s2/s2cell.h)
+
+find_package(SWIG)
+find_package(PythonInterp)
+find_package(PythonLibs)
+
include(${SWIG_USE_FILE})
-include_directories(${PYTHON_INCLUDE_PATH})
+include_directories(${S2_INCLUDE_DIR} ${PYTHON_INCLUDE_PATH})
set(CMAKE_SWIG_FLAGS "")
set_property(SOURCE s2.i PROPERTY SWIG_FLAGS "-module" "pywraps2")
@@ -18,7 +28,7 @@ add_test(NAME pywraps2_test COMMAND
${PYTHON_EXECUTABLE}
"${PROJECT_SOURCE_DIR}/src/python/pywraps2_test.py")
set_property(TEST pywraps2_test PROPERTY ENVIRONMENT
- "PYTHONPATH=$ENV{PYTHONPATH}:${PROJECT_BINARY_DIR}/python")
+ "PYTHONPATH=$ENV{PYTHONPATH}:${PROJECT_BINARY_DIR}")
execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "if True:
from distutils import sysconfig as sc;
@@ -28,5 +38,5 @@ execute_process(COMMAND "${PYTHON_EXECUTABLE}" -c "if
# Install the wrapper.
install(TARGETS _pywraps2 DESTINATION ${PYTHON_SITE})
-install(FILES "${PROJECT_BINARY_DIR}/python/pywraps2.py"
+install(FILES "${PROJECT_BINARY_DIR}/pywraps2.py"
DESTINATION ${PYTHON_SITE})

9
graphics/py-s2/pkg-descr Normal file
View file

@ -0,0 +1,9 @@
S2 Geometry Library is a package for manipulating geometric shapes. Unlike many
geometry libraries, S2 is primarily designed to work with spherical geometry,
i.e., shapes drawn on a sphere rather than on a planar 2D map. This makes it
especially suitable for working with geographic data.
This port is the Python binding of S2 Geometry Library.
WWW: https://s2geometry.io/
WWW: https://github.com/google/s2geometry

2
graphics/py-s2/pkg-plist Normal file
View file

@ -0,0 +1,2 @@
%%PYTHON_SITELIBDIR%%/_pywraps2.so
%%PYTHON_SITELIBDIR%%/pywraps2.py