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 potpourri3d and dependencies #28263

Merged
merged 15 commits into from
Nov 22, 2024
28 changes: 28 additions & 0 deletions recipes/geometry-central/LICENSE_nanoflann
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Software License Agreement (BSD License)

Copyright 2008-2009 Marius Muja ([email protected]). All rights reserved.
Copyright 2008-2009 David G. Lowe ([email protected]). All rights reserved.
Copyright 2011 Jose L. Blanco ([email protected]). All rights reserved.

THE BSD LICENSE

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 changes: 21 additions & 0 deletions recipes/geometry-central/LICENSE_nanort
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2015 - 2016 Light Transport Entertainment, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
16 changes: 16 additions & 0 deletions recipes/geometry-central/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set -ex

# don't use vendored happly (git submodule)
rm -rf deps/happly
mkdir -p deps/happly

cp $PREFIX/include/happly.h deps/happly/happly.h

mkdir build && cd build
cmake $CMAKE_ARGS \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
..

cmake --build . -j${CPU_COUNT}
cmake --build . --target install
43 changes: 43 additions & 0 deletions recipes/geometry-central/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{% set name = "geometry-central" %}
{% set version = "0.1.0.2024.10.24" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://github.com/nmwsharp/geometry-central/archive/70c859ec3b58fe597c0063673a74082654e9c5aa.zip
sha256: e13aa61181935d4f9c20985a93fa1ef2b8df2cd20e7f357c16919dc4e2607cb6

build:
number: 0
skip: true # [win]

requirements:
build:
- {{ stdlib("c") }}
- {{ compiler('cxx') }}
- cmake
- make
host:
- eigen >=3.3
- happly

test:
commands:
- test -f ${PREFIX}/lib/libgeometry-central.so # [linux]
- test -f ${PREFIX}/lib/libgeometry-central.dylib # [osx]
- if not exist %LIBRARY_BIN%\\libgeometry-central.dll exit 1 # [win]

about:
home: https://github.com/nmwsharp/geometry-central
summary: Geometry-central is a modern C++ library of data structures and algorithms for geometry processing, with a particular focus on surface meshes.
license: MIT AND BSD-2-Clause
license_file:
- LICENSE
- LICENSE_nanoflann # BSD-2-Clause
- LICENSE_nanort # MIT

extra:
recipe-maintainers:
- ytausch
7 changes: 7 additions & 0 deletions recipes/happly/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@echo on
setlocal EnableDelayedExpansion

mkdir %PREFIX%\\Library\\include

copy happly.h %PREFIX%\Library\include\happly.h
if %ERRORLEVEL% neq 0 exit 1
4 changes: 4 additions & 0 deletions recipes/happly/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set -ex
mkdir -p ${PREFIX}/include

cp happly.h ${PREFIX}/include/happly.h
30 changes: 30 additions & 0 deletions recipes/happly/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{% set name = "happly" %}
{% set version = "0.0.0.2020.8.22" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://github.com/nmwsharp/happly/archive/8a606309daaa680eee495c8279feb0b704148f4a.zip
sha256: 1187131adbfd087b01e57863678e3fb91304d8ed8ad25f56ac8329ea8b31cca9

build:
noarch: generic
number: 0

test:
commands:
- test -f ${PREFIX}/include/happly.h # [unix]
- if not exist %PREFIX%\\Library\\include\\happly.h exit 1 # [win]

about:
home: https://github.com/nmwsharp/happly
summary: A header-only C++ reader/writer for the PLY file format. Parse .ply happily!
license: MIT
license_file:
- LICENSE

extra:
recipe-maintainers:
- ytausch
20 changes: 20 additions & 0 deletions recipes/potpourri3d/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
cmake_minimum_required(VERSION 3.1.0)
project(potpourri3d_bindings)

find_package(pybind11 REQUIRED)

# for geometry-central
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

pybind11_add_module(potpourri3d_bindings
src/cpp/core.cpp
src/cpp/io.cpp
src/cpp/mesh.cpp
src/cpp/point_cloud.cpp
)

include_directories(potpourri3d_bindings ${CMAKE_CURRENT_SOURCE_DIR}/src/cpp)

find_package(Eigen3 REQUIRED)
target_link_libraries(potpourri3d_bindings PRIVATE Eigen3::Eigen)
target_link_libraries(potpourri3d_bindings PRIVATE geometry-central)
7 changes: 7 additions & 0 deletions recipes/potpourri3d/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set -ex

# Overwrite CMakeLists.txt for dynamic linking
rm CMakeLists.txt
cp $RECIPE_DIR/CMakeLists.txt .

python -m pip install . -vv --no-deps --no-build-isolation
52 changes: 52 additions & 0 deletions recipes/potpourri3d/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{% set name = "potpourri3d" %}
{% set version = "1.1.0" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://pypi.org/packages/source/{{ name[0] }}/{{ name }}/potpourri3d-{{ version }}.tar.gz
sha256: f211581a478a88609f6deb122782d89439b811d522d6950e210fa617041de00a

build:
number: 0
skip: true # [win]

requirements:
build:
- {{ compiler('cxx') }}
- {{ stdlib("c") }}
- cmake
- make
host:
- python
- pip
- setuptools
- eigen
- geometry-central
- pybind11
run:
- python
- geometry-central
- numpy
- scipy

test:
imports:
- potpourri3d
commands:
- pip check
requires:
- pip

about:
home: https://github.com/nmwsharp/potpourri3d
summary: An invigorating blend of 3D geometry tools in Python.
license: MIT
license_file:
- LICENSE

extra:
recipe-maintainers:
- ytausch