Skip to content

Commit

Permalink
Add shapely (from Anaconda)
Browse files Browse the repository at this point in the history
  • Loading branch information
asmeurer committed Apr 30, 2014
1 parent 5977a16 commit c2e7029
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 0 deletions.
5 changes: 5 additions & 0 deletions shapely/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

export GEOS_DIR=$PREFIX

$PYTHON setup.py install || exit 1
29 changes: 29 additions & 0 deletions shapely/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package:
name: shapely
version: 1.3.1

source:
fn: Shapely-1.3.1.tar.gz
url: https://pypi.python.org/packages/source/S/Shapely/Shapely-1.3.1.tar.gz
md5: 5ac028637fbd52b9752994bdbfd9446c
patches:
- setup.patch
- osx-geos.patch [osx]

requirements:
build:
- python
- distribute
- geos
run:
- python
- geos

test:
imports:
- shapely
- shapely.speedups._speedups

about:
home: https://github.com/Toblerity/Shapely
license: BSD
23 changes: 23 additions & 0 deletions shapely/osx-geos.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git shapely/geos.py shapely/geos.py
index 20945bb..371be63 100644
--- shapely/geos.py
+++ shapely/geos.py
@@ -60,17 +60,7 @@ if sys.platform.startswith('linux'):
free.restype = None

elif sys.platform == 'darwin':
- if hasattr(sys, 'frozen'):
- # .app file from py2app
- alt_paths = [os.path.join(os.environ['RESOURCEPATH'],
- '..', 'Frameworks', 'libgeos_c.dylib')]
- else:
- alt_paths = [
- # The Framework build from Kyng Chaos:
- "/Library/Frameworks/GEOS.framework/Versions/Current/GEOS",
- # macports
- '/opt/local/lib/libgeos_c.dylib',
- ]
+ alt_paths = [os.path.join(sys.prefix, 'lib', 'libgeos_c.dylib')]
_lgeos = load_dll('geos_c', fallbacks=alt_paths)
free = load_dll('c').free
free.argtypes = [c_void_p]
1 change: 1 addition & 0 deletions shapely/run_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from shapely.geometry import Point, LineString, Polygon
10 changes: 10 additions & 0 deletions shapely/setup.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- setup.py
+++ setup.py
@@ -202,6 +202,7 @@ ext_modules = [
Extension(
"shapely.speedups._speedups",
["shapely/speedups/_speedups.c"],
+ include_dirs=[os.path.join(sys.prefix, 'include')],
libraries=libraries)
]

0 comments on commit c2e7029

Please sign in to comment.