From ebc5e6e1416892126eca1a7d8cb98e7986dc6d89 Mon Sep 17 00:00:00 2001 From: Thorsten Beier Date: Fri, 10 May 2024 14:09:48 +0200 Subject: [PATCH] extended docs (#935) * extended docs * extended docs --- docs/adding_packages.md | 76 ++++++++++++++++++++++++++++++++++++++++- mkdocs.yml | 8 ++++- pixi.toml | 3 +- 3 files changed, 84 insertions(+), 3 deletions(-) diff --git a/docs/adding_packages.md b/docs/adding_packages.md index dba9d5f3d..55edb3233 100644 --- a/docs/adding_packages.md +++ b/docs/adding_packages.md @@ -1,3 +1,77 @@ # Adding packages -To add a new package to emscripten-forge, just create a Pull Request in this repository. \ No newline at end of file +To add a new package to emscripten-forge, just create a Pull Request in this repository. + + + +# C/C++ Packages +## CMake + +Adding cmake based packages is easy. Usually it is enough to replace the `cmake` command with the `emcmake` command and +`make` with `emmake` (see the [emscripten documentation](https://emscripten.org/docs/compiling/Building-Projects.html#integrating-with-a-build-system) for more details) + + + +**Example recipes**: + +* [xeus](https://github.com/emscripten-forge/recipes/tree/main/recipes/recipes_emscripten/xeus) +* [xeus-javascript](https://github.com/emscripten-forge/recipes/tree/main/recipes/recipes_emscripten/xeus-javascript) +* [sqlitecpp](https://github.com/emscripten-forge/recipes/tree/main/recipes/recipes_emscripten/sqlitecpp) + +## Configure / Make + +Usually it is enough to replace the `./configure` command with the `emconfigure ./configure` (see the [emscripten documentation](https://emscripten.org/docs/compiling/Building-Projects.html#integrating-with-a-build-system) for more details) + + +# Python Packages + +## pip / setuptools +For simple package only these requirements are usually necessary: +```yaml + +requirements: + build: + - python + - cross-python_${{target_platform}} + - ${{ compiler("c") }} + - pip + host: + - python + run: + - python +``` + +**Example recipes**: + +* [regex](https://github.com/emscripten-forge/recipes/tree/main/recipes/recipes_emscripten/regex) + + +### Example recipes + +## rust +Building rust package with PyO3 / maturin works usually out of the box. + +For a maturin / cffi / pyo3 package, the following requirements are usually necessary: +```yaml +requirements: + build: + - cross-python_${{target_platform}} + - cffi == 1.15.1 (# at the time of writing pinning cffi == 1.15.1 is necessary, may change in the future) + - setuptools-rust + - rust + - maturin + + host: + - python + # at the time of writing pinning cffi == 1.15.1 is necessary, may change in the future) + - cffi == 1.15.1 + run: + # at the time of writing pinning cffi == 1.15.1 is necessary, may change in the future) + - cffi == 1.15.1 +``` + +**Example recipes**: + +* [cryptography](https://github.com/emscripten-forge/recipes/tree/main/recipes/recipes_emscripten/cryptography) +* [pydantic-core](https://github.com/emscripten-forge/recipes/tree/main/recipes/recipes_emscripten/cryptography) +* [pycrdt](https://github.com/emscripten-forge/recipes/tree/main/recipes/recipes_emscripten/pycrdt) diff --git a/mkdocs.yml b/mkdocs.yml index b18714b2f..29ad8bbda 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -33,4 +33,10 @@ markdown_extensions: pygments_lang_class: true - pymdownx.inlinehilite - pymdownx.snippets - - pymdownx.superfences \ No newline at end of file + - pymdownx.superfences + + + + +plugins: + - search \ No newline at end of file diff --git a/pixi.toml b/pixi.toml index ddaf5adce..dc93eda14 100644 --- a/pixi.toml +++ b/pixi.toml @@ -68,6 +68,8 @@ cmd = [ python = "3.11.*" mkdocs = ">=1.6.0" mkdocs-material = ">=9.5.2" +pip = "*" + [feature.feature_documentation.tasks.docs-serve] cmd = ["mkdocs", "serve"] @@ -75,7 +77,6 @@ cmd = ["mkdocs", "serve"] [feature.feature_documentation.tasks.docs-build] cmd = ["mkdocs", "build"] - ############################################ # environments ############################################