Skip to content

Commit

Permalink
feat: add more recipes (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
nichmor authored Jun 27, 2024
1 parent 1aba54f commit d2dc966
Show file tree
Hide file tree
Showing 98 changed files with 4,750 additions and 8 deletions.
25 changes: 20 additions & 5 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,27 @@ local:
- path: recipes/brotlipy/recipe.yaml
- path: recipes/argon2-cffi-bindings/recipe.yaml
- path: recipes/aom/recipe.yaml
- path: recipes/vhs/recipe.yaml
- path: recipes/gocommands/recipe.yaml
- path: recipes/loki-logcli/recipe.yaml
- path: recipes/nomad-driver-podman/recipe.yaml
- path: recipes/oauth2-proxy/recipe.yaml
- path: recipes/gh/recipe.yaml
- path: recipes/rasterio/recipe.yaml
- path: recipes/polars/recipe.yaml
- path: recipes/maturin/recipe.yaml
- path: recipes/cython/recipe.yaml
- path: recipes/jupyterlab/recipe.yaml
- path: recipes/mold/recipe.yaml
- path: recipes/python-duckdb/recipe.yaml
- path: recipes/dartsim/recipe.yaml
- path: recipes/pyfai/recipe.yaml
- path: recipes/memory_profiler/recipe.yaml
rattler-build:
rev: a47f907eaacc345dcd9441fe08d43057b18e2e83
url: https://github.com/prefix-dev/rattler-build.git
repositories:
- rev: 9cd4895abf7c4850605784e1e417d0df642803b1
recipes:
- recipes:
- path: examples/rich/recipe.yaml
- path: examples/curl/recipe.yaml
- path: examples/bitfurnace/recipe.yaml
Expand All @@ -73,10 +88,9 @@ repositories:
- path: examples/match_and_cdt/recipe.yaml
- path: examples/ros-humble-turtlebot4-msgs/recipe.yaml
- path: examples/xtensor/recipe.yaml
rev: c609b1d5ea67ebd095c2077d113d07694cf55fdb
url: https://github.com/prefix-dev/rattler-build.git

- rev: f9500fe929aee1f01d88136b783e67030d07d611
recipes:
- recipes:
- path: bottom/recipe.yaml
- path: cargo-insta/recipe.yaml
- path: cargo-sweep/recipe.yaml
Expand All @@ -92,4 +106,5 @@ repositories:
- path: yazi/recipe.yaml
- path: zenith/recipe.yaml
- path: zoxide/recipe.yaml
rev: f9500fe929aee1f01d88136b783e67030d07d611
url: https://github.com/wolfv/rust-forge.git
5 changes: 5 additions & 0 deletions recipes/cython/fib.pyx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
def fib(n):
if n <= 2:
return 1
else:
return fib(n-2) + fib(n-1)
59 changes: 59 additions & 0 deletions recipes/cython/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{% set version = "3.0.10" %}

package:
name: cython
version: {{ version }}

source:
url: https://github.com/cython/cython/archive/refs/tags/{{ version }}.tar.gz
sha256: 00f97476cef9fcd9a89f9d2a49be3b518e1a74b91f377fe08c97fcb44bc0f7d7

build:
number: 0
script: {{ PYTHON }} -m pip install . --no-deps -vv
entry_points:
- cython = Cython.Compiler.Main:setuptools_main
- cythonize = Cython.Build.Cythonize:main
- cygdb = Cython.Debugger.Cygdb:main

requirements:
build:
- python # [build_platform != target_platform]
- cross-python_{{ target_platform }} # [build_platform != target_platform]
- {{ compiler('c') }}
- {{ compiler('cxx') }}
host:
- python
- pip
run:
- python

test:
requires:
- setuptools # [py>=312]
commands:
- cython --version
files:
- fib.pyx

about:
home: http://www.cython.org/
license: Apache-2.0
license_file: LICENSE.txt
summary: The Cython compiler for writing C extensions for the Python language
description: |
Cython is an optimising static compiler for both the Python programming
language and the extended Cython programming language. It makes writing C
extensions for Python as easy as Python itself.
doc_url: https://docs.cython.org
dev_url: https://github.com/cython/cython

extra:
recipe-maintainers:
- jakirkham
- msarahan
- ocefpaf
- synapticarbors
- isuruf
- scopatz
- h-vetinari
66 changes: 66 additions & 0 deletions recipes/cython/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
context:
version: 3.0.10

package:
name: cython
version: ${{ version }}

source:
url: https://github.com/cython/cython/archive/refs/tags/${{ version }}.tar.gz
sha256: 00f97476cef9fcd9a89f9d2a49be3b518e1a74b91f377fe08c97fcb44bc0f7d7

build:
number: 0
script: python -m pip install . --no-deps -vv
python:
entry_points:
- cython = Cython.Compiler.Main:setuptools_main
- cythonize = Cython.Build.Cythonize:main
- cygdb = Cython.Debugger.Cygdb:main

requirements:
build:
- if: build_platform != target_platform
then: python
- if: build_platform != target_platform
then: cross-python_${{ target_platform }}
- ${{ compiler('c') }}
- ${{ compiler('cxx') }}
host:
- python
- pip
run:
- python

tests:
- files:
recipe:
- fib.pyx
requirements:
run:
- if: py>=312
then: setuptools
script:
- cython --version

about:
license: Apache-2.0
license_file: LICENSE.txt
summary: The Cython compiler for writing C extensions for the Python language
description: |
Cython is an optimising static compiler for both the Python programming
language and the extended Cython programming language. It makes writing C
extensions for Python as easy as Python itself.
homepage: http://www.cython.org/
repository: https://github.com/cython/cython
documentation: https://docs.cython.org

extra:
recipe-maintainers:
- jakirkham
- msarahan
- ocefpaf
- synapticarbors
- isuruf
- scopatz
- h-vetinari
46 changes: 46 additions & 0 deletions recipes/cython/run_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import platform
is_cpython = platform.python_implementation() == 'CPython'

import Cython
import Cython.Compiler.Code
import Cython.Compiler.FlowControl
import Cython.Compiler.Lexicon
import Cython.Compiler.Parsing
import Cython.Compiler.Scanning
import Cython.Compiler.Visitor
import Cython.Plex.Actions
import Cython.Plex.Scanners

if is_cpython:
import Cython.Runtime.refnanny

import sys
import os
import subprocess
from pprint import pprint
from os.path import isfile

print('sys.executable: %r' % sys.executable)
print('sys.prefix: %r' % sys.prefix)
print('sys.version: %r' % sys.version)
print('PATH: %r' % os.environ['PATH'])
print('CWD: %r' % os.getcwd())

from distutils.spawn import find_executable
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

if find_executable('gcc'):
sys.argv[1:] = ['build_ext', '--inplace']
setup(name='fib',
cmdclass={'build_ext': build_ext},
ext_modules=[Extension("fib", ["fib.pyx"])])

try:
import fib
assert fib.fib(10) == 55
except ImportError:
cmd = [sys.executable, '-c', 'import fib; print(fib.fib(10))']
out = subprocess.check_output(cmd)
assert out.decode('utf-8').strip() == '55'
33 changes: 33 additions & 0 deletions recipes/dartsim/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
mkdir build && cd build

:: Check the number of cores use by ninja by default
ninja -h

cmake -G "Ninja" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
-DDART_MSVC_DEFAULT_OPTIONS=ON ^
-DDART_VERBOSE=ON ^
-DASSIMP_AISCENE_CTOR_DTOR_DEFINED:BOOL=ON ^
-DASSIMP_AIMATERIAL_CTOR_DTOR_DEFINED:BOOL=ON ^
-DDART_TREAT_WARNINGS_AS_ERRORS:BOOL=OFF ^
-DDART_ENABLE_SIMD:BOOL=OFF ^
-DDART_BUILD_DARTPY:BOOL=OFF ^
-DDART_USE_SYSTEM_IMGUI:BOOL=ON ^
%SRC_DIR%
if errorlevel 1 exit 1

:: Use 2 core to try to avoid out of memory errors
:: See https://github.com/conda-forge/dartsim-feedstock/pull/27#issuecomment-1132570816 (where it was reduced to 4)
:: and https://github.com/conda-forge/dartsim-feedstock/pull/30#issuecomment-1149743621 (where it was reduced to 3)
:: and https://github.com/conda-forge/dartsim-feedstock/pull/38#issuecomment-1553091093 (where it was reduced to 2)
:: and https://github.com/conda-forge/dartsim-feedstock/pull/41#issuecomment-1737995505 (where it was reduced to 1)
ninja -j 1
if errorlevel 1 exit 1

ninja install
if errorlevel 1 exit 1

ctest --output-on-failure
if errorlevel 1 exit 1
35 changes: 35 additions & 0 deletions recipes/dartsim/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh

mkdir build && cd build

if [[ ${target_platform} == "linux-ppc64le" ]]; then
NUM_PARALLEL=-j1
else
NUM_PARALLEL=-j${CPU_COUNT}
fi

if [[ "${target_platform}" == osx-* ]]; then
# See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk
CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY"
fi

cmake ${CMAKE_ARGS} $SRC_DIR \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_LIBDIR=lib \
-DDART_VERBOSE:BOOL=ON \
-DDART_TREAT_WARNINGS_AS_ERRORS:BOOL=OFF \
-DDART_ENABLE_SIMD:BOOL=OFF \
-DDART_BUILD_DARTPY:BOOL=OFF \
-DDART_USE_SYSTEM_IMGUI:BOOL=ON

make ${NUM_PARALLEL}
make ${NUM_PARALLEL} install

if [ ${target_platform} != "linux-ppc64le" ]; then
make ${NUM_PARALLEL} tests
if [[ "${CONDA_BUILD_CROSS_COMPILATION:-}" != "1" || "${CROSSCOMPILING_EMULATOR}" != "" ]]; then
ctest --output-on-failure
fi
fi
23 changes: 23 additions & 0 deletions recipes/dartsim/disable_gui.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
From b4d397a7886d6115ddb91431fc966ea0f17fac48 Mon Sep 17 00:00:00 2001
From: Silvio Traversaro <[email protected]>
Date: Sun, 11 Apr 2021 15:41:48 +0200
Subject: [PATCH] Disable GUI

---
dart/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dart/CMakeLists.txt b/dart/CMakeLists.txt
index c3ebbdc04d6..1f4d15273f1 100644
--- a/dart/CMakeLists.txt
+++ b/dart/CMakeLists.txt
@@ -86,7 +86,7 @@ add_subdirectory(constraint)
add_subdirectory(simulation)
add_subdirectory(planning) # flann
add_subdirectory(utils) # tinyxml2, bullet
-add_subdirectory(gui) # opengl, glut, bullet
+# add_subdirectory(gui) # opengl, glut, bullet

set(DART_CONFIG_HPP_IN ${DART_SOURCE_DIR}/dart/config.hpp.in)
set(DART_CONFIG_HPP_OUT ${DART_BINARY_DIR}/dart/config.hpp)

15 changes: 15 additions & 0 deletions recipes/dartsim/disable_test_Issue1596.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/tests/regression/CMakeLists.txt b/tests/regression/CMakeLists.txt
index e0dd73c6a461..86c00b6a04ec 100644
--- a/tests/regression/CMakeLists.txt
+++ b/tests/regression/CMakeLists.txt
@@ -6,8 +6,8 @@ if(TARGET dart-utils)
dart_add_test("regression" test_Issue1583)
target_link_libraries(test_Issue1583 dart-utils)

- dart_add_test("regression" test_Issue1596)
- target_link_libraries(test_Issue1596 dart-utils)
+ # dart_add_test("regression" test_Issue1596)
+ # target_link_libraries(test_Issue1596 dart-utils)
endif()

if(TARGET dart-utils-urdf)
Loading

0 comments on commit d2dc966

Please sign in to comment.