Skip to content

Commit

Permalink
Merge pull request #27008 from baszalmstra/jolt-physics
Browse files Browse the repository at this point in the history
Adds rattler-build recipe compatibility (and adds jolt-physics)
  • Loading branch information
wolfv authored Jul 30, 2024
2 parents d7e7303 + 06c4643 commit 1573839
Show file tree
Hide file tree
Showing 8 changed files with 368 additions and 79 deletions.
274 changes: 199 additions & 75 deletions .ci_support/build_all.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .ci_support/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ conda-forge-ci-setup=4.*
conda-forge-pinning
frozendict
networkx=2.4
rattler-build-conda-compat>=0.2.1
3 changes: 2 additions & 1 deletion .github/workflows/correct_directory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
'\nUnfortunately, the recipe was added directly in the `recipes` folder without its own subfolder.\n' +
'Please move the recipe file into a folder with the name of the package you want to submit.\n\n' +
'For example: if your recipe is currently under `recipes/<your_package>.yaml`, ' +
'it should be moved to `recipes/<your_package>/meta.yaml`.\n' +
'it should be moved to `recipes/<your_package>/meta.yaml` ' +
'or, if you are using the new yaml based recipe format, `recipes/<your_package>/recipe.yaml`\n' +
'Thanks!'
})
2 changes: 1 addition & 1 deletion .github/workflows/scripts/create_feedstocks
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ conda install --yes --quiet \
requests \
ruamel.yaml \
"pygithub>=2.1.1" \
"rattler-build-conda-compat>=0.0.6,<0.1"
"rattler-build-conda-compat>=0.2.1"

conda info
mamba info
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/create_feedstocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def list_recipes() -> Iterator[tuple[str, str]]:
# to be helpful.
# .DS_Store is created by macOS to store custom attributes of its
# containing folder.
if recipe_dir.name in ["example", ".DS_Store"]:
if recipe_dir.name in ["example", "example-new-recipe", ".DS_Store"]:
continue

# Try to look for a conda-build recipe.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ If the issue persists, support can be found [on Gitter](https://gitter.im/conda-
## Getting started

1. Fork this repository.
2. Make a new folder in `recipes` for your package. Look at the example recipe, our [documentation](http://conda-forge.org/docs/maintainer/adding_pkgs.html#) and the [FAQ](https://github.com/conda-forge/staged-recipes#faq) for help.
2. Make a new folder in `recipes` for your package. Look at the example recipes, our [documentation](http://conda-forge.org/docs/maintainer/adding_pkgs.html#) and the [FAQ](https://github.com/conda-forge/staged-recipes#faq) for help.
3. Open a pull request. Building of your package will be tested on Windows, Mac and Linux.
4. When your pull request is merged a new repository, called a feedstock, will be created in the github conda-forge organization, and build/upload of your package will automatically be triggered. Once complete, the package is available on conda-forge.

Expand Down
100 changes: 100 additions & 0 deletions recipes/example-new-recipe/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# This example shows how to define a recipe using the new YAML based recipe format introduced by
# CEP 13.

# For more information about this format see: https://prefix-dev.github.io/rattler-build/latest/reference/recipe_file/

# The main differences with the old format is that no preprocessing is required for the file to be valid YAML.
# This means:
# - No "selectors", use YAML if-then-else expressions instead (https://prefix-dev.github.io/rattler-build/latest/selectors/)
# - Jinja expressions are formatted with `${{}}`

# Note: there are many handy hints in comments in this example -- remove them when you've finalized your recipe

# Define variables in this section that you can use in other parts.
context:
name: simplejson
version: "3.8.2"

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

source:
url: https://pypi.io/packages/source/${{ name[0] }}/${{ name }}/${{ name }}-${{ version }}.tar.gz
# If getting the source from GitHub, remove the line above,
# uncomment the line below, and modify as needed. Use releases if available:
# url: https://github.com/simplejson/simplejson/releases/download/${{ version }}/simplejson-${{ version }}.tar.gz
# and otherwise fall back to archive:
# url: https://github.com/simplejson/simplejson/archive/v${{ version }}.tar.gz
sha256: d58439c548433adcda98e695be53e526ba940a4b9c44fb9a05d92cd495cdd47f
# sha256 is the preferred checksum -- you can get it for a file with:
# `openssl sha256 <file name>`.
# You may need the openssl package, available on conda-forge:
# `conda install openssl -c conda-forge``

build:
# Uncomment the following line if the package is pure Python and the recipe is exactly the same for all platforms.
# It is okay if the dependencies are not built for all platforms/versions, although selectors are still not allowed.
# See https://conda-forge.org/docs/maintainer/knowledge_base.html#noarch-python for more details.
# noarch: python
# If the installation is complex, or different between Unix and Windows, use separate build.bat and build.sh files instead of this key.
# By default, the package will be built for the Python versions supported by conda-forge and for all major OSs.
# Uncomment the following lines to limit to Python 3.5 and newer (for example)
# skip:
# - match(python, "<3.5")
# or the following to limit to Windows.
# skip:
# - win
script: python -m pip install . -vv
number: 0

requirements:
build:
# If your project compiles code (such as a C extension) then add the required compilers as separate entries here.
# Compiler names include 'c', 'cxx' and 'fortran', among others.
- ${{ compiler('c') }}
- ${{ stdlib('c') }} # If you need a compiler, add the `stdlib` equivalent too
host:
- python
- pip
run:
- python

tests:
# More information about different tests that can be added can be found here:
# https://prefix-dev.github.io/rattler-build/latest/testing/
- python:
# A list of modules that the test will try to import
imports:
- simplejson
- simplejson.tests
# Also run `pip check` to verify the integrity
pip_check: true

about:
homepage: https://github.com/simplejson/simplejson
summary: 'Simple, fast, extensible JSON encoder/decoder for Python'
description: |
simplejson is a simple, fast, complete, correct and extensible
JSON <https://json.org> encoder and decoder for Python 2.5+ and
Python 3.3+. It is pure Python code with no dependencies, but includes
an optional C extension for a serious speed boost.
# Remember to specify the license variants for BSD, Apache, GPL, and LGPL.
# Use the SPDX identifier, e.g: GPL-2.0-only instead of GNU General Public License version 2.0
# See https://spdx.org/licenses/
license: MIT
# It is required to include a license file in the package,
# (even if the license doesn't require it) using the license_file entry.
# Please also note that some projects have multiple license files which all need to be added using a valid yaml list.
# See https://docs.conda.io/projects/conda-build/en/latest/resources/define-metadata.html#license-file
license_file: LICENSE.txt
# The documentation and repository URLs are optional.
documentation: https://simplejson.readthedocs.io/
repository: https://github.com/simplejson/simplejson

extra:
recipe-maintainers:
# GitHub IDs for maintainers of the recipe.
# Always check with the people listed below if they are OK becoming maintainers of the recipe. (There will be spam!)
- LisaSimpson
- LandoCalrissian
63 changes: 63 additions & 0 deletions recipes/jolt-physics/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
context:
version: 5.0.0

package:
name: jolt-physics
version: ${{ version }}

source:
url: https://github.com/jrouwe/JoltPhysics/archive/refs/tags/v${{ version }}.zip
sha256: 2c98750316d565d553cb2c15d494b6b2ea4fbe55eb2ca18df536c9f4ac340d36

requirements:
build:
- ${{ compiler("cxx") }}
- ${{ stdlib("c") }}
- cmake
- ninja

build:
number: 0
script:
- if: win
then: |
cmake -GNinja ^
%CMAKE_ARGS% ^
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
-DBUILD_SHARED_LIBS=ON ^
-DCMAKE_BUILD_TYPE=Distribution ^
-DCROSS_PLATFORM_DETERMINISTIC=ON ^
-DTARGET_VIEWER=OFF ^
-DTARGET_SAMPLES=OFF ^
-DTARGET_HELLO_WORLD=OFF ^
-DTARGET_UNIT_TESTS=OFF ^
-DTARGET_PERFORMANCE_TEST=OFF ^
-S %SRC_DIR%\Build
cmake --build . --target install
else: |
cmake -GNinja \
$CMAKE_ARGS \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Distribution \
-DCROSS_PLATFORM_DETERMINISTIC=ON \
-DTARGET_VIEWER=OFF \
-DTARGET_SAMPLES=OFF \
-DTARGET_HELLO_WORLD=OFF \
-DTARGET_UNIT_TESTS=OFF \
-DTARGET_PERFORMANCE_TEST=OFF \
-S $SRC_DIR/Build
cmake --build . --target install
about:
homepage: https://github.com/jrouwe/JoltPhysics
license: MIT
license_file: LICENSE
summary: A multi core friendly rigid body physics and collision detection library.
description: A multi core friendly rigid body physics and collision detection library. Written in C++. Suitable for games and VR applications. Used by Horizon Forbidden West.
documentation: https://xtensor.readthedocs.iohttps://jrouwe.github.io/JoltPhysics/
repository: https://github.com/jrouwe/JoltPhysics

extra:
recipe-maintainers:
- baszalmstra

0 comments on commit 1573839

Please sign in to comment.