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

add mayavi and vtk #285

Closed
wants to merge 5 commits into from
Closed
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
5 changes: 5 additions & 0 deletions recipes/mayavi/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
%PYTHON% setup.py install
if errorlevel 1 exit 1

move examples %EXAMPLES%
if errorlevel 1 exit 1
5 changes: 5 additions & 0 deletions recipes/mayavi/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

$PYTHON setup.py install

mv examples $EXAMPLES
53 changes: 53 additions & 0 deletions recipes/mayavi/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{% set version = "4.4.4" %}

package:
name: mayavi
version: {{ version }}

source:
fn: mayavi-{{ version }}.tar.gz
url: https://github.com/enthought/mayavi/archive/{{ version }}.tar.gz
sha256: a6cbbcf3ef6c72970f4e46a52edb18f0f7b00980932ab8c737224314b63eef10

build:
entry_points:
- mayavi2 = mayavi.scripts.mayavi2:main
- tvtk_doc = tvtk.tools.tvtk_doc:main
osx_is_app: True

requirements:
build:
- python
- numpy
- setuptools
- vtk
- traitsui
- apptools
run:
- python
- python.app # [osx]
- numpy
- vtk
- traitsui
- apptools
- envisage
- pyqt
- setuptools

test:
commands:
- mayavi2 --help
imports:
- tvtk
- tvtk.array_ext
- mayavi

about:
home: https://github.com/enthought/mayavi
license: BSD
license_file: LICENSE.txt
summary: The Mayavi scientific data 3-dimensional visualizers

extra:
recipe-maintainers:
- msarahan
10 changes: 10 additions & 0 deletions recipes/vtk/apple_executable.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff -ur a/CMakeLists.txt b/CMakeLists.txt
--- CMakeLists.txt 2015-09-01 15:41:26.000000000 -0600
+++ CMakeLists.txt 2015-10-20 14:46:28.000000000 -0600
@@ -599,3 +599,6 @@
"without manually building the 'VTKData' target.")
endif()
endif()
+if(APPLE)
+ set(EXECUTABLE_FLAG MACOSX_BUNDLE)
+endif(APPLE)
30 changes: 30 additions & 0 deletions recipes/vtk/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@echo off

mkdir build
cd build

:: CONDA_PY is the right way to do this, but we don't have that in a release yet.
set PYLIB=python%PY_VER:.=%.lib

cmake .. -G "NMake Makefiles" ^
-Wno-dev ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-DCMAKE_INSTALL_RPATH:STRING=%LIBRARY_LIB% ^
-DCMAKE_INSTALL_NAME_DIR=%LIBRARY_LIB% ^
-DBUILD_DOCUMENTATION=OFF ^
-DVTK_HAS_FEENABLEEXCEPT=OFF ^
-DBUILD_TESTING=OFF ^
-DBUILD_EXAMPLES=OFF ^
-DBUILD_SHARED_LIBS=ON ^
-DVTK_WRAP_PYTHON=ON ^
-DPYTHON_EXECUTABLE=%PYTHON% ^
-DPYTHON_INCLUDE_PATH=%PREFIX%\\include ^
-DPYTHON_LIBRARY=%PREFIX%\\libs\\%PYLIB% ^
-DVTK_INSTALL_PYTHON_MODULE_DIR=%PREFIX%\\Lib\\site-packages ^
-DModule_vtkRenderingMatplotlib=ON ^
-DVTK_PYTHON_VERSION=%PY_VER:~0,1%

cmake --build . --target INSTALL --config Release
if errorlevel 1 exit 1
59 changes: 59 additions & 0 deletions recipes/vtk/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash

mkdir build
cd build

if [ `uname` == Linux ]; then
# use globs to take into account all possible suffixes: m, u, d
PY_LIB=`ls "${PREFIX}/lib/libpython${PY_VER}"*.so | head -n 1`
PY_INC=`ls -d "${PREFIX}/include/python${PY_VER}"* | head -n 1`

cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_INSTALL_RPATH:STRING="${PREFIX}/lib" \
-DBUILD_DOCUMENTATION=OFF \
-DVTK_HAS_FEENABLEEXCEPT=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_SHARED_LIBS=ON \
-DVTK_WRAP_PYTHON=ON \
-DPYTHON_EXECUTABLE=${PYTHON} \
-DPYTHON_INCLUDE_PATH=${PY_INC} \
-DPYTHON_LIBRARY=${PY_LIB} \
-DVTK_INSTALL_PYTHON_MODULE_DIR=${SP_DIR} \
-DModule_vtkRenderingMatplotlib=ON \
-DVTK_USE_X=ON \
-DVTK_PYTHON_VERSION=${PY_VER:0:1}
fi

if [ `uname` == Darwin ]; then
# use globs to take into account all possible suffixes: m, u, d
PY_LIB=`ls "${PREFIX}/lib/libpython${PY_VER}"*.dylib | head -n 1`
PY_INC=`ls -d "${PREFIX}/include/python${PY_VER}"* | head -n 1`
MACOSX_DEPLOYMENT_TARGET=10.7

cmake .. \
-DVTK_REQUIRED_OBJCXX_FLAGS='' \
-DVTK_USE_TK=OFF \
-DVTK_USE_COCOA=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCMAKE_INSTALL_RPATH:STRING="$PREFIX/lib" \
-DBUILD_DOCUMENTATION=OFF \
-DVTK_HAS_FEENABLEEXCEPT=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_EXAMPLES=OFF \
-DBUILD_SHARED_LIBS=ON \
-DVTK_WRAP_PYTHON=ON \
-DPYTHON_EXECUTABLE=${PYTHON} \
-DPYTHON_INCLUDE_PATH=${PY_INC} \
-DPYTHON_LIBRARY=${PY_LIB} \
-DVTK_INSTALL_PYTHON_MODULE_DIR=${SP_DIR} \
-DModule_vtkRenderingMatplotlib=ON \
-DVTK_USE_X=OFF \
-DVTK_PYTHON_VERSION=${PY_VER:0:1}
fi

make -j${CPU_COUNT}
make install
50 changes: 50 additions & 0 deletions recipes/vtk/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{% set version = "7.0.0" %}
{% set minor_version = ".".join(version.split(".")[:2]) %}

package:
name: vtk
version: {{ version }}

source:
url: http://www.vtk.org/files/release/{{ minor_version }}/VTK-{{ version }}.tar.gz
fn: vtk-{{ version }}.tar.gz
sha256: 78a990a15ead79cdc752e86b83cfab7dbf5b7ef51ba409db02570dbdd9ec32c3
patches:
# make the apple bundle executable in CMake file
- apple_executable.patch # [osx]

requirements:
build:
- cmake
- python
run:
- python

test:
imports:
- vtk
- vtk.vtkChartsCore
- vtk.vtkCommonCore
- vtk.vtkFiltersCore
- vtk.vtkFiltersGeneric
- vtk.vtkGeovisCore
- vtk.vtkFiltersHybrid
- vtk.vtkIOCore
- vtk.vtkImagingCore
- vtk.vtkInfovisCore
- vtk.vtkRenderingCore
- vtk.vtkViewsCore
- vtk.vtkRenderingVolume
- vtk.vtkInteractionWidgets

about:
home: http://www.vtk.org/
license: BSD
summary: VTK is an open-source, freely available software system for 3D computer graphics

extra:
recipe-maintainers:
- ccordoba12
- grlee77
- msarahan
- patricksnape