From 24e0c2faf6eaeded7622f25cec5f3fb78ca5fc94 Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Tue, 23 Dec 2025 09:47:41 +0100 Subject: [PATCH 01/13] add supported plugins recipes --- recipes/sofa-app/build.bat | 74 ++++++ recipes/sofa-app/build.sh | 85 +++++++ recipes/sofa-app/hotfix-sofa-run-macos.sh | 33 +++ recipes/sofa-app/recipe.yaml | 43 ++++ recipes/sofa-beamadapter/build.bat | 21 ++ recipes/sofa-beamadapter/build.sh | 24 ++ recipes/sofa-beamadapter/recipe.yaml | 57 +++++ recipes/sofa-cosserat/build.bat | 23 ++ recipes/sofa-cosserat/build.sh | 26 +++ recipes/sofa-cosserat/recipe.yaml | 68 ++++++ recipes/sofa-glfw/build.bat | 24 ++ recipes/sofa-glfw/build.sh | 27 +++ recipes/sofa-glfw/recipe.yaml | 68 ++++++ recipes/sofa-modelorderreduction/build.bat | 23 ++ recipes/sofa-modelorderreduction/build.sh | 29 +++ recipes/sofa-modelorderreduction/recipe.yaml | 68 ++++++ recipes/sofa-python3/activate.bat | 3 + recipes/sofa-python3/build.bat | 30 +++ recipes/sofa-python3/build.sh | 29 +++ recipes/sofa-python3/deactivate.bat | 1 + ...otfix-for-libpython-linking-on-macOS.patch | 215 ++++++++++++++++++ recipes/sofa-python3/recipe.yaml | 82 +++++++ recipes/sofa-softrobots/build.bat | 22 ++ recipes/sofa-softrobots/build.sh | 25 ++ ...5-if-interactive-control-cmake-optio.patch | 28 +++ recipes/sofa-softrobots/recipe.yaml | 73 ++++++ recipes/sofa-softrobotsinverse/build.bat | 24 ++ recipes/sofa-softrobotsinverse/build.sh | 27 +++ recipes/sofa-softrobotsinverse/recipe.yaml | 71 ++++++ recipes/sofa-stlib/build.bat | 22 ++ recipes/sofa-stlib/build.sh | 19 ++ recipes/sofa-stlib/recipe.yaml | 66 ++++++ 32 files changed, 1430 insertions(+) create mode 100644 recipes/sofa-app/build.bat create mode 100644 recipes/sofa-app/build.sh create mode 100755 recipes/sofa-app/hotfix-sofa-run-macos.sh create mode 100644 recipes/sofa-app/recipe.yaml create mode 100644 recipes/sofa-beamadapter/build.bat create mode 100644 recipes/sofa-beamadapter/build.sh create mode 100644 recipes/sofa-beamadapter/recipe.yaml create mode 100644 recipes/sofa-cosserat/build.bat create mode 100644 recipes/sofa-cosserat/build.sh create mode 100644 recipes/sofa-cosserat/recipe.yaml create mode 100644 recipes/sofa-glfw/build.bat create mode 100644 recipes/sofa-glfw/build.sh create mode 100644 recipes/sofa-glfw/recipe.yaml create mode 100644 recipes/sofa-modelorderreduction/build.bat create mode 100644 recipes/sofa-modelorderreduction/build.sh create mode 100644 recipes/sofa-modelorderreduction/recipe.yaml create mode 100644 recipes/sofa-python3/activate.bat create mode 100644 recipes/sofa-python3/build.bat create mode 100644 recipes/sofa-python3/build.sh create mode 100644 recipes/sofa-python3/deactivate.bat create mode 100644 recipes/sofa-python3/patches/0001-hotfix-for-libpython-linking-on-macOS.patch create mode 100644 recipes/sofa-python3/recipe.yaml create mode 100644 recipes/sofa-softrobots/build.bat create mode 100644 recipes/sofa-softrobots/build.sh create mode 100644 recipes/sofa-softrobots/patches/0001-only-requires-Qt5-if-interactive-control-cmake-optio.patch create mode 100644 recipes/sofa-softrobots/recipe.yaml create mode 100644 recipes/sofa-softrobotsinverse/build.bat create mode 100644 recipes/sofa-softrobotsinverse/build.sh create mode 100644 recipes/sofa-softrobotsinverse/recipe.yaml create mode 100644 recipes/sofa-stlib/build.bat create mode 100644 recipes/sofa-stlib/build.sh create mode 100644 recipes/sofa-stlib/recipe.yaml diff --git a/recipes/sofa-app/build.bat b/recipes/sofa-app/build.bat new file mode 100644 index 0000000000000..8fb9bf4db08ed --- /dev/null +++ b/recipes/sofa-app/build.bat @@ -0,0 +1,74 @@ +setlocal EnableDelayedExpansion +@echo on + +:: SceneChecking application +rmdir /S /Q build-scene-checking + +mkdir build-scene-checking +cd build-scene-checking + +:: Configure +cmake %CMAKE_ARGS% ^ + -B . ^ + -S %SRC_DIR%\applications\projects\SceneChecking ^ + -G Ninja ^ + -DSCENECHECKING_BUILD_TESTS=OFF ^ + -DCMAKE_BUILD_TYPE:STRING=Release +if errorlevel 1 exit 1 + +:: Build. +cmake --build . --parallel "%CPU_COUNT%" +if errorlevel 1 exit 1 + +:: Install. +cmake --build . --parallel "%CPU_COUNT%" --target install +if errorlevel 1 exit 1 + +cd .. + +:: runSofa application +rmdir /S /Q build-sofa-app + +mkdir build-sofa-app +cd build-sofa-app + +:: Configure +cmake %CMAKE_ARGS% ^ + -B . ^ + -S %SRC_DIR%\applications\projects\runSofa ^ + -G Ninja ^ + -DCMAKE_BUILD_TYPE:STRING=Release +if errorlevel 1 exit 1 + +:: Build. +cmake --build . --parallel "%CPU_COUNT%" +if errorlevel 1 exit 1 + +:: Install. +cmake --build . --parallel "%CPU_COUNT%" --target install +if errorlevel 1 exit 1 + +cd .. + +:: runSofa app requires some data ressources, which will +:: be included in this package +rmdir /S /Q build-sofa-examples + +mkdir build-sofa-examples +cd build-sofa-examples + +:: Configure +cmake %CMAKE_ARGS% ^ + -B . ^ + -S %SRC_DIR%\examples ^ + -G Ninja ^ + -DCMAKE_BUILD_TYPE:STRING=Release +if errorlevel 1 exit 1 + +:: Build. +cmake --build . --parallel "%CPU_COUNT%" +if errorlevel 1 exit 1 + +:: Install. +cmake --build . --parallel "%CPU_COUNT%" --target install +if errorlevel 1 exit 1 diff --git a/recipes/sofa-app/build.sh b/recipes/sofa-app/build.sh new file mode 100644 index 0000000000000..7529d78726866 --- /dev/null +++ b/recipes/sofa-app/build.sh @@ -0,0 +1,85 @@ +#!/bin/sh + +set -ex + +if [[ $target_platform == osx* ]] ; then + # Dealing with modern C++ for Darwin in embedded catch library. + # See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk + CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" +fi + +# SceneChecking application +# ---------- +rm -rf build-scene-checking + +mkdir build-scene-checking +cd build-scene-checking + +# We have to manually set the Rpath for other SOFA libs to the lib/ directory using +# the CMAKE_INSTALL_RPATH cmake variable, as SOFA CMakeLists are not designed +# initially for a per-component compilation & installation +cmake ${CMAKE_ARGS} \ + -B . \ + -S ../applications/projects/SceneChecking/ \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DSCENECHECKING_BUILD_TESTS=OFF \ + -DCMAKE_INSTALL_RPATH:PATH=${PREFIX}/lib + +# build +cmake --build . --parallel ${CPU_COUNT} + +# install +cmake --build . --parallel ${CPU_COUNT} --target install + +cd .. + +# runSofa application +# ---------- +rm -rf build-sofa-app + +mkdir build-sofa-app +cd build-sofa-app + +# We have to manually set the Rpath for other SOFA libs to the lib/ directory using +# the CMAKE_INSTALL_RPATH cmake variable, as SOFA CMakeLists are not designed +# initially for a per-component compilation & installation +cmake ${CMAKE_ARGS} \ + -B . \ + -S ../applications/projects/runSofa/ \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DCMAKE_INSTALL_RPATH:PATH=${PREFIX}/lib + +# build +cmake --build . --parallel ${CPU_COUNT} + +# install +cmake --build . --parallel ${CPU_COUNT} --target install + +# For macOS, we have to provide this additionnal script as an hotfix +# for users who would like to load SofaPython3 plugin in runSofa +# application. +# See hotfix-sofa-run-macos.sh for more details. +if [[ $target_platform == osx* ]] ; then + cp "${RECIPE_DIR}/hotfix-sofa-run-macos.sh" "${PREFIX}/bin/runSofa_with_python" +fi + +cd .. + +# runSofa app requires some data ressources, which will +# be included in this package +# ---------- +rm -rf build-sofa-examples + +mkdir build-sofa-examples +cd build-sofa-examples + +cmake ${CMAKE_ARGS} \ + -B . \ + -S ../examples/ \ + -DCMAKE_BUILD_TYPE:STRING=Release + +# build +cmake --build . --parallel ${CPU_COUNT} + +# install +cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file diff --git a/recipes/sofa-app/hotfix-sofa-run-macos.sh b/recipes/sofa-app/hotfix-sofa-run-macos.sh new file mode 100755 index 0000000000000..8adc9f0fb5434 --- /dev/null +++ b/recipes/sofa-app/hotfix-sofa-run-macos.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +# For macOS, we provide this additionnal script as an hotfix +# for users who would like to load SofaPython3 plugin in runSofa +# application. +# The bug seems to be linked to the fact that python in conda-forge package +# is linked statically with libpython, and thus embeds symbols in the executable. +# On macOS, if a binary which links dynamically with libpython is loaded with +# such python executable, this leads to a segfault. SofaPython3 embeds both +# python bindings and a python interpreter so far, so it needs python symbols. +# This should be fixed in the future where SofaPython3 will split bindings and interpreter +# part. Meanwhile, we chose to remove the dynamic link to libpython on macOS from +# SofaPython3 to make it usable in python with conda (and will use symbols from +# static linkage of python). If a user wants to load SofaPython3 in runSofa (so outside python), +# it has to preload libpython symbols. This scripts is just an helper to so that. +# Initial issue: https://github.com/sofa-framework/SofaPython3/issues/393 +# PR: https://github.com/sofa-framework/SofaPython3/pull/394 + +if ! python --version; then + echo "No python installation found" + exit 1 +fi + +PYTHON_VERSION_MAJOR_MINOR=`python -c 'import sys; version=sys.version_info[:2]; print("{0}.{1}".format(*version))'` +echo $PYTHON_VERSION_MAJOR_MINOR + +PYTHON_LIB=$CONDA_PREFIX/lib/libpython$PYTHON_VERSION_MAJOR_MINOR.dylib +if [[ ! -f "$PYTHON_LIB" ]]; then + echo "Could not find python library $PYTHON_LIB" + exit 1 +fi + +DYLD_INSERT_LIBRARIES=$PYTHON_LIB ./runSofa \ No newline at end of file diff --git a/recipes/sofa-app/recipe.yaml b/recipes/sofa-app/recipe.yaml new file mode 100644 index 0000000000000..242651a4e4979 --- /dev/null +++ b/recipes/sofa-app/recipe.yaml @@ -0,0 +1,43 @@ +context: + name: sofa-app + version: "25.06.00" + major_minor: ${{ (version | split('.'))[:2] | join('.') }} + +package: + name: ${{ name }} + version: ${{ version }} + +source: + url: https://github.com/sofa-framework/sofa/archive/refs/tags/v${{ version }}.tar.gz + sha256: a3a9345d71c3c62c26a0abddf18f7cbbd481bba5f095c92c0956f33530b50e69 + +build: + number: 0 + +requirements: + build: + - ${{ compiler('cxx') }} + - ${{ stdlib('c') }} + - cmake + - ninja + host: + - sofa-devel ${{ major_minor }}.* + - sofa-glfw ${{ major_minor }}.* + - cxxopts + +tests: + - package_contents: + bin: + - runSofa + +about: + homepage: https://github.com/sofa-framework/sofa.git + summary: Applications and ressources for the SOFA framework + license: GPL-2.0-or-later + license_file: applications/projects/LICENSE.GPL.txt + repository: https://github.com/sofa-framework/sofa.git + +extra: + recipe-maintainers: + - olivier-roussel + - hugtalbot diff --git a/recipes/sofa-beamadapter/build.bat b/recipes/sofa-beamadapter/build.bat new file mode 100644 index 0000000000000..a6def840bea02 --- /dev/null +++ b/recipes/sofa-beamadapter/build.bat @@ -0,0 +1,21 @@ +setlocal EnableDelayedExpansion + +mkdir build +cd build + +::Configure +cmake %CMAKE_ARGS% ^ + -B . ^ + -S %SRC_DIR% ^ + -G Ninja ^ + -DCMAKE_BUILD_TYPE:STRING=Release ^ + -DBEAMADAPTER_BUILD_TESTS:BOOL=OFF +if errorlevel 1 exit 1 + +:: Build. +cmake --build . --parallel "%CPU_COUNT%" +if errorlevel 1 exit 1 + +:: Install. +cmake --build . --parallel "%CPU_COUNT%" --target install +if errorlevel 1 exit 1 \ No newline at end of file diff --git a/recipes/sofa-beamadapter/build.sh b/recipes/sofa-beamadapter/build.sh new file mode 100644 index 0000000000000..c663d8a125398 --- /dev/null +++ b/recipes/sofa-beamadapter/build.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +set -ex + +if [[ $target_platform == osx* ]] ; then + # Dealing with modern C++ for Darwin in embedded catch library. + # See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk + CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" +fi + +mkdir build +cd build + +cmake ${CMAKE_ARGS} \ + -B. \ + -S .. \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DBEAMADAPTER_BUILD_TESTS:BOOL=OFF + +# build +cmake --build . --parallel ${CPU_COUNT} + +# install +cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file diff --git a/recipes/sofa-beamadapter/recipe.yaml b/recipes/sofa-beamadapter/recipe.yaml new file mode 100644 index 0000000000000..f88d33cd5daf8 --- /dev/null +++ b/recipes/sofa-beamadapter/recipe.yaml @@ -0,0 +1,57 @@ +context: + name: sofa-beamadapter + version: "25.06.00" + major_minor: ${{ (version | split('.'))[:2] | join('.') }} + +package: + name: ${{ name }} + version: ${{ version }} + +source: + url: https://github.com/sofa-framework/BeamAdapter/archive/refs/tags/release-v${{ major_minor }}.tar.gz + sha256: fe1b878427ac1573437f2a33c380c61cb6b77c526638d23141942a940baeb5dd + +build: + number: 0 + +requirements: + build: + - ${{ compiler('cxx') }} + - ${{ stdlib('c') }} + - cmake + - ninja + host: + - sofa-devel ${{ major_minor }}.* + - eigen + run: + # sofa-beamadapter is a devel library so it needs sofa-devel at runtime + - sofa-devel ${{ major_minor }}.* + run_exports: + - ${{ pin_subpackage(name, upper_bound='x.x') }} + +tests: + - package_contents: + include: + - BeamAdapter/config.h + lib: + - BeamAdapter + - script: + - cmake-package-check BeamAdapter + requirements: + run: + - cmake-package-check + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + +about: + homepage: https://www.sofa-framework.org/applications/marketplace/beamadapter/ + summary: Plugin implementing Kirchhoff rods to simulate any 1D flexible structure. + license: LGPL-2.1-or-later + license_file: LICENSE.md + documentation: https://sofa-framework.github.io/BeamAdapter/ + repository: https://github.com/sofa-framework/BeamAdapter + +extra: + recipe-maintainers: + - olivier-roussel + - hugtalbot diff --git a/recipes/sofa-cosserat/build.bat b/recipes/sofa-cosserat/build.bat new file mode 100644 index 0000000000000..b4f892d237d69 --- /dev/null +++ b/recipes/sofa-cosserat/build.bat @@ -0,0 +1,23 @@ +setlocal EnableDelayedExpansion + +mkdir build +cd build + +::Configure +cmake %CMAKE_ARGS% ^ + -B . ^ + -S %SRC_DIR% ^ + -G Ninja ^ + -DCMAKE_BUILD_TYPE:STRING=Release ^ + -DPython_EXECUTABLE:PATH="%PREFIX%\python.exe" ^ + -DSP3_PYTHON_PACKAGES_DIRECTORY:PATH="..\..\lib\site-packages" ^ + -DCOSSERAT_BUILD_TESTS:BOOL=OFF +if errorlevel 1 exit 1 + +:: Build. +cmake --build . --parallel "%CPU_COUNT%" +if errorlevel 1 exit 1 + +:: Install. +cmake --build . --parallel "%CPU_COUNT%" --target install +if errorlevel 1 exit 1 \ No newline at end of file diff --git a/recipes/sofa-cosserat/build.sh b/recipes/sofa-cosserat/build.sh new file mode 100644 index 0000000000000..07504ec995633 --- /dev/null +++ b/recipes/sofa-cosserat/build.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +set -ex + +if [[ $target_platform == osx* ]] ; then + # Dealing with modern C++ for Darwin in embedded catch library. + # See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk + CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" +fi + +mkdir build +cd build + +cmake ${CMAKE_ARGS} \ + -B . \ + -S .. \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ + -DSP3_PYTHON_PACKAGES_DIRECTORY:PATH=python${PY_VER}/site-packages \ + -DCOSSERAT_BUILD_TESTS:BOOL=OFF + +# build +cmake --build . --parallel ${CPU_COUNT} + +# install +cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file diff --git a/recipes/sofa-cosserat/recipe.yaml b/recipes/sofa-cosserat/recipe.yaml new file mode 100644 index 0000000000000..3731e34f7c8f5 --- /dev/null +++ b/recipes/sofa-cosserat/recipe.yaml @@ -0,0 +1,68 @@ +context: + name: sofa-cosserat + version: "25.06.00" + major_minor: ${{ (version | split('.'))[:2] | join('.') }} + +package: + name: ${{ name }} + version: ${{ version }} + +source: + url: https://github.com/SofaDefrost/Cosserat/archive/refs/tags/release-v${{ major_minor }}.tar.gz + sha256: 9db628531729400b2a5535c04f4444f674caaf5ebb6c1ad28632d5162100bc24 + +build: + number: 0 + +requirements: + build: + - ${{ compiler('cxx') }} + - ${{ stdlib('c') }} + - cmake + - ninja + host: + - sofa-devel ${{ major_minor }}.* + - sofa-stlib ${{ major_minor }}.* + - sofa-softrobots ${{ major_minor }}.* + - eigen + - libboost-headers + - pybind11 + - python + run: + # sofa-cosserat is a devel library so it needs sofa-devel at runtime + - sofa-devel ${{ major_minor }}.* + - eigen + - libboost-headers + - python + run_exports: + - ${{ pin_subpackage(name, upper_bound='x.x') }} + +tests: + - package_contents: + include: + - Cosserat/config.h + lib: + - Cosserat + - script: + - cmake-package-check Cosserat + requirements: + run: + - cmake-package-check + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + - python: + imports: + - Sofa + - Cosserat + +about: + homepage: https://www.sofa-framework.org/applications/plugins/cosserat-beam-cable-needle/ + summary: A SOFA plugin to simulate linear structures using Cosserat theory. + license: LGPL-3.0-or-later + license_file: LICENSE + repository: https://github.com/SofaDefrost/plugin.Cosserat/ + +extra: + recipe-maintainers: + - olivier-roussel + - hugtalbot diff --git a/recipes/sofa-glfw/build.bat b/recipes/sofa-glfw/build.bat new file mode 100644 index 0000000000000..068e0cb7cc339 --- /dev/null +++ b/recipes/sofa-glfw/build.bat @@ -0,0 +1,24 @@ +setlocal EnableDelayedExpansion + +mkdir build +cd build + +::Configure +cmake %CMAKE_ARGS% ^ + -B . ^ + -S %SRC_DIR% ^ + -G Ninja ^ + -DPLUGIN_SOFAGLFW:BOOL=ON ^ + -DPLUGIN_SOFAIMGUI:BOOL=ON ^ + -DCMAKE_BUILD_TYPE:STRING=Release ^ + -DPython_EXECUTABLE:PATH="%PREFIX%\python.exe" ^ + -DSP3_PYTHON_PACKAGES_DIRECTORY:PATH="..\..\lib\site-packages" +if errorlevel 1 exit 1 + +:: Build. +cmake --build . --parallel "%CPU_COUNT%" +if errorlevel 1 exit 1 + +:: Install. +cmake --build . --parallel "%CPU_COUNT%" --target install +if errorlevel 1 exit 1 \ No newline at end of file diff --git a/recipes/sofa-glfw/build.sh b/recipes/sofa-glfw/build.sh new file mode 100644 index 0000000000000..c88549047064c --- /dev/null +++ b/recipes/sofa-glfw/build.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +set -ex + +if [[ $target_platform == osx* ]] ; then + # Dealing with modern C++ for Darwin in embedded catch library. + # See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk + CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" +fi + +mkdir build +cd build + +cmake ${CMAKE_ARGS} \ + -B . \ + -S .. \ + -DPLUGIN_SOFAGLFW:BOOL=ON \ + -DPLUGIN_SOFAIMGUI:BOOL=ON \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ + -DSP3_PYTHON_PACKAGES_DIRECTORY:PATH=python${PY_VER}/site-packages + +# build +cmake --build . --parallel ${CPU_COUNT} + +# install +cmake --build . --parallel ${CPU_COUNT} --target install diff --git a/recipes/sofa-glfw/recipe.yaml b/recipes/sofa-glfw/recipe.yaml new file mode 100644 index 0000000000000..5fccf20722a63 --- /dev/null +++ b/recipes/sofa-glfw/recipe.yaml @@ -0,0 +1,68 @@ +context: + name: sofa-glfw + version: "25.06.00" + major_minor: ${{ (version | split('.'))[:2] | join('.') }} + +package: + name: ${{ name }} + version: ${{ version }} + +source: + url: https://github.com/sofa-framework/SofaGLFW/archive/refs/tags/release-v${{ major_minor }}.tar.gz + sha256: 97aac0871967495f5002d0a43cd0374772c8ea72adbfaa3be4e9431f5d056297 + +build: + number: 0 + +requirements: + build: + - ${{ compiler('cxx') }} + - ${{ stdlib('c') }} + - cmake + - ninja + - if: build_platform != target_platform + then: + - python + - cross-python_${{ target_platform }} + - pybind11 + host: + - sofa-devel ${{ major_minor }}.* + - sofa-python3 ${{ major_minor }}.* + - sofa-gl ${{ major_minor }}.* + - nativefiledialog-extended + - glfw + - pybind11 + - python + run: + # sofa-glfw is a devel library so it needs sofa-devel at runtime + - sofa-devel ${{ major_minor }}.* + run_exports: + - ${{ pin_subpackage(name, upper_bound='x.x') }} + +tests: + - package_contents: + include: + - SofaGLFW/config.h + - SofaImGui/config.h + lib: + - SofaGLFW + - SofaImGui + - script: + - cmake-package-check SofaGLFW SofaImGui + requirements: + run: + - cmake-package-check + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + +about: + homepage: https://github.com/sofa-framework/SofaGLFW + summary: Quick and simple GUI for SOFA, based on GLFW and Dear ImGui (runtime only). + license: LGPL-3.0-or-later + license_file: LICENSE + repository: https://github.com/sofa-framework/SofaGLFW + +extra: + recipe-maintainers: + - olivier-roussel + - hugtalbot diff --git a/recipes/sofa-modelorderreduction/build.bat b/recipes/sofa-modelorderreduction/build.bat new file mode 100644 index 0000000000000..71edde9890e66 --- /dev/null +++ b/recipes/sofa-modelorderreduction/build.bat @@ -0,0 +1,23 @@ +setlocal EnableDelayedExpansion + +mkdir build +cd build + +::Configure +cmake %CMAKE_ARGS% ^ + -B . ^ + -S %SRC_DIR% ^ + -G Ninja ^ + -DCMAKE_BUILD_TYPE:STRING=Release ^ + -DPython_EXECUTABLE:PATH="%PREFIX%\python.exe" ^ + -DSP3_PYTHON_PACKAGES_DIRECTORY:PATH="..\..\lib\site-packages" ^ + -DMODELORDERREDUCTION_BUILD_TESTS:BOOL=OFF +if errorlevel 1 exit 1 + +:: Build. +cmake --build . --parallel "%CPU_COUNT%" +if errorlevel 1 exit 1 + +:: Install. +cmake --build . --parallel "%CPU_COUNT%" --target install +if errorlevel 1 exit 1 \ No newline at end of file diff --git a/recipes/sofa-modelorderreduction/build.sh b/recipes/sofa-modelorderreduction/build.sh new file mode 100644 index 0000000000000..54214e970de3b --- /dev/null +++ b/recipes/sofa-modelorderreduction/build.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +set -ex + +if [[ $target_platform == osx* ]] ; then + # Dealing with modern C++ for Darwin in embedded catch library. + # See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk + CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" +fi + +mkdir build +cd build + +# Set CMAKE_INSTALL_RPATH_USE_LINK_PATH is necessary to link to libCollisionOBBCapsule +# which installs to the non-standard location $PREFIX/plugins/CollisionOBBCapsule/lib +cmake ${CMAKE_ARGS} \ + -B . \ + -S .. \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ + -DSP3_PYTHON_PACKAGES_DIRECTORY:PATH=python${PY_VER}/site-packages \ + -DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON \ + -DMODELORDERREDUCTION_BUILD_TESTS:BOOL=OFF + +# build +cmake --build . --parallel ${CPU_COUNT} + +# install +cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file diff --git a/recipes/sofa-modelorderreduction/recipe.yaml b/recipes/sofa-modelorderreduction/recipe.yaml new file mode 100644 index 0000000000000..ffc81933c4514 --- /dev/null +++ b/recipes/sofa-modelorderreduction/recipe.yaml @@ -0,0 +1,68 @@ +context: + name: sofa-modelorderreduction + version: "25.06.00" + major_minor: ${{ (version | split('.'))[:2] | join('.') }} + +package: + name: ${{ name }} + version: ${{ version }} + +source: + url: https://github.com/SofaDefrost/ModelOrderReduction/archive/refs/tags/release-v${{ major_minor }}.tar.gz + sha256: 8b7c2b13fd6d92d71031894434bf4a987b2f79b06ad801ca892bc9704d1a4464 + +build: + number: 0 + +requirements: + build: + - ${{ compiler('cxx') }} + - ${{ stdlib('c') }} + - cmake + - ninja + - if: build_platform != target_platform + then: + - python + - cross-python_${{ target_platform }} + - pybind11 + host: + - sofa-devel ${{ major_minor }}.* + - sofa-python3 ${{ major_minor }}.* + - python + - pybind11 + run: + # sofa-modelorderreduction is a devel library so it needs sofa-devel at runtime + - sofa-devel ${{ major_minor }}.* + - python + run_exports: + - ${{ pin_subpackage(name, upper_bound='x.x') }} + +tests: + - package_contents: + include: + - ModelOrderReduction/config.h + lib: + - ModelOrderReduction + - script: + - cmake-package-check ModelOrderReduction + requirements: + run: + - cmake-package-check + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + - python: + imports: + - mor + +about: + homepage: https://www.sofa-framework.org/applications/marketplace/modelorderreduction/ + summary: SOFA plugin to reduce model. + license: GPL-2.0-or-later + license_file: LICENSE + documentation: https://modelorderreduction.readthedocs.io/en/latest/ + repository: https://github.com/SofaDefrost/ModelOrderReduction + +extra: + recipe-maintainers: + - olivier-roussel + - hugtalbot diff --git a/recipes/sofa-python3/activate.bat b/recipes/sofa-python3/activate.bat new file mode 100644 index 0000000000000..066ffd8b76ca8 --- /dev/null +++ b/recipes/sofa-python3/activate.bat @@ -0,0 +1,3 @@ +@echo off +:: SOFAPYTHON3_ROOT environment variable in only required on Windows +set SOFAPYTHON3_ROOT=%CONDA_PREFIX%\Library diff --git a/recipes/sofa-python3/build.bat b/recipes/sofa-python3/build.bat new file mode 100644 index 0000000000000..62439e0dd42c6 --- /dev/null +++ b/recipes/sofa-python3/build.bat @@ -0,0 +1,30 @@ +setlocal EnableDelayedExpansion + +mkdir build +cd build + +::Configure +cmake %CMAKE_ARGS% ^ + -B . ^ + -S %SRC_DIR% ^ + -G Ninja ^ + -DCMAKE_BUILD_TYPE:STRING=Release ^ + -DPython_EXECUTABLE:PATH="%PREFIX%\python.exe" ^ + -DSP3_PYTHON_PACKAGES_DIRECTORY:PATH="..\..\lib\site-packages" ^ + -DSP3_BUILD_TEST:BOOL=OFF +if errorlevel 1 exit 1 + +:: Build. +cmake --build . --parallel "%CPU_COUNT%" +if errorlevel 1 exit 1 + +:: Install. +cmake --build . --parallel "%CPU_COUNT%" --target install +if errorlevel 1 exit 1 + +:: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d. +:: This will allow them to be run on environment activation. +for %%F in (activate deactivate) DO ( + if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d + copy %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat +) diff --git a/recipes/sofa-python3/build.sh b/recipes/sofa-python3/build.sh new file mode 100644 index 0000000000000..f18cab7bc388a --- /dev/null +++ b/recipes/sofa-python3/build.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +set -ex + +if [[ $target_platform == osx* ]] ; then + # Dealing with modern C++ for Darwin in embedded catch library. + # See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk + CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" +fi + +mkdir build +cd build + +# We have to manually set the Rpath for Python packages to the lib/ directory using +# the CMAKE_INSTALL_RPATH cmake variable. +cmake ${CMAKE_ARGS} \ + -B . \ + -S .. \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DCMAKE_INSTALL_RPATH:PATH=${PREFIX}/lib \ + -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ + -DSP3_PYTHON_PACKAGES_DIRECTORY:PATH=python${PY_VER}/site-packages \ + -DSP3_BUILD_TEST:BOOL=OFF + +# build +cmake --build . --parallel ${CPU_COUNT} + +# install +cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file diff --git a/recipes/sofa-python3/deactivate.bat b/recipes/sofa-python3/deactivate.bat new file mode 100644 index 0000000000000..7eedeca82b1c1 --- /dev/null +++ b/recipes/sofa-python3/deactivate.bat @@ -0,0 +1 @@ +@set SOFAPYTHON3_ROOT= diff --git a/recipes/sofa-python3/patches/0001-hotfix-for-libpython-linking-on-macOS.patch b/recipes/sofa-python3/patches/0001-hotfix-for-libpython-linking-on-macOS.patch new file mode 100644 index 0000000000000..52555c0b45837 --- /dev/null +++ b/recipes/sofa-python3/patches/0001-hotfix-for-libpython-linking-on-macOS.patch @@ -0,0 +1,215 @@ +From f498ada2dca16d8159acbf083786fe6187e4d843 Mon Sep 17 00:00:00 2001 +From: Olivier Roussel +Date: Thu, 4 Apr 2024 13:56:36 +0200 +Subject: [PATCH] hotfix for libpython linking on macOS + +--- + CMake/SofaPython3Tools.cmake | 34 +------------------------------ + CMakeLists.txt | 39 ------------------------------------ + Plugin/CMakeLists.txt | 12 ++++++++++- + SofaPython3Config.cmake.in | 37 ---------------------------------- + Testing/CMakeLists.txt | 5 +++++ + 5 files changed, 17 insertions(+), 110 deletions(-) + +diff --git a/CMake/SofaPython3Tools.cmake b/CMake/SofaPython3Tools.cmake +index 678743f..e59bf80 100644 +--- a/CMake/SofaPython3Tools.cmake ++++ b/CMake/SofaPython3Tools.cmake +@@ -117,41 +117,9 @@ function(SP3_add_python_module) + # We are doing manually what's usually done with pybind11_add_module(${A_TARGET} SHARED "${A_SOURCES}") + # since we got some problems on MacOS using recent versions of pybind11 where the SHARED argument wasn't taken + # into account +- python_add_library(${A_TARGET} SHARED ${A_HEADERS} ${A_SOURCES}) ++ pybind11_add_module(${A_TARGET} SHARED ${A_HEADERS} ${A_SOURCES}) + add_library(SofaPython3::${A_TARGET} ALIAS ${A_TARGET}) + +- if ("${pybind11_VERSION}" VERSION_GREATER_EQUAL "2.6.0") +- target_link_libraries(${A_TARGET} PRIVATE pybind11::headers) +- target_link_libraries(${A_TARGET} PRIVATE pybind11::embed) +- target_link_libraries(${A_TARGET} PRIVATE pybind11::lto) +- if(MSVC) +- target_link_libraries(${A_TARGET} PRIVATE pybind11::windows_extras) +- endif() +- +- pybind11_extension(${A_TARGET}) +- pybind11_strip(${A_TARGET}) +- else() +- target_link_libraries(${A_TARGET} PRIVATE pybind11::module) +- +- # Equivalent to pybind11_extension(${A_TARGET}) which doesn't exists on pybind11 versions < 5 +- set_target_properties(${A_TARGET} PROPERTIES PREFIX "" SUFFIX "${PYTHON_MODULE_EXTENSION}") +- +- if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo) +- # Equivalent to pybind11_strip(${A_TARGET}) which doesn't exists on pybind11 versions < 5 +- # Strip unnecessary sections of the binary on Linux/macOS +- if(CMAKE_STRIP) +- if(APPLE) +- set(x_opt -x) +- endif() +- +- add_custom_command( +- TARGET ${A_TARGET} +- POST_BUILD +- COMMAND ${CMAKE_STRIP} ${x_opt} $) +- endif() +- endif() +- endif() +- + set_target_properties(${A_TARGET} + PROPERTIES + CXX_VISIBILITY_PRESET "hidden" +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3774e67..4902809 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -82,35 +82,6 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) + # Set the minimum python version to 3.7 + set(PYBIND11_PYTHON_VERSION 3.7) + +-# Find Python3 +-find_package(Python ${PYBIND11_PYTHON_VERSION} COMPONENTS Interpreter Development REQUIRED) +- +-# Save PYTHON_* vars +-set(PYTHON_VERSION_RESET "${PYTHON_VERSION}") +-set(PYTHON_EXECUTABLE_RESET "${PYTHON_EXECUTABLE}") +-set(PYTHON_LIBRARIES_RESET "${PYTHON_LIBRARIES}") +-set(PYTHON_INCLUDE_DIRS_RESET "${PYTHON_INCLUDE_DIRS}") +-set(PYTHON_LIBRARY_RESET "${PYTHON_LIBRARY}") +-set(PYTHON_INCLUDE_DIR_RESET "${PYTHON_INCLUDE_DIR}") +- +-# Change PYTHON_* vars before pybind11 find_package +-# to be sure that pybind11 relies on the right Python version +-set(PYTHON_VERSION "${Python_VERSION}" CACHE STRING "" FORCE) +-set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}" CACHE FILEPATH "" FORCE) +-set(PYTHON_LIBRARIES "${Python_LIBRARIES}" CACHE STRING "" FORCE) +-set(PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}" CACHE STRING "" FORCE) +-if(EXISTS "${Python_LIBRARY}") +- set(PYTHON_LIBRARY "${Python_LIBRARY}" CACHE INTERNAL "" FORCE) +-elseif(EXISTS "${Python_LIBRARIES}") +- set(PYTHON_LIBRARY "${Python_LIBRARIES}" CACHE INTERNAL "" FORCE) +-endif() +-if(EXISTS "${Python_INCLUDE_DIR}") +- set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIR}" CACHE INTERNAL "" FORCE) +-elseif(EXISTS "${Python_INCLUDE_DIRS}") +- set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE) +-endif() +-string(REGEX MATCH "[0-9]+\.[0-9]+" PythonMAJMIN "${Python_VERSION}") +- + # Set the minimum pybind11 version to 2.3 (before that the pybind11::embed target did not exist) + find_package(pybind11 2.3 CONFIG QUIET REQUIRED) + +@@ -146,8 +117,6 @@ message(STATUS "Python: + Libraries: ${Python_LIBRARIES} + User site: ${PYTHON_USER_SITE}" + ) +- +- + message(STATUS "pybind11: + Version: ${pybind11_VERSION} + Config: ${pybind11_CONFIG}" +@@ -246,11 +215,3 @@ if (SP3_LINK_TO_USER_SITE AND SP3_PYTHON_PACKAGES_LINK_DIRECTORY) + endif() + endforeach() + endif() +- +-# Reset PYTHON_* vars +-set(PYTHON_VERSION "${PYTHON_VERSION_RESET}" CACHE STRING "" FORCE) +-set(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE_RESET}" CACHE FILEPATH "" FORCE) +-set(PYTHON_LIBRARIES "${PYTHON_LIBRARIES_RESET}" CACHE STRING "" FORCE) +-set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS_RESET}" CACHE STRING "" FORCE) +-set(PYTHON_LIBRARY "${PYTHON_LIBRARY_RESET}" CACHE INTERNAL "" FORCE) +-set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_DIR_RESET}" CACHE INTERNAL "" FORCE) +diff --git a/Plugin/CMakeLists.txt b/Plugin/CMakeLists.txt +index f53e987..7cd08e4 100644 +--- a/Plugin/CMakeLists.txt ++++ b/Plugin/CMakeLists.txt +@@ -35,7 +35,17 @@ add_library(SofaPython3::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) + target_compile_definitions(${PROJECT_NAME} PRIVATE "-DSOFA_BUILD_SOFAPYTHON3") + + target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Graph) +-target_link_libraries(${PROJECT_NAME} PUBLIC pybind11::module pybind11::embed) ++ ++# The public linking with pybind lead to have a link with libpython which ++# propagates in the python module .so. On macOS, this extra link with libpython ++# lead to segv when importing the python module in versions of python that don't ++# have a dynamic link with libpython (such as the one provided by conda which is linked ++# statically), but works fine with versions that have such link. ++if(CMAKE_SYSTEM_NAME STREQUAL Darwin) ++ target_link_libraries(${PROJECT_NAME} PRIVATE pybind11::pybind11 pybind11::python_link_helper) ++else() ++ target_link_libraries(${PROJECT_NAME} PUBLIC pybind11::embed) ++endif() + + set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME SofaPython3) + +diff --git a/SofaPython3Config.cmake.in b/SofaPython3Config.cmake.in +index 2c3410a..8922133 100644 +--- a/SofaPython3Config.cmake.in ++++ b/SofaPython3Config.cmake.in +@@ -8,47 +8,10 @@ set(SP3_PYTHON_PACKAGES_DIRECTORY @SP3_PYTHON_PACKAGES_DIRECTORY@) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") + include(SofaPython3Tools) + +-# Find Python3 +-if(NOT Python_FOUND) +- find_package(Python @PythonMAJMIN@ EXACT QUIET REQUIRED COMPONENTS Interpreter Development) +-endif() + + # Find pybind11 + if(NOT pybind11_FOUND) +- # Save PYTHON_* vars +- set(PYTHON_VERSION_RESET "${PYTHON_VERSION}") +- set(PYTHON_EXECUTABLE_RESET "${PYTHON_EXECUTABLE}") +- set(PYTHON_LIBRARIES_RESET "${PYTHON_LIBRARIES}") +- set(PYTHON_INCLUDE_DIRS_RESET "${PYTHON_INCLUDE_DIRS}") +- set(PYTHON_LIBRARY_RESET "${PYTHON_LIBRARY}") +- set(PYTHON_INCLUDE_DIR_RESET "${PYTHON_INCLUDE_DIR}") +- +- # Change PYTHON_* vars before pybind11 find_package +- # to be sure that pybind11 relies on the right Python version +- set(PYTHON_VERSION "${Python_VERSION}" CACHE STRING "" FORCE) +- set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}" CACHE FILEPATH "" FORCE) +- set(PYTHON_LIBRARIES "${Python_LIBRARIES}" CACHE STRING "" FORCE) +- set(PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}" CACHE STRING "" FORCE) +- if(EXISTS "${Python_LIBRARY}") +- set(PYTHON_LIBRARY "${Python_LIBRARY}" CACHE INTERNAL "" FORCE) +- elseif(EXISTS "${Python_LIBRARIES}") +- set(PYTHON_LIBRARY "${Python_LIBRARIES}" CACHE INTERNAL "" FORCE) +- endif() +- if(EXISTS "${Python_INCLUDE_DIR}") +- set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIR}" CACHE INTERNAL "" FORCE) +- elseif(EXISTS "${Python_INCLUDE_DIRS}") +- set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE) +- endif() +- + find_package(pybind11 @pybind11_VERSION@ QUIET REQUIRED CONFIG) +- +- # Reset PYTHON_* vars +- set(PYTHON_VERSION "${PYTHON_VERSION_RESET}" CACHE STRING "" FORCE) +- set(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE_RESET}" CACHE FILEPATH "" FORCE) +- set(PYTHON_LIBRARIES "${PYTHON_LIBRARIES_RESET}" CACHE STRING "" FORCE) +- set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS_RESET}" CACHE STRING "" FORCE) +- set(PYTHON_LIBRARY "${PYTHON_LIBRARY_RESET}" CACHE INTERNAL "" FORCE) +- set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_DIR_RESET}" CACHE INTERNAL "" FORCE) + endif() + + # Find SofaPython3::XXXXX +diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt +index becc5fa..c7f0adc 100644 +--- a/Testing/CMakeLists.txt ++++ b/Testing/CMakeLists.txt +@@ -17,6 +17,11 @@ set(SOURCE_FILES + + add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) + target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Testing SofaPython3::Plugin) ++# We wan't the pybind11 dependency to propagate to SofaPython3Testing consumers, ++# here Bindings.*.Tests ++if(CMAKE_SYSTEM_NAME STREQUAL Darwin) ++ target_link_libraries(${PROJECT_NAME} PUBLIC pybind11::embed) ++endif() + target_compile_definitions(${PROJECT_NAME} PRIVATE "-DSOFA_BUILD_SOFAPYTHON3") + set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER Testing) + +-- +2.34.1 + diff --git a/recipes/sofa-python3/recipe.yaml b/recipes/sofa-python3/recipe.yaml new file mode 100644 index 0000000000000..c374543b089c5 --- /dev/null +++ b/recipes/sofa-python3/recipe.yaml @@ -0,0 +1,82 @@ +context: + name: sofa-python3 + version: "25.06.00" + major_minor: ${{ (version | split('.'))[:2] | join('.') }} + +package: + name: ${{ name }} + version: ${{ version }} + +source: + url: https://github.com/sofa-framework/SofaPython3/archive/refs/tags/release-v${{ major_minor }}.tar.gz + sha256: 30118f4d0ec21f442f05bd4fcb05af62a02b9c2e8d17bb087f56ea2f1a2ac63e + + patches: + # See comments in sofa conda package recipe at file + # scripts/hotfix-sofa-run-macos.sh for more details. + # This hotfix breaks python module installation on Windows, so we + # only apply on macOS. + - if: osx + then: + - patches/0001-hotfix-for-libpython-linking-on-macOS.patch + +build: + number: 0 + +requirements: + build: + - ${{ compiler('cxx') }} + - ${{ stdlib('c') }} + - cmake + - ninja + - if: build_platform != target_platform + then: + - python + - cross-python_${{ target_platform }} + - numpy + - pybind11 + host: + - sofa-devel ${{ major_minor }}.* + - sofa-gl ${{ major_minor }}.* + - eigen + - python + - numpy + - pybind11 + run: + - python + - pybind11 + run_exports: + - ${{ pin_subpackage(name, upper_bound='x.x') }} + +tests: + - package_contents: + include: + - SofaPython3/config.h + lib: + - SofaPython3 + - python: + imports: + - Sofa + - SofaRuntime + - SofaTypes + - SofaExporter + - script: + - cmake-package-check SofaPython3 + requirements: + run: + - cmake-package-check + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + +about: + homepage: https://github.com/sofa-framework/SofaPython3 + summary: A python plugin for Sofa offering a pythonic interface and python3 support. + license: LGPL-2.1-or-later + license_file: License.md + documentation: https://sofapython3.readthedocs.io/ + repository: https://github.com/sofa-framework/SofaPython3 + +extra: + recipe-maintainers: + - olivier-roussel + - hugtalbot diff --git a/recipes/sofa-softrobots/build.bat b/recipes/sofa-softrobots/build.bat new file mode 100644 index 0000000000000..a24f88c7a2510 --- /dev/null +++ b/recipes/sofa-softrobots/build.bat @@ -0,0 +1,22 @@ +setlocal EnableDelayedExpansion + +mkdir build +cd build + +::Configure +cmake %CMAKE_ARGS% ^ + -B . ^ + -S %SRC_DIR% ^ + -G Ninja ^ + -DCMAKE_BUILD_TYPE:STRING=Release ^ + -DPython_EXECUTABLE:PATH="%PREFIX%\python.exe" ^ + -DSOFTROBOTS_BUILD_TESTS:BOOL=OFF +if errorlevel 1 exit 1 + +:: Build. +cmake --build . --parallel "%CPU_COUNT%" +if errorlevel 1 exit 1 + +:: Install. +cmake --build . --parallel "%CPU_COUNT%" --target install +if errorlevel 1 exit 1 \ No newline at end of file diff --git a/recipes/sofa-softrobots/build.sh b/recipes/sofa-softrobots/build.sh new file mode 100644 index 0000000000000..e8894cf6c4346 --- /dev/null +++ b/recipes/sofa-softrobots/build.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +set -ex + +if [[ $target_platform == osx* ]] ; then + # Dealing with modern C++ for Darwin in embedded catch library. + # See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk + CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" +fi + +mkdir build +cd build + +cmake ${CMAKE_ARGS} \ + -B . \ + -S .. \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ + -DSOFTROBOTS_BUILD_TESTS:BOOL=OFF + +# build +cmake --build . --parallel ${CPU_COUNT} + +# install +cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file diff --git a/recipes/sofa-softrobots/patches/0001-only-requires-Qt5-if-interactive-control-cmake-optio.patch b/recipes/sofa-softrobots/patches/0001-only-requires-Qt5-if-interactive-control-cmake-optio.patch new file mode 100644 index 0000000000000..f579366051468 --- /dev/null +++ b/recipes/sofa-softrobots/patches/0001-only-requires-Qt5-if-interactive-control-cmake-optio.patch @@ -0,0 +1,28 @@ +From 0f40913a43cb41533535519c9b4e4fdc62b60914 Mon Sep 17 00:00:00 2001 +From: Olivier Roussel +Date: Thu, 18 Sep 2025 15:39:49 +0200 +Subject: [PATCH] only requires Qt5 if interactive control cmake option is ON + +--- + SoftRobotsConfig.cmake.in | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/SoftRobotsConfig.cmake.in b/SoftRobotsConfig.cmake.in +index 9000ee8..d665d04 100644 +--- a/SoftRobotsConfig.cmake.in ++++ b/SoftRobotsConfig.cmake.in +@@ -13,7 +13,10 @@ find_package(Sofa.Component.Controller QUIET REQUIRED) + find_package(Sofa.Component.SolidMechanics.Spring QUIET REQUIRED) + find_package(Sofa.Component.Mapping QUIET REQUIRED) + find_package(Sofa.Component.StateContainer QUIET REQUIRED) +-find_package(Qt5 QUIET REQUIRED COMPONENTS Network) ++ ++if(SOFTROBOTS_INTERACTIVECONTROL) ++ find_package(Qt5 QUIET REQUIRED COMPONENTS Network) ++endif() + + if(SOFTROBOTS_HAVE_SOFAPYTHON) + find_package(SofaPython QUIET REQUIRED) +-- +2.34.1 + diff --git a/recipes/sofa-softrobots/recipe.yaml b/recipes/sofa-softrobots/recipe.yaml new file mode 100644 index 0000000000000..c1953eecc5f91 --- /dev/null +++ b/recipes/sofa-softrobots/recipe.yaml @@ -0,0 +1,73 @@ +context: + name: sofa-softrobots + version: "25.06.00" + major_minor: ${{ (version | split('.'))[:2] | join('.') }} + +package: + name: ${{ name }} + version: ${{ version }} + +source: + url: https://github.com/SofaDefrost/SoftRobots/archive/refs/tags/release-v${{ major_minor }}.tar.gz + sha256: 87d9d693851315de2c369cfcc8ce3324dc7ca949887604b5041a0d3a26f0b590 + + patches: + # https://github.com/SofaDefrost/SoftRobots/pull/339 + - patches/0001-only-requires-Qt5-if-interactive-control-cmake-optio.patch + +build: + number: 0 + +requirements: + build: + - ${{ compiler('cxx') }} + - ${{ stdlib('c') }} + - cmake + - ninja + - if: build_platform != target_platform + then: + - python + - cross-python_${{ target_platform }} + - pybind11 + host: + - sofa-devel ${{ major_minor }}.* + - sofa-python3 ${{ major_minor }}.* + - sofa-stlib ${{ major_minor }}.* + - python + - pybind11 + run: + # sofa-softrobots is a devel library so it needs sofa-devel at runtime + - sofa-devel ${{ major_minor }}.* + - python + run_exports: + - ${{ pin_subpackage(name, upper_bound='x.x') }} + +tests: + - package_contents: + include: + - SoftRobots/component/initSoftRobots.h + lib: + - SoftRobots + - script: + - cmake-package-check SoftRobots + requirements: + run: + - cmake-package-check + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + - python: + imports: + - softrobots + +about: + homepage: https://project.inria.fr/softrobot/ + summary: Sofa plugin containing components & method for soft robotics. + license: LGPL-3.0-or-later + license_file: LICENSE + documentation: https://softrobots.readthedocs.io/ + repository: https://github.com/SofaDefrost/SoftRobots + +extra: + recipe-maintainers: + - olivier-roussel + - hugtalbot diff --git a/recipes/sofa-softrobotsinverse/build.bat b/recipes/sofa-softrobotsinverse/build.bat new file mode 100644 index 0000000000000..19dc5b1e0166e --- /dev/null +++ b/recipes/sofa-softrobotsinverse/build.bat @@ -0,0 +1,24 @@ +setlocal EnableDelayedExpansion + +mkdir build +cd build + +::Configure +cmake %CMAKE_ARGS% ^ + -B . ^ + -S %SRC_DIR% ^ + -G Ninja ^ + -DCMAKE_BUILD_TYPE:STRING=Release ^ + -DPython_EXECUTABLE:PATH="%PREFIX%\python.exe" ^ + -DSOFTROBOTSINVERSE_ENABLE_PROXQP:BOOL=ON ^ + -DSOFTROBOTSINVERSE_ENABLE_QPOASES:BOOL=OFF ^ + -DSOFTROBOTSINVERSE_BUILD_TESTS:BOOL=OFF +if errorlevel 1 exit 1 + +:: Build. +cmake --build . --parallel "%CPU_COUNT%" +if errorlevel 1 exit 1 + +:: Install. +cmake --build . --parallel "%CPU_COUNT%" --target install +if errorlevel 1 exit 1 \ No newline at end of file diff --git a/recipes/sofa-softrobotsinverse/build.sh b/recipes/sofa-softrobotsinverse/build.sh new file mode 100644 index 0000000000000..e97b7f7b55473 --- /dev/null +++ b/recipes/sofa-softrobotsinverse/build.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +set -ex + +if [[ $target_platform == osx* ]] ; then + # Dealing with modern C++ for Darwin in embedded catch library. + # See https://conda-forge.org/docs/maintainer/knowledge_base.html#newer-c-features-with-old-sdk + CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" +fi + +mkdir build +cd build + +cmake ${CMAKE_ARGS} \ + -B . \ + -S .. \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ + -DSOFTROBOTSINVERSE_ENABLE_PROXQP:BOOL=ON \ + -DSOFTROBOTSINVERSE_ENABLE_QPOASES:BOOL=OFF \ + -DSOFTROBOTSINVERSE_BUILD_TESTS:BOOL=OFF + +# build +cmake --build . --parallel ${CPU_COUNT} + +# install +cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file diff --git a/recipes/sofa-softrobotsinverse/recipe.yaml b/recipes/sofa-softrobotsinverse/recipe.yaml new file mode 100644 index 0000000000000..a0e836d4ab476 --- /dev/null +++ b/recipes/sofa-softrobotsinverse/recipe.yaml @@ -0,0 +1,71 @@ +context: + name: sofa-softrobotsinverse + version: "25.06.00" + major_minor: ${{ (version | split('.'))[:2] | join('.') }} + +package: + name: ${{ name|lower }} + version: ${{ version }} + +source: + url: https://github.com/SofaDefrost/SoftRobots.Inverse/archive/refs/tags/release-v${{ major_minor }}.tar.gz + sha256: a7158e2423a94aa2aa7b0f9f2fa81eea95acd5f48a49e2de09ab95b43e42bd83 + +build: + number: 0 + +requirements: + build: + - ${{ compiler('cxx') }} + - ${{ stdlib('c') }} + - cmake + - ninja + - if: build_platform != target_platform + then: + - python + - cross-python_${{ target_platform }} + - pybind11 + host: + - sofa-devel ${{ major_minor }}.* + - sofa-python3 ${{ major_minor }}.* + - sofa-softrobots ${{ major_minor }}.* + - eigen + - pybind11 + - python + - proxsuite + run: + # sofa-softrobotsinverse is a devel library so it needs sofa-devel at runtime + - sofa-devel ${{ major_minor }}.* + - sofa-stlib ${{ major_minor }}.* + - proxsuite + - python + run_exports: + - ${{ pin_subpackage(name, upper_bound='x.x') }} + +tests: + - package_contents: + include: + - SoftRobots.Inverse/component/config.h + lib: + - SoftRobots.Inverse + - script: + - cmake-package-check SoftRobots.Inverse + requirements: + run: + - cmake-package-check + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + +about: + homepage: https://github.com/SofaDefrost/SoftRobots.Inverse + summary: Sofa plugin containing inverse method for soft robotics. + license: AGPL-3.0-only + license_file: + - LICENSE.AGPLV3.txt + - LICENSE.AGPLV3.Clause11.txt + repository: https://github.com/SofaDefrost/SoftRobots.Inverse + +extra: + recipe-maintainers: + - olivier-roussel + - hugtalbot \ No newline at end of file diff --git a/recipes/sofa-stlib/build.bat b/recipes/sofa-stlib/build.bat new file mode 100644 index 0000000000000..8ffe7b84c26d3 --- /dev/null +++ b/recipes/sofa-stlib/build.bat @@ -0,0 +1,22 @@ +setlocal EnableDelayedExpansion + +mkdir build +cd build + +::Configure +cmake %CMAKE_ARGS% ^ + -B . ^ + -S %SRC_DIR% ^ + -G Ninja ^ + -DCMAKE_BUILD_TYPE:STRING=Release ^ + -DPython_EXECUTABLE:PATH="%PREFIX%\python.exe" ^ + -DPLUGIN_SOFAPYTHON:BOOL=ON +if errorlevel 1 exit 1 + +:: Build. +cmake --build . --parallel "%CPU_COUNT%" +if errorlevel 1 exit 1 + +:: Install. +cmake --build . --parallel "%CPU_COUNT%" --target install +if errorlevel 1 exit 1 \ No newline at end of file diff --git a/recipes/sofa-stlib/build.sh b/recipes/sofa-stlib/build.sh new file mode 100644 index 0000000000000..899034c28a4e2 --- /dev/null +++ b/recipes/sofa-stlib/build.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +set -ex + +mkdir build +cd build + +cmake ${CMAKE_ARGS} \ + -B . \ + -S .. \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ + -DPLUGIN_SOFAPYTHON=ON + +# build +cmake --build . --parallel ${CPU_COUNT} + +# install +cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file diff --git a/recipes/sofa-stlib/recipe.yaml b/recipes/sofa-stlib/recipe.yaml new file mode 100644 index 0000000000000..15922cd666253 --- /dev/null +++ b/recipes/sofa-stlib/recipe.yaml @@ -0,0 +1,66 @@ +context: + name: sofa-stlib + version: "25.06.00" + major_minor: ${{ (version | split('.'))[:2] | join('.') }} + +package: + name: ${{ name }} + version: ${{ version }} + +source: + url: https://github.com/SofaDefrost/STLIB/archive/refs/tags/release-v${{ major_minor }}.tar.gz + sha256: 707b89949f6b2153415ff8ea88fe0d135798560e65b477b437176369e1279e54 + +build: + number: 0 + +requirements: + build: + - ${{ compiler('cxx') }} + - ${{ stdlib('c') }} + - cmake + - ninja + - if: build_platform != target_platform + then: + - python + - cross-python_${{ target_platform }} + - pybind11 + host: + - sofa-python3 ${{ major_minor }}.* + - python + - pybind11 + run: + - python + run_exports: + - ${{ pin_subpackage(name, upper_bound='x.x') }} + +tests: + - package_contents: + include: + - STLIB/initPlugin.h + lib: + - STLIB + - script: + - cmake-package-check STLIB + requirements: + run: + - cmake-package-check + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + - python: + imports: + - splib3 + - stlib3 + +about: + homepage: https://github.com/SofaDefrost/STLIB + summary: Sofa Template Library containing Sofa scenes templates. + license: LGPL-3.0-or-later + license_file: LICENSE + documentation: https://stlib.readthedocs.io/ + repository: https://github.com/SofaDefrost/STLIB + +extra: + recipe-maintainers: + - olivier-roussel + - hugtalbot From 0cab589e2dba07e40760b05f75061d09b20b0c11 Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Fri, 9 Jan 2026 15:59:04 +0100 Subject: [PATCH 02/13] fix sofa-gflw to hide private interface & internal dependencies --- recipes/sofa-glfw/build.bat | 14 +- recipes/sofa-glfw/build.sh | 11 + ...-imgui.h-from-ImgGuiGUIEngine-header.patch | 330 ++++++++++++++++++ ...o-impl-and-do-not-expose-private-hea.patch | 305 ++++++++++++++++ ...FW-cmake-config-in-with-missing-gflw.patch | 26 ++ recipes/sofa-glfw/recipe.yaml | 13 + 6 files changed, 698 insertions(+), 1 deletion(-) create mode 100644 recipes/sofa-glfw/patches/0001-remove-imgui.h-from-ImgGuiGUIEngine-header.patch create mode 100644 recipes/sofa-glfw/patches/0002-hide-SimpleIni-to-impl-and-do-not-expose-private-hea.patch create mode 100644 recipes/sofa-glfw/patches/0003-fix-SofaGLFW-cmake-config-in-with-missing-gflw.patch diff --git a/recipes/sofa-glfw/build.bat b/recipes/sofa-glfw/build.bat index 068e0cb7cc339..8b385141ac2d5 100644 --- a/recipes/sofa-glfw/build.bat +++ b/recipes/sofa-glfw/build.bat @@ -21,4 +21,16 @@ if errorlevel 1 exit 1 :: Install. cmake --build . --parallel "%CPU_COUNT%" --target install -if errorlevel 1 exit 1 \ No newline at end of file +if errorlevel 1 exit 1 + +:: Testing compilation as 3rd party +cd .. +mkdir build-test +cmake %CMAKE_ARGS% ^ + -B build-test ^ + -S %SRC_DIR%\SofaImGui\extensions\SofaImGui.Camera ^ + -DCMAKE_VERBOSE_MAKEFILE=ON +if errorlevel 1 exit 1 + +cmake --build build-test --parallel "%CPU_COUNT%" +if errorlevel 1 exit 1 diff --git a/recipes/sofa-glfw/build.sh b/recipes/sofa-glfw/build.sh index c88549047064c..1a2b144251e63 100644 --- a/recipes/sofa-glfw/build.sh +++ b/recipes/sofa-glfw/build.sh @@ -25,3 +25,14 @@ cmake --build . --parallel ${CPU_COUNT} # install cmake --build . --parallel ${CPU_COUNT} --target install + +# testing compilation as 3rd party +if [[ $CONDA_BUILD_CROSS_COMPILATION != 1 ]]; then + cd .. + mkdir build-test + cmake ${CMAKE_ARGS} \ + -B build-test \ + -S SofaImGui/extensions/SofaImGui.Camera + + cmake --build build-test --parallel ${CPU_COUNT} +fi \ No newline at end of file diff --git a/recipes/sofa-glfw/patches/0001-remove-imgui.h-from-ImgGuiGUIEngine-header.patch b/recipes/sofa-glfw/patches/0001-remove-imgui.h-from-ImgGuiGUIEngine-header.patch new file mode 100644 index 0000000000000..638e89af5249f --- /dev/null +++ b/recipes/sofa-glfw/patches/0001-remove-imgui.h-from-ImgGuiGUIEngine-header.patch @@ -0,0 +1,330 @@ +From 18eaac6e5ac07515705bf6a8c40da8b27164c59f Mon Sep 17 00:00:00 2001 +From: Olivier Roussel +Date: Mon, 22 Dec 2025 11:30:14 +0100 +Subject: [PATCH] remove imgui.h from ImgGuiGUIEngine header + +remove imgui internal headers from distributed public headers + +hide impl of ScalarWidget + +remove useless headers + +fix missing headers simpleini.h + +use SimpleIni as a dependency + +add SimpleIni dep in SofaImGUi cmake config + +do not install implot and IconFontCppHeaders headers +--- + SofaImGui/CMakeLists.txt | 48 ++++++++----------- + SofaImGui/SofaImGuiConfig.cmake.in | 4 ++ + SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp | 4 +- + SofaImGui/src/SofaImGui/ImGuiGUIEngine.h | 5 +- + .../src/SofaImGui/widgets/ScalarWidget.cpp | 39 +++++++++++++++ + .../src/SofaImGui/widgets/ScalarWidget.h | 11 +---- + SofaImGui/src/SofaImGui/windows/Log.h | 2 - + .../src/SofaImGui/windows/Performances.h | 1 - + SofaImGui/src/SofaImGui/windows/Profiler.h | 2 - + SofaImGui/src/SofaImGui/windows/Settings.h | 1 + + SofaImGui/src/SofaImGui/windows/ViewPort.h | 1 + + 11 files changed, 74 insertions(+), 44 deletions(-) + create mode 100644 SofaImGui/src/SofaImGui/widgets/ScalarWidget.cpp + +diff --git a/SofaImGui/CMakeLists.txt b/SofaImGui/CMakeLists.txt +index 45022cc..74fa7fd 100644 +--- a/SofaImGui/CMakeLists.txt ++++ b/SofaImGui/CMakeLists.txt +@@ -21,6 +21,7 @@ FetchContent_Declare(imgui + ) + FetchContent_MakeAvailable(imgui) + ++# nfd (nativefiledialog-extended) + find_package(nfd CONFIG QUIET) + + if(TARGET nfd::nfd) +@@ -41,7 +42,6 @@ else() + add_library(nfd::nfd ALIAS nfd) # introduced in nfd >= v1.2.1 + endif() + +- + FetchContent_Declare(ImPlot + GIT_REPOSITORY https://github.com/epezent/implot + GIT_TAG 18c72431f8265e2b0b5378a3a73d8a883b2175ff # v0.16 +@@ -54,30 +54,23 @@ FetchContent_Declare(IconFontCppHeaders + ) + FetchContent_MakeAvailable(IconFontCppHeaders) + +-FetchContent_Declare(simpleini +- GIT_REPOSITORY https://github.com/brofield/simpleini +- GIT_TAG 09c21bda1dc1b578fa55f4a005d79b0afd481296 # v4.22 +-) +-FetchContent_MakeAvailable(simpleini) +- +-set(IMGUI_HEADER_FILES +- ${imgui_SOURCE_DIR}/backends/imgui_impl_glfw.h +- ${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.h +- ${imgui_SOURCE_DIR}/backends/imgui_impl_opengl2.h +- ${imgui_SOURCE_DIR}/imconfig.h +- ${imgui_SOURCE_DIR}/imgui.h +- ${imgui_SOURCE_DIR}/imgui_internal.h +- ${imgui_SOURCE_DIR}/misc/cpp/imgui_stdlib.h +- ${implot_SOURCE_DIR}/implot.h +- ${implot_SOURCE_DIR}/implot_internal.h +- ${iconfontcppheaders_SOURCE_DIR}/IconsFontAwesome4.h +- ${iconfontcppheaders_SOURCE_DIR}/IconsFontAwesome6.h +- ${simpleini_SOURCE_DIR}/SimpleIni.h +- resources/fa-regular-400.h +- resources/fa-solid-900.h +- resources/Roboto-Medium.h +- resources/Style.h +-) ++ ++# SimpleIni ++find_package(SimpleIni QUIET) ++ ++if(NOT TARGET SimpleIni::SimpleIni AND ((DEFINED SOFA_ALLOW_FETCH_DEPENDENCIES AND SOFA_ALLOW_FETCH_DEPENDENCIES) OR (NOT DEFINED SOFA_ALLOW_FETCH_DEPENDENCIES))) ++ message("${PROJECT_NAME}: SimpleIni not found and SOFA_ALLOW_FETCH_DEPENDENCIES is ON, fetching source code...") ++ ++ FetchContent_Declare(simpleini ++ GIT_REPOSITORY https://github.com/brofield/simpleini ++ GIT_TAG 09c21bda1dc1b578fa55f4a005d79b0afd481296 # v4.22 ++ ) ++ FetchContent_MakeAvailable(simpleini) ++ ++elseif(NOT TARGET SimpleIni::SimpleIni) ++ message(FATAL_ERROR "{PROJECT_NAME}: SimpleIni not found and SOFA_ALLOW_FETCH_DEPENDENCIES is OFF and thus cannot be fetched. Install SimpleIni, or enable SOFA_ALLOW_FETCH_DEPENDENCIES to fix this issue.") ++endif() ++ + set(IMGUI_SOURCE_FILES + ${imgui_SOURCE_DIR}/backends/imgui_impl_glfw.cpp + ${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.cpp +@@ -101,7 +94,6 @@ set(HEADER_FILES + ${SOFAIMGUI_SOURCE_DIR}/ImGuiDataWidget.h + ${SOFAIMGUI_SOURCE_DIR}/ImGuiGUI.h + ${SOFAIMGUI_SOURCE_DIR}/ImGuiGUIEngine.h +- ${SOFAIMGUI_SOURCE_DIR}/ObjectColor.h + ${SOFAIMGUI_SOURCE_DIR}/UIStrings.h + ${SOFAIMGUI_SOURCE_DIR}/widgets/DisplayFlagsWidget.h + ${SOFAIMGUI_SOURCE_DIR}/widgets/LinearSpringWidget.h +@@ -131,6 +123,7 @@ set(SOURCE_FILES + ${SOFAIMGUI_SOURCE_DIR}/initSofaImGui.cpp + ${SOFAIMGUI_SOURCE_DIR}/widgets/DisplayFlagsWidget.cpp + ${SOFAIMGUI_SOURCE_DIR}/widgets/MaterialWidget.cpp ++ ${SOFAIMGUI_SOURCE_DIR}/widgets/ScalarWidget.cpp + ${SOFAIMGUI_SOURCE_DIR}/windows/Performances.cpp + ${SOFAIMGUI_SOURCE_DIR}/windows/Log.cpp + ${SOFAIMGUI_SOURCE_DIR}/windows/MouseManager.cpp +@@ -151,10 +144,11 @@ set(SOURCE_FILES + + set(IMGUI_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources ${imgui_SOURCE_DIR} ${implot_SOURCE_DIR} ${iconfontcppheaders_SOURCE_DIR} ${simpleini_SOURCE_DIR}) + +-add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${IMGUI_HEADER_FILES} ${IMGUI_SOURCE_FILES}) ++add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${IMGUI_SOURCE_FILES}) + target_include_directories(${PROJECT_NAME} PUBLIC "$") + target_link_libraries(${PROJECT_NAME} PUBLIC SofaGLFW Sofa.GL.Component.Rendering3D ${CMAKE_DL_LIBS}) + target_link_libraries(${PROJECT_NAME} PRIVATE nfd) ++target_link_libraries(${PROJECT_NAME} PUBLIC SimpleIni::SimpleIni) + + # setup the same API exports for imgui + target_compile_definitions(${PROJECT_NAME} PUBLIC IMGUI_API=SOFAIMGUI_API) +diff --git a/SofaImGui/SofaImGuiConfig.cmake.in b/SofaImGui/SofaImGuiConfig.cmake.in +index cfc50d5..11e228d 100644 +--- a/SofaImGui/SofaImGuiConfig.cmake.in ++++ b/SofaImGui/SofaImGuiConfig.cmake.in +@@ -6,6 +6,10 @@ + find_package(SofaGLFW REQUIRED) + find_package(Sofa.GL.Component.Rendering3D REQUIRED) + ++if(NOT TARGET SimpleIni::SimpleIni) ++ sofa_find_package(SimpleIni QUIET REQUIRED) ++endif() ++ + if(NOT TARGET @PROJECT_NAME@) + include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") + endif() +diff --git a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp +index 545f28b..799fe09 100644 +--- a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp ++++ b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp +@@ -24,6 +24,7 @@ + #include + #include + #include ++#include + #include + + #include +@@ -756,8 +757,9 @@ void ImGuiGUIEngine::endFrame() + std::setlocale(LC_NUMERIC, m_localeBackup.c_str()); + } + +-void ImGuiGUIEngine::resetView(ImGuiID dockspace_id, const char* windowNameSceneGraph, const char *windowNameLog, const char *windowNameViewport) ++void ImGuiGUIEngine::resetView(_ImGuiID dockspace_id, const char* windowNameSceneGraph, const char *windowNameLog, const char *windowNameViewport) + { ++ static_assert(std::is_same<_ImGuiID, ImGuiID>::value, "_ImGuiID and ImGuiID types must be identical. _ImGuiID must be adjusted."); + ImGuiViewport* viewport = ImGui::GetMainViewport(); + + ImGui::DockBuilderRemoveNode(dockspace_id); // clear any previous layout +diff --git a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h +index dac1e67..ee1e2f7 100644 +--- a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h ++++ b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h +@@ -29,7 +29,6 @@ + #include "guis/AdditionalGUIRegistry.h" + #include "windows/WindowState.h" + #include +-#include + #include + + using windows::WindowState; +@@ -74,7 +73,9 @@ protected: + bool isMouseOnViewport { false }; + CSimpleIniA ini; + void loadFile(sofaglfw::SofaGLFWBaseGUI* baseGUI, sofa::core::sptr& groot, std::string filePathName, bool reload = false); +- void resetView(ImGuiID dockspace_id, const char *windowNameSceneGraph, const char *windowNameLog, const char *windowNameViewport) ; ++ ++ using _ImGuiID = unsigned int; ++ void resetView(_ImGuiID dockspace_id, const char *windowNameSceneGraph, const char *windowNameLog, const char *windowNameViewport) ; + + // WindowState members + windows::WindowState winManagerProfiler; +diff --git a/SofaImGui/src/SofaImGui/widgets/ScalarWidget.cpp b/SofaImGui/src/SofaImGui/widgets/ScalarWidget.cpp +new file mode 100644 +index 0000000..9362260 +--- /dev/null ++++ b/SofaImGui/src/SofaImGui/widgets/ScalarWidget.cpp +@@ -0,0 +1,39 @@ ++/****************************************************************************** ++* SOFA, Simulation Open-Framework Architecture * ++* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * ++* * ++* This program is free software; you can redistribute it and/or modify it * ++* under the terms of the GNU General Public License as published by the Free * ++* Software Foundation; either version 2 of the License, or (at your option) * ++* any later version. * ++* * ++* This program is distributed in the hope that it will be useful, but WITHOUT * ++* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * ++* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * ++* more details. * ++* * ++* You should have received a copy of the GNU General Public License along * ++* with this program. If not, see . * ++******************************************************************************* ++* Authors: The SOFA Team and external contributors (see Authors.txt) * ++* * ++* Contact information: contact@sofa-framework.org * ++******************************************************************************/ ++#pragma once ++#include ++#include ++ ++namespace sofaimgui ++{ ++ ++bool showScalarWidget(const std::string& label, const std::string& id, float& value) ++{ ++ return ImGui::InputFloat((label + "##" + id).c_str(), &value, 0.0f, 0.0f, "%.8f", ImGuiInputTextFlags_None); ++} ++ ++bool showScalarWidget(const std::string& label, const std::string& id, double& value) ++{ ++ return ImGui::InputDouble((label + "##" + id).c_str(), &value, 0.0f, 0.0f, "%.8f", ImGuiInputTextFlags_None); ++} ++ ++} +diff --git a/SofaImGui/src/SofaImGui/widgets/ScalarWidget.h b/SofaImGui/src/SofaImGui/widgets/ScalarWidget.h +index e7b4e9e..bb1c63a 100644 +--- a/SofaImGui/src/SofaImGui/widgets/ScalarWidget.h ++++ b/SofaImGui/src/SofaImGui/widgets/ScalarWidget.h +@@ -21,20 +21,13 @@ + ******************************************************************************/ + #pragma once + #include +-#include + + namespace sofaimgui + { + +-inline bool showScalarWidget(const std::string& label, const std::string& id, float& value) +-{ +- return ImGui::InputFloat((label + "##" + id).c_str(), &value, 0.0f, 0.0f, "%.8f", ImGuiInputTextFlags_None); +-} ++inline bool showScalarWidget(const std::string& label, const std::string& id, float& value); + +-inline bool showScalarWidget(const std::string& label, const std::string& id, double& value) +-{ +- return ImGui::InputDouble((label + "##" + id).c_str(), &value, 0.0f, 0.0f, "%.8f", ImGuiInputTextFlags_None); +-} ++inline bool showScalarWidget(const std::string& label, const std::string& id, double& value); + + template + void showScalarWidget(sofa::Data& data) +diff --git a/SofaImGui/src/SofaImGui/windows/Log.h b/SofaImGui/src/SofaImGui/windows/Log.h +index 0a70b65..77a75af 100644 +--- a/SofaImGui/src/SofaImGui/windows/Log.h ++++ b/SofaImGui/src/SofaImGui/windows/Log.h +@@ -27,9 +27,7 @@ + #include + #include + +-#include + #include +-#include + #include "WindowState.h" + + +diff --git a/SofaImGui/src/SofaImGui/windows/Performances.h b/SofaImGui/src/SofaImGui/windows/Performances.h +index b320c4e..1d0e499 100644 +--- a/SofaImGui/src/SofaImGui/windows/Performances.h ++++ b/SofaImGui/src/SofaImGui/windows/Performances.h +@@ -30,7 +30,6 @@ + + #include + #include +-#include + #include "WindowState.h" + + +diff --git a/SofaImGui/src/SofaImGui/windows/Profiler.h b/SofaImGui/src/SofaImGui/windows/Profiler.h +index ac843b6..7ee088a 100644 +--- a/SofaImGui/src/SofaImGui/windows/Profiler.h ++++ b/SofaImGui/src/SofaImGui/windows/Profiler.h +@@ -28,9 +28,7 @@ + #include + #include + +-#include + #include +-#include + #include "WindowState.h" + + +diff --git a/SofaImGui/src/SofaImGui/windows/Settings.h b/SofaImGui/src/SofaImGui/windows/Settings.h +index 5a8e039..cb52c2e 100644 +--- a/SofaImGui/src/SofaImGui/windows/Settings.h ++++ b/SofaImGui/src/SofaImGui/windows/Settings.h +@@ -23,6 +23,7 @@ + + #include + #include "WindowState.h" ++#include + + namespace sofaimgui + { +diff --git a/SofaImGui/src/SofaImGui/windows/ViewPort.h b/SofaImGui/src/SofaImGui/windows/ViewPort.h +index c1fd42c..30cf947 100644 +--- a/SofaImGui/src/SofaImGui/windows/ViewPort.h ++++ b/SofaImGui/src/SofaImGui/windows/ViewPort.h +@@ -23,6 +23,7 @@ + + #include + #include "WindowState.h" ++#include + + namespace windows + { +-- +2.43.0 + diff --git a/recipes/sofa-glfw/patches/0002-hide-SimpleIni-to-impl-and-do-not-expose-private-hea.patch b/recipes/sofa-glfw/patches/0002-hide-SimpleIni-to-impl-and-do-not-expose-private-hea.patch new file mode 100644 index 0000000000000..3dbad68a54879 --- /dev/null +++ b/recipes/sofa-glfw/patches/0002-hide-SimpleIni-to-impl-and-do-not-expose-private-hea.patch @@ -0,0 +1,305 @@ +From 8851eec4388ea81725edd8f56ac9af37139c5a5b Mon Sep 17 00:00:00 2001 +From: Olivier Roussel +Date: Wed, 7 Jan 2026 17:44:00 +0100 +Subject: [PATCH] hide SimpleIni to impl and do not expose private headers + ViewPort.h and Settings.h + +do not expose Performances.h header as it includes imgui + +fix SimpleIni target as private + +fix imgui headers are not part of SofaImGui anymore, must be treated as dependency +--- + SofaImGui/CMakeLists.txt | 5 +- + SofaImGui/SofaImGuiConfig.cmake.in | 4 -- + .../SofaImGui.Camera/CMakeLists.txt | 11 ++++ + SofaImGui/src/SofaImGui/AppIniFile.cpp | 1 - + SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp | 65 +++++++++++-------- + SofaImGui/src/SofaImGui/ImGuiGUIEngine.h | 8 ++- + 6 files changed, 54 insertions(+), 40 deletions(-) + +diff --git a/SofaImGui/CMakeLists.txt b/SofaImGui/CMakeLists.txt +index 74fa7fd..33bab61 100644 +--- a/SofaImGui/CMakeLists.txt ++++ b/SofaImGui/CMakeLists.txt +@@ -99,7 +99,6 @@ set(HEADER_FILES + ${SOFAIMGUI_SOURCE_DIR}/widgets/LinearSpringWidget.h + ${SOFAIMGUI_SOURCE_DIR}/widgets/MaterialWidget.h + ${SOFAIMGUI_SOURCE_DIR}/widgets/ScalarWidget.h +- ${SOFAIMGUI_SOURCE_DIR}/windows/Performances.h + ${SOFAIMGUI_SOURCE_DIR}/windows/Log.h + ${SOFAIMGUI_SOURCE_DIR}/windows/MouseManager.h + ${SOFAIMGUI_SOURCE_DIR}/windows/Profiler.h +@@ -107,8 +106,6 @@ set(HEADER_FILES + ${SOFAIMGUI_SOURCE_DIR}/windows/DisplayFlags.h + ${SOFAIMGUI_SOURCE_DIR}/windows/Plugins.h + ${SOFAIMGUI_SOURCE_DIR}/windows/Components.h +- ${SOFAIMGUI_SOURCE_DIR}/windows/Settings.h +- ${SOFAIMGUI_SOURCE_DIR}/windows/ViewPort.h + ${SOFAIMGUI_SOURCE_DIR}/AppIniFile.h + ${SOFAIMGUI_SOURCE_DIR}/windows/WindowState.h + ${SOFAIMGUI_SOURCE_DIR}/guis/BaseAdditionalGUI.h +@@ -148,7 +145,7 @@ add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${IMGUI_SOURC + target_include_directories(${PROJECT_NAME} PUBLIC "$") + target_link_libraries(${PROJECT_NAME} PUBLIC SofaGLFW Sofa.GL.Component.Rendering3D ${CMAKE_DL_LIBS}) + target_link_libraries(${PROJECT_NAME} PRIVATE nfd) +-target_link_libraries(${PROJECT_NAME} PUBLIC SimpleIni::SimpleIni) ++target_link_libraries(${PROJECT_NAME} PRIVATE SimpleIni::SimpleIni) + + # setup the same API exports for imgui + target_compile_definitions(${PROJECT_NAME} PUBLIC IMGUI_API=SOFAIMGUI_API) +diff --git a/SofaImGui/SofaImGuiConfig.cmake.in b/SofaImGui/SofaImGuiConfig.cmake.in +index 11e228d..cfc50d5 100644 +--- a/SofaImGui/SofaImGuiConfig.cmake.in ++++ b/SofaImGui/SofaImGuiConfig.cmake.in +@@ -6,10 +6,6 @@ + find_package(SofaGLFW REQUIRED) + find_package(Sofa.GL.Component.Rendering3D REQUIRED) + +-if(NOT TARGET SimpleIni::SimpleIni) +- sofa_find_package(SimpleIni QUIET REQUIRED) +-endif() +- + if(NOT TARGET @PROJECT_NAME@) + include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") + endif() +diff --git a/SofaImGui/extensions/SofaImGui.Camera/CMakeLists.txt b/SofaImGui/extensions/SofaImGui.Camera/CMakeLists.txt +index d287caa..31a9872 100644 +--- a/SofaImGui/extensions/SofaImGui.Camera/CMakeLists.txt ++++ b/SofaImGui/extensions/SofaImGui.Camera/CMakeLists.txt +@@ -5,6 +5,14 @@ project(SofaImGui.Camera VERSION 1.0 LANGUAGES CXX) + find_package(Sofa.Config REQUIRED) + sofa_find_package(SofaImGui REQUIRED) + ++include(FetchContent) ++ ++FetchContent_Declare(imgui ++ GIT_REPOSITORY https://github.com/ocornut/imgui ++ GIT_TAG 11b3a7c8ca23201294464c7f368614a9106af2a1 # v1.91.8-docking ++) ++FetchContent_MakeAvailable(imgui) ++ + set(HEADER_FILES + src/SofaImGui.Camera/config.h.in + src/SofaImGui.Camera/init.h +@@ -18,7 +26,10 @@ set(SOURCE_FILES + src/SofaImGui.Camera/CameraGUI.cpp + ) + ++set(IMGUI_SOURCE_DIR ${imgui_SOURCE_DIR}) ++ + add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) ++target_include_directories(${PROJECT_NAME} PUBLIC "$") + target_link_libraries(${PROJECT_NAME} PUBLIC SofaImGui) + + sofa_create_package_with_targets( +diff --git a/SofaImGui/src/SofaImGui/AppIniFile.cpp b/SofaImGui/src/SofaImGui/AppIniFile.cpp +index 4058b95..b5c5829 100644 +--- a/SofaImGui/src/SofaImGui/AppIniFile.cpp ++++ b/SofaImGui/src/SofaImGui/AppIniFile.cpp +@@ -23,7 +23,6 @@ + #include + #include + #include +-#include "windows/Performances.h" + #include "AppIniFile.h" + + +diff --git a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp +index 799fe09..1d6807c 100644 +--- a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp ++++ b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp +@@ -70,6 +70,7 @@ + #include //imgui_internal.h is included in order to use the DockspaceBuilder API (which is still in development) + #include + #include ++#include + #include + #include + #include +@@ -90,6 +91,11 @@ using namespace sofa; + namespace sofaimgui + { + ++struct ImGuiGUIEngine::Settings ++{ ++ CSimpleIniA ini; ++}; ++ + ImGuiGUIEngine::ImGuiGUIEngine() + : winManagerProfiler(helper::system::FileSystem::append(sofaimgui::getConfigurationFolderPath(), std::string("profiler.txt"))) + , winManagerSceneGraph(helper::system::FileSystem::append(sofaimgui::getConfigurationFolderPath(), std::string("scenegraph.txt"))) +@@ -106,6 +112,9 @@ ImGuiGUIEngine::ImGuiGUIEngine() + { + } + ++ImGuiGUIEngine::~ImGuiGUIEngine() ++{} ++ + void ImGuiGUIEngine::init() + { + IMGUI_CHECKVERSION(); +@@ -124,22 +133,21 @@ void ImGuiGUIEngine::init() + io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; + io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; + +- +- +- ini.SetUnicode(); ++ settings = std::make_unique(); ++ settings->ini.SetUnicode(); + if (sofa::helper::system::FileSystem::exists(sofaimgui::AppIniFile::getAppIniFile())) + { +- SI_Error rc = ini.LoadFile(sofaimgui::AppIniFile::getAppIniFile().c_str()); ++ SI_Error rc = settings->ini.LoadFile(sofaimgui::AppIniFile::getAppIniFile().c_str()); + assert(rc == SI_OK); + msg_info("ImGuiGUIEngine") << "Fetching settings from " << sofaimgui::AppIniFile::getAppIniFile(); + } + + const char* pv; +- pv = ini.GetValue("Style", "theme"); ++ pv = settings->ini.GetValue("Style", "theme"); + if (!pv) + { +- ini.SetValue("Style", "theme", sofaimgui::defaultStyle.c_str(), ini::styleDescription); +- SI_Error rc = ini.SaveFile(sofaimgui::AppIniFile::getAppIniFile().c_str()); ++ settings->ini.SetValue("Style", "theme", sofaimgui::defaultStyle.c_str(), ini::styleDescription); ++ SI_Error rc = settings->ini.SaveFile(sofaimgui::AppIniFile::getAppIniFile().c_str()); + if (rc != SI_OK) + { + msg_error("ImGuiGUIEngine") << std::strerror(errno) << "'" << sofaimgui::AppIniFile::getAppIniFile() << "'"; +@@ -189,18 +197,18 @@ void ImGuiGUIEngine::initBackend(GLFWwindow* glfwWindow) + io.Fonts->AddFontFromMemoryCompressedTTF(FA_SOLID_900_compressed_data, FA_SOLID_900_compressed_size, 16 * yscale, &config, icon_ranges); + + // restore the global scale stored in the Settings ini file +- const float globalScale = static_cast(ini.GetDoubleValue("Visualization", "globalScale", 1.0)); ++ const float globalScale = static_cast(settings->ini.GetDoubleValue("Visualization", "globalScale", 1.0)); + this->setScale(globalScale, windowMonitor); + } + + // restore window settings if set +- const bool rememberWindowPosition = ini.GetBoolValue("Window", "rememberWindowPosition", true); ++ const bool rememberWindowPosition = settings->ini.GetBoolValue("Window", "rememberWindowPosition", true); + if(rememberWindowPosition) + { +- if(ini.KeyExists("Window", "windowPosX") && ini.KeyExists("Window", "windowPosY")) ++ if(settings->ini.KeyExists("Window", "windowPosX") && settings->ini.KeyExists("Window", "windowPosY")) + { +- const long windowPosX = ini.GetLongValue("Window", "windowPosX"); +- const long windowPosY = ini.GetLongValue("Window", "windowPosY"); ++ const long windowPosX = settings->ini.GetLongValue("Window", "windowPosX"); ++ const long windowPosY = settings->ini.GetLongValue("Window", "windowPosY"); + + int monitorCount; + GLFWmonitor** monitors = glfwGetMonitors(&monitorCount); +@@ -247,13 +255,13 @@ void ImGuiGUIEngine::initBackend(GLFWwindow* glfwWindow) + + } + +- const bool rememberWindowSize = ini.GetBoolValue("Window", "rememberWindowSize", true); ++ const bool rememberWindowSize = settings->ini.GetBoolValue("Window", "rememberWindowSize", true); + if(rememberWindowSize) + { +- if(ini.KeyExists("Window", "windowSizeX") && ini.KeyExists("Window", "windowSizeY")) ++ if(settings->ini.KeyExists("Window", "windowSizeX") && settings->ini.KeyExists("Window", "windowSizeY")) + { +- const long windowSizeX = ini.GetLongValue("Window", "windowSizeX"); +- const long windowSizeY = ini.GetLongValue("Window", "windowSizeY"); ++ const long windowSizeX = settings->ini.GetLongValue("Window", "windowSizeX"); ++ const long windowSizeY = settings->ini.GetLongValue("Window", "windowSizeY"); + if(windowSizeX > 0 && windowSizeY > 0) + { + glfwSetWindowSize(glfwWindow, static_cast(windowSizeX), static_cast(windowSizeY)); +@@ -313,7 +321,7 @@ void ImGuiGUIEngine::startFrame(sofaglfw::SofaGLFWBaseGUI* baseGUI) + + auto groot = baseGUI->getRootNode(); + +- bool alwaysShowFrame = ini.GetBoolValue("Visualization", "alwaysShowFrame", true); ++ bool alwaysShowFrame = settings->ini.GetBoolValue("Visualization", "alwaysShowFrame", true); + if (alwaysShowFrame) + { + auto sceneFrame = groot->get(); +@@ -671,9 +679,9 @@ void ImGuiGUIEngine::startFrame(sofaglfw::SofaGLFWBaseGUI* baseGUI) + /*************************************** + * Viewport window + **************************************/ +- showViewPort(groot, windowNameViewport, ini, m_fbo, m_viewportWindowSize, +- isMouseOnViewport, winManagerViewPort, baseGUI, +- isViewportDisplayedForTheFirstTime, lastViewPortPos); ++ showViewPort(groot, windowNameViewport, settings->ini, m_fbo, m_viewportWindowSize, ++ isMouseOnViewport, winManagerViewPort, baseGUI, ++ isViewportDisplayedForTheFirstTime, lastViewPortPos); + + + /*************************************** +@@ -731,7 +739,7 @@ void ImGuiGUIEngine::startFrame(sofaglfw::SofaGLFWBaseGUI* baseGUI) + /*************************************** + * Settings window + **************************************/ +- windows::showSettings(windowNameSettings,ini, winManagerSettings, this); ++ windows::showSettings(windowNameSettings, settings->ini, winManagerSettings, this); + + ImGui::Render(); + #if SOFAIMGUI_FORCE_OPENGL2 == 1 +@@ -815,17 +823,18 @@ void ImGuiGUIEngine::afterDraw() + + void ImGuiGUIEngine::terminate() + { ++ + // store window state (position and size) + const auto lastWindowPos = ImGui::GetMainViewport()->Pos; + const auto lastWindowSize = ImGui::GetMainViewport()->Size; +- ++ + // save latest window state +- ini.SetLongValue("Window", "windowPosX", static_cast(lastWindowPos.x)); +- ini.SetLongValue("Window", "windowPosY", static_cast(lastWindowPos.y)); +- ini.SetLongValue("Window", "windowSizeX", static_cast(lastWindowSize.x)); +- ini.SetLongValue("Window", "windowSizeY", static_cast(lastWindowSize.y)); +- [[maybe_unused]] SI_Error rc = ini.SaveFile(sofaimgui::AppIniFile::getAppIniFile().c_str()); +- ++ settings->ini.SetLongValue("Window", "windowPosX", static_cast(lastWindowPos.x)); ++ settings->ini.SetLongValue("Window", "windowPosY", static_cast(lastWindowPos.y)); ++ settings->ini.SetLongValue("Window", "windowSizeX", static_cast(lastWindowSize.x)); ++ settings->ini.SetLongValue("Window", "windowSizeY", static_cast(lastWindowSize.y)); ++ [[maybe_unused]] SI_Error rc = settings->ini.SaveFile(sofaimgui::AppIniFile::getAppIniFile().c_str()); ++ + NFD_Quit(); + + #if SOFAIMGUI_FORCE_OPENGL2 == 1 +diff --git a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h +index ee1e2f7..802d6d5 100644 +--- a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h ++++ b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h +@@ -28,7 +28,6 @@ + + #include "guis/AdditionalGUIRegistry.h" + #include "windows/WindowState.h" +-#include + #include + + using windows::WindowState; +@@ -49,7 +48,7 @@ class ImGuiGUIEngine : public sofaglfw::BaseGUIEngine + public: + + ImGuiGUIEngine() ; +- ~ImGuiGUIEngine() = default; ++ ~ImGuiGUIEngine(); + + void init() override; + void initBackend(GLFWwindow*) override; +@@ -71,7 +70,10 @@ protected: + std::pair m_currentFBOSize; + std::pair m_viewportWindowSize; + bool isMouseOnViewport { false }; +- CSimpleIniA ini; ++ ++ struct Settings; ++ std::unique_ptr settings; ++ + void loadFile(sofaglfw::SofaGLFWBaseGUI* baseGUI, sofa::core::sptr& groot, std::string filePathName, bool reload = false); + + using _ImGuiID = unsigned int; +-- +2.43.0 + diff --git a/recipes/sofa-glfw/patches/0003-fix-SofaGLFW-cmake-config-in-with-missing-gflw.patch b/recipes/sofa-glfw/patches/0003-fix-SofaGLFW-cmake-config-in-with-missing-gflw.patch new file mode 100644 index 0000000000000..811dcdb383794 --- /dev/null +++ b/recipes/sofa-glfw/patches/0003-fix-SofaGLFW-cmake-config-in-with-missing-gflw.patch @@ -0,0 +1,26 @@ +From 7723f10811a80258983132bf8b372475cb3401a5 Mon Sep 17 00:00:00 2001 +From: Olivier Roussel +Date: Fri, 9 Jan 2026 14:03:36 +0100 +Subject: [PATCH] fix SofaGLFW cmake config in with missing gflw + +--- + SofaGLFW/SofaGLFWConfig.cmake.in | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/SofaGLFW/SofaGLFWConfig.cmake.in b/SofaGLFW/SofaGLFWConfig.cmake.in +index 009e4de..b84ca58 100644 +--- a/SofaGLFW/SofaGLFWConfig.cmake.in ++++ b/SofaGLFW/SofaGLFWConfig.cmake.in +@@ -8,6 +8,9 @@ find_package(Sofa.Simulation.Graph REQUIRED) + find_package(Sofa.GL REQUIRED) + find_package(Sofa.Component.Visual REQUIRED) + find_package(Sofa.GUI.Common QUIET) ++if(NOT TARGET glfw) ++ sofa_find_package(glfw3 QUIET REQUIRED) ++endif() + + if(NOT TARGET @PROJECT_NAME@) + include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") +-- +2.43.0 + diff --git a/recipes/sofa-glfw/recipe.yaml b/recipes/sofa-glfw/recipe.yaml index 5fccf20722a63..899600532ab12 100644 --- a/recipes/sofa-glfw/recipe.yaml +++ b/recipes/sofa-glfw/recipe.yaml @@ -11,8 +11,21 @@ source: url: https://github.com/sofa-framework/SofaGLFW/archive/refs/tags/release-v${{ major_minor }}.tar.gz sha256: 97aac0871967495f5002d0a43cd0374772c8ea72adbfaa3be4e9431f5d056297 + patches: + # For the 3 following patches: + # https://github.com/sofa-framework/SofaGLFW/pull/256 + - patches/0001-remove-imgui.h-from-ImgGuiGUIEngine-header.patch + - patches/0002-hide-SimpleIni-to-impl-and-do-not-expose-private-hea.patch + - patches/0003-fix-SofaGLFW-cmake-config-in-with-missing-gflw.patch + build: number: 0 + files: + # SimpleIni (header-only) is still fetched and used for compilation only, but + # its CMakeLists force installation even if we do not want to include it in our package + exclude: + - ${{ "Library/" if win }}include/SimpleIni/ + - ${{ "Library/" if win }}share/cmake/SimpleIni/ requirements: build: From 6d6ce2cce4559508959216f14223bad86979b430 Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Sat, 10 Jan 2026 09:43:41 +0100 Subject: [PATCH 03/13] add 3rd party licenses for sofa-glfw --- .../IconFontCppHeaders/LICENSE.txt | 17 +++++++++++++++ .../3rdparty-licenses/imgui/LICENSE.txt | 21 +++++++++++++++++++ .../3rdparty-licenses/implot/LICENSE.txt | 21 +++++++++++++++++++ .../3rdparty-licenses/simpleini/LICENSE.txt | 20 ++++++++++++++++++ recipes/sofa-glfw/recipe.yaml | 9 +++++++- 5 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 recipes/sofa-glfw/3rdparty-licenses/IconFontCppHeaders/LICENSE.txt create mode 100644 recipes/sofa-glfw/3rdparty-licenses/imgui/LICENSE.txt create mode 100644 recipes/sofa-glfw/3rdparty-licenses/implot/LICENSE.txt create mode 100644 recipes/sofa-glfw/3rdparty-licenses/simpleini/LICENSE.txt diff --git a/recipes/sofa-glfw/3rdparty-licenses/IconFontCppHeaders/LICENSE.txt b/recipes/sofa-glfw/3rdparty-licenses/IconFontCppHeaders/LICENSE.txt new file mode 100644 index 0000000000000..59ec22bb16950 --- /dev/null +++ b/recipes/sofa-glfw/3rdparty-licenses/IconFontCppHeaders/LICENSE.txt @@ -0,0 +1,17 @@ +Copyright (c) 2017 Juliette Foucaut and Doug Binks + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. diff --git a/recipes/sofa-glfw/3rdparty-licenses/imgui/LICENSE.txt b/recipes/sofa-glfw/3rdparty-licenses/imgui/LICENSE.txt new file mode 100644 index 0000000000000..d5ba3155f0f43 --- /dev/null +++ b/recipes/sofa-glfw/3rdparty-licenses/imgui/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2026 Omar Cornut + +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. diff --git a/recipes/sofa-glfw/3rdparty-licenses/implot/LICENSE.txt b/recipes/sofa-glfw/3rdparty-licenses/implot/LICENSE.txt new file mode 100644 index 0000000000000..3995ef7c57512 --- /dev/null +++ b/recipes/sofa-glfw/3rdparty-licenses/implot/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Evan Pezent + +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. diff --git a/recipes/sofa-glfw/3rdparty-licenses/simpleini/LICENSE.txt b/recipes/sofa-glfw/3rdparty-licenses/simpleini/LICENSE.txt new file mode 100644 index 0000000000000..405d417296aea --- /dev/null +++ b/recipes/sofa-glfw/3rdparty-licenses/simpleini/LICENSE.txt @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2006-2024 Brodie Thiesfield + +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. diff --git a/recipes/sofa-glfw/recipe.yaml b/recipes/sofa-glfw/recipe.yaml index 899600532ab12..605f988fccb27 100644 --- a/recipes/sofa-glfw/recipe.yaml +++ b/recipes/sofa-glfw/recipe.yaml @@ -72,7 +72,14 @@ about: homepage: https://github.com/sofa-framework/SofaGLFW summary: Quick and simple GUI for SOFA, based on GLFW and Dear ImGui (runtime only). license: LGPL-3.0-or-later - license_file: LICENSE + license_file: + - LICENSE + - 3rdparty-licenses/IconFontCppHeaders/LICENSE.txt # ZLIB + - 3rdparty-licenses/imgui/LICENSE.txt # MIT + - 3rdparty-licenses/implot/LICENSE.txt # MIT + # https://github.com/conda-forge/staged-recipes/pull/31757 + # If merged, we could unvendor simpleini and use the package + - 3rdparty-licenses/simpleini/LICENSE.txt # MIT repository: https://github.com/sofa-framework/SofaGLFW extra: From ef49497e4080feba26c029bb28ffb24b53c613af Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Sat, 10 Jan 2026 10:21:05 +0100 Subject: [PATCH 04/13] update homepages --- recipes/sofa-beamadapter/recipe.yaml | 2 +- recipes/sofa-glfw/recipe.yaml | 4 ++-- recipes/sofa-modelorderreduction/recipe.yaml | 2 +- recipes/sofa-softrobots/recipe.yaml | 4 ++-- recipes/sofa-softrobotsinverse/recipe.yaml | 4 ++-- recipes/sofa-stlib/recipe.yaml | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/recipes/sofa-beamadapter/recipe.yaml b/recipes/sofa-beamadapter/recipe.yaml index f88d33cd5daf8..fe588a0558316 100644 --- a/recipes/sofa-beamadapter/recipe.yaml +++ b/recipes/sofa-beamadapter/recipe.yaml @@ -44,7 +44,7 @@ tests: - ${{ compiler('cxx') }} about: - homepage: https://www.sofa-framework.org/applications/marketplace/beamadapter/ + homepage: https://www.sofa-framework.org/applications/plugins/timoshenko-beam-catheters/ summary: Plugin implementing Kirchhoff rods to simulate any 1D flexible structure. license: LGPL-2.1-or-later license_file: LICENSE.md diff --git a/recipes/sofa-glfw/recipe.yaml b/recipes/sofa-glfw/recipe.yaml index 605f988fccb27..f08b441a68e26 100644 --- a/recipes/sofa-glfw/recipe.yaml +++ b/recipes/sofa-glfw/recipe.yaml @@ -69,8 +69,8 @@ tests: - ${{ compiler('cxx') }} about: - homepage: https://github.com/sofa-framework/SofaGLFW - summary: Quick and simple GUI for SOFA, based on GLFW and Dear ImGui (runtime only). + homepage: https://www.sofa-framework.org/applications/plugins/modern-gui-using-glfw/ + summary: Quick and simple GUI for SOFA, based on GLFW and Dear ImGui. license: LGPL-3.0-or-later license_file: - LICENSE diff --git a/recipes/sofa-modelorderreduction/recipe.yaml b/recipes/sofa-modelorderreduction/recipe.yaml index ffc81933c4514..280f86cb32ced 100644 --- a/recipes/sofa-modelorderreduction/recipe.yaml +++ b/recipes/sofa-modelorderreduction/recipe.yaml @@ -55,7 +55,7 @@ tests: - mor about: - homepage: https://www.sofa-framework.org/applications/marketplace/modelorderreduction/ + homepage: https://www.sofa-framework.org/applications/plugins/model-order-reduction/ summary: SOFA plugin to reduce model. license: GPL-2.0-or-later license_file: LICENSE diff --git a/recipes/sofa-softrobots/recipe.yaml b/recipes/sofa-softrobots/recipe.yaml index c1953eecc5f91..6894ea5885c2f 100644 --- a/recipes/sofa-softrobots/recipe.yaml +++ b/recipes/sofa-softrobots/recipe.yaml @@ -60,8 +60,8 @@ tests: - softrobots about: - homepage: https://project.inria.fr/softrobot/ - summary: Sofa plugin containing components & method for soft robotics. + homepage: https://www.sofa-framework.org/applications/plugins/softrobots/ + summary: SOFA plugin containing components & method for soft robotics. license: LGPL-3.0-or-later license_file: LICENSE documentation: https://softrobots.readthedocs.io/ diff --git a/recipes/sofa-softrobotsinverse/recipe.yaml b/recipes/sofa-softrobotsinverse/recipe.yaml index a0e836d4ab476..7c15376f4d89d 100644 --- a/recipes/sofa-softrobotsinverse/recipe.yaml +++ b/recipes/sofa-softrobotsinverse/recipe.yaml @@ -57,8 +57,8 @@ tests: - ${{ compiler('cxx') }} about: - homepage: https://github.com/SofaDefrost/SoftRobots.Inverse - summary: Sofa plugin containing inverse method for soft robotics. + homepage: https://www.sofa-framework.org/applications/plugins/inverse-model-for-soft-robot-control/ + summary: SOFA plugin containing inverse control method for soft robotics. license: AGPL-3.0-only license_file: - LICENSE.AGPLV3.txt diff --git a/recipes/sofa-stlib/recipe.yaml b/recipes/sofa-stlib/recipe.yaml index 15922cd666253..6c4ba05b3af7b 100644 --- a/recipes/sofa-stlib/recipe.yaml +++ b/recipes/sofa-stlib/recipe.yaml @@ -53,8 +53,8 @@ tests: - stlib3 about: - homepage: https://github.com/SofaDefrost/STLIB - summary: Sofa Template Library containing Sofa scenes templates. + homepage: https://www.sofa-framework.org/applications/plugins/python-template-scenes/ + summary: SOFA Template Library containing SOFA scenes templates. license: LGPL-3.0-or-later license_file: LICENSE documentation: https://stlib.readthedocs.io/ From ec5a5fc0e0b795d68a02d34fe79377648ead64f3 Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Sat, 10 Jan 2026 11:46:52 +0100 Subject: [PATCH 05/13] fix missing Ninja generator on unix --- recipes/sofa-app/build.sh | 3 +++ recipes/sofa-beamadapter/build.sh | 1 + recipes/sofa-cosserat/build.sh | 1 + recipes/sofa-glfw/build.bat | 1 + recipes/sofa-glfw/build.sh | 4 +++- recipes/sofa-modelorderreduction/build.sh | 1 + recipes/sofa-python3/build.sh | 1 + recipes/sofa-softrobots/build.sh | 1 + recipes/sofa-softrobotsinverse/build.sh | 1 + recipes/sofa-stlib/build.sh | 1 + 10 files changed, 14 insertions(+), 1 deletion(-) diff --git a/recipes/sofa-app/build.sh b/recipes/sofa-app/build.sh index 7529d78726866..8c013c54c45b3 100644 --- a/recipes/sofa-app/build.sh +++ b/recipes/sofa-app/build.sh @@ -21,6 +21,7 @@ cd build-scene-checking cmake ${CMAKE_ARGS} \ -B . \ -S ../applications/projects/SceneChecking/ \ + -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DSCENECHECKING_BUILD_TESTS=OFF \ -DCMAKE_INSTALL_RPATH:PATH=${PREFIX}/lib @@ -46,6 +47,7 @@ cd build-sofa-app cmake ${CMAKE_ARGS} \ -B . \ -S ../applications/projects/runSofa/ \ + -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_RPATH:PATH=${PREFIX}/lib @@ -76,6 +78,7 @@ cd build-sofa-examples cmake ${CMAKE_ARGS} \ -B . \ -S ../examples/ \ + -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release # build diff --git a/recipes/sofa-beamadapter/build.sh b/recipes/sofa-beamadapter/build.sh index c663d8a125398..3df257b84ec40 100644 --- a/recipes/sofa-beamadapter/build.sh +++ b/recipes/sofa-beamadapter/build.sh @@ -14,6 +14,7 @@ cd build cmake ${CMAKE_ARGS} \ -B. \ -S .. \ + -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DBEAMADAPTER_BUILD_TESTS:BOOL=OFF diff --git a/recipes/sofa-cosserat/build.sh b/recipes/sofa-cosserat/build.sh index 07504ec995633..94860a3a58de0 100644 --- a/recipes/sofa-cosserat/build.sh +++ b/recipes/sofa-cosserat/build.sh @@ -14,6 +14,7 @@ cd build cmake ${CMAKE_ARGS} \ -B . \ -S .. \ + -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ -DSP3_PYTHON_PACKAGES_DIRECTORY:PATH=python${PY_VER}/site-packages \ diff --git a/recipes/sofa-glfw/build.bat b/recipes/sofa-glfw/build.bat index 8b385141ac2d5..859738b9c64f7 100644 --- a/recipes/sofa-glfw/build.bat +++ b/recipes/sofa-glfw/build.bat @@ -29,6 +29,7 @@ mkdir build-test cmake %CMAKE_ARGS% ^ -B build-test ^ -S %SRC_DIR%\SofaImGui\extensions\SofaImGui.Camera ^ + -G Ninja ^ -DCMAKE_VERBOSE_MAKEFILE=ON if errorlevel 1 exit 1 diff --git a/recipes/sofa-glfw/build.sh b/recipes/sofa-glfw/build.sh index 1a2b144251e63..ddedbc2e8824e 100644 --- a/recipes/sofa-glfw/build.sh +++ b/recipes/sofa-glfw/build.sh @@ -14,6 +14,7 @@ cd build cmake ${CMAKE_ARGS} \ -B . \ -S .. \ + -G Ninja \ -DPLUGIN_SOFAGLFW:BOOL=ON \ -DPLUGIN_SOFAIMGUI:BOOL=ON \ -DCMAKE_BUILD_TYPE:STRING=Release \ @@ -32,7 +33,8 @@ if [[ $CONDA_BUILD_CROSS_COMPILATION != 1 ]]; then mkdir build-test cmake ${CMAKE_ARGS} \ -B build-test \ - -S SofaImGui/extensions/SofaImGui.Camera + -S SofaImGui/extensions/SofaImGui.Camera \ + -G Ninja cmake --build build-test --parallel ${CPU_COUNT} fi \ No newline at end of file diff --git a/recipes/sofa-modelorderreduction/build.sh b/recipes/sofa-modelorderreduction/build.sh index 54214e970de3b..322f0cfaf9fb5 100644 --- a/recipes/sofa-modelorderreduction/build.sh +++ b/recipes/sofa-modelorderreduction/build.sh @@ -16,6 +16,7 @@ cd build cmake ${CMAKE_ARGS} \ -B . \ -S .. \ + -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ -DSP3_PYTHON_PACKAGES_DIRECTORY:PATH=python${PY_VER}/site-packages \ diff --git a/recipes/sofa-python3/build.sh b/recipes/sofa-python3/build.sh index f18cab7bc388a..4e735372567a5 100644 --- a/recipes/sofa-python3/build.sh +++ b/recipes/sofa-python3/build.sh @@ -16,6 +16,7 @@ cd build cmake ${CMAKE_ARGS} \ -B . \ -S .. \ + -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_RPATH:PATH=${PREFIX}/lib \ -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ diff --git a/recipes/sofa-softrobots/build.sh b/recipes/sofa-softrobots/build.sh index e8894cf6c4346..eca6553399339 100644 --- a/recipes/sofa-softrobots/build.sh +++ b/recipes/sofa-softrobots/build.sh @@ -14,6 +14,7 @@ cd build cmake ${CMAKE_ARGS} \ -B . \ -S .. \ + -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ -DSOFTROBOTS_BUILD_TESTS:BOOL=OFF diff --git a/recipes/sofa-softrobotsinverse/build.sh b/recipes/sofa-softrobotsinverse/build.sh index e97b7f7b55473..5516fb5719aa4 100644 --- a/recipes/sofa-softrobotsinverse/build.sh +++ b/recipes/sofa-softrobotsinverse/build.sh @@ -14,6 +14,7 @@ cd build cmake ${CMAKE_ARGS} \ -B . \ -S .. \ + -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ -DSOFTROBOTSINVERSE_ENABLE_PROXQP:BOOL=ON \ diff --git a/recipes/sofa-stlib/build.sh b/recipes/sofa-stlib/build.sh index 899034c28a4e2..01121bb817524 100644 --- a/recipes/sofa-stlib/build.sh +++ b/recipes/sofa-stlib/build.sh @@ -8,6 +8,7 @@ cd build cmake ${CMAKE_ARGS} \ -B . \ -S .. \ + -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ -DPLUGIN_SOFAPYTHON=ON From da2fbdef094cf9efa2a4bc1926b436d46780eb7f Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Sun, 11 Jan 2026 18:55:06 +0100 Subject: [PATCH 06/13] add bakpaul to maintainers list --- recipes/sofa-app/recipe.yaml | 1 + recipes/sofa-beamadapter/recipe.yaml | 1 + recipes/sofa-cosserat/recipe.yaml | 1 + recipes/sofa-glfw/recipe.yaml | 1 + recipes/sofa-modelorderreduction/recipe.yaml | 1 + recipes/sofa-python3/recipe.yaml | 1 + recipes/sofa-softrobots/recipe.yaml | 1 + recipes/sofa-softrobotsinverse/recipe.yaml | 3 ++- recipes/sofa-stlib/recipe.yaml | 2 ++ 9 files changed, 11 insertions(+), 1 deletion(-) diff --git a/recipes/sofa-app/recipe.yaml b/recipes/sofa-app/recipe.yaml index 242651a4e4979..951c07fe4a80b 100644 --- a/recipes/sofa-app/recipe.yaml +++ b/recipes/sofa-app/recipe.yaml @@ -41,3 +41,4 @@ extra: recipe-maintainers: - olivier-roussel - hugtalbot + - bakpaul \ No newline at end of file diff --git a/recipes/sofa-beamadapter/recipe.yaml b/recipes/sofa-beamadapter/recipe.yaml index fe588a0558316..12a14cf743ed1 100644 --- a/recipes/sofa-beamadapter/recipe.yaml +++ b/recipes/sofa-beamadapter/recipe.yaml @@ -55,3 +55,4 @@ extra: recipe-maintainers: - olivier-roussel - hugtalbot + - bakpaul diff --git a/recipes/sofa-cosserat/recipe.yaml b/recipes/sofa-cosserat/recipe.yaml index 3731e34f7c8f5..6c5e5661159ef 100644 --- a/recipes/sofa-cosserat/recipe.yaml +++ b/recipes/sofa-cosserat/recipe.yaml @@ -66,3 +66,4 @@ extra: recipe-maintainers: - olivier-roussel - hugtalbot + - bakpaul diff --git a/recipes/sofa-glfw/recipe.yaml b/recipes/sofa-glfw/recipe.yaml index f08b441a68e26..af0d535cf4a12 100644 --- a/recipes/sofa-glfw/recipe.yaml +++ b/recipes/sofa-glfw/recipe.yaml @@ -86,3 +86,4 @@ extra: recipe-maintainers: - olivier-roussel - hugtalbot + - bakpaul diff --git a/recipes/sofa-modelorderreduction/recipe.yaml b/recipes/sofa-modelorderreduction/recipe.yaml index 280f86cb32ced..8161ac5d125a2 100644 --- a/recipes/sofa-modelorderreduction/recipe.yaml +++ b/recipes/sofa-modelorderreduction/recipe.yaml @@ -66,3 +66,4 @@ extra: recipe-maintainers: - olivier-roussel - hugtalbot + - bakpaul diff --git a/recipes/sofa-python3/recipe.yaml b/recipes/sofa-python3/recipe.yaml index c374543b089c5..ef036774c9970 100644 --- a/recipes/sofa-python3/recipe.yaml +++ b/recipes/sofa-python3/recipe.yaml @@ -80,3 +80,4 @@ extra: recipe-maintainers: - olivier-roussel - hugtalbot + - bakpaul diff --git a/recipes/sofa-softrobots/recipe.yaml b/recipes/sofa-softrobots/recipe.yaml index 6894ea5885c2f..010b7e391ac2b 100644 --- a/recipes/sofa-softrobots/recipe.yaml +++ b/recipes/sofa-softrobots/recipe.yaml @@ -71,3 +71,4 @@ extra: recipe-maintainers: - olivier-roussel - hugtalbot + - bakpaul diff --git a/recipes/sofa-softrobotsinverse/recipe.yaml b/recipes/sofa-softrobotsinverse/recipe.yaml index 7c15376f4d89d..20d55add16428 100644 --- a/recipes/sofa-softrobotsinverse/recipe.yaml +++ b/recipes/sofa-softrobotsinverse/recipe.yaml @@ -68,4 +68,5 @@ about: extra: recipe-maintainers: - olivier-roussel - - hugtalbot \ No newline at end of file + - hugtalbot + - bakpaul diff --git a/recipes/sofa-stlib/recipe.yaml b/recipes/sofa-stlib/recipe.yaml index 6c4ba05b3af7b..c35ebcb5d572f 100644 --- a/recipes/sofa-stlib/recipe.yaml +++ b/recipes/sofa-stlib/recipe.yaml @@ -64,3 +64,5 @@ extra: recipe-maintainers: - olivier-roussel - hugtalbot + - bakpaul + From 2e75988f8cb27dd39607768738f352df9e158b1a Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Mon, 12 Jan 2026 08:41:21 +0100 Subject: [PATCH 07/13] fix linter --- recipes/sofa-app/recipe.yaml | 2 +- recipes/sofa-glfw/recipe.yaml | 1 + recipes/sofa-stlib/recipe.yaml | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/sofa-app/recipe.yaml b/recipes/sofa-app/recipe.yaml index 951c07fe4a80b..122aa62c8e9b5 100644 --- a/recipes/sofa-app/recipe.yaml +++ b/recipes/sofa-app/recipe.yaml @@ -41,4 +41,4 @@ extra: recipe-maintainers: - olivier-roussel - hugtalbot - - bakpaul \ No newline at end of file + - bakpaul diff --git a/recipes/sofa-glfw/recipe.yaml b/recipes/sofa-glfw/recipe.yaml index af0d535cf4a12..4e6fb2f3568a4 100644 --- a/recipes/sofa-glfw/recipe.yaml +++ b/recipes/sofa-glfw/recipe.yaml @@ -47,6 +47,7 @@ requirements: - pybind11 - python run: + - python # sofa-glfw is a devel library so it needs sofa-devel at runtime - sofa-devel ${{ major_minor }}.* run_exports: diff --git a/recipes/sofa-stlib/recipe.yaml b/recipes/sofa-stlib/recipe.yaml index c35ebcb5d572f..9b1576a32ccca 100644 --- a/recipes/sofa-stlib/recipe.yaml +++ b/recipes/sofa-stlib/recipe.yaml @@ -65,4 +65,3 @@ extra: - olivier-roussel - hugtalbot - bakpaul - From 17d88e9e863973120fc95012d9058674bec58e87 Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Fri, 13 Mar 2026 14:59:20 +0100 Subject: [PATCH 08/13] apply review comments for build scripts --- recipes/sofa-app/build.bat | 34 +++++------------- recipes/sofa-app/build.sh | 40 +++++++--------------- recipes/sofa-beamadapter/build.bat | 9 ++--- recipes/sofa-beamadapter/build.sh | 11 +++--- recipes/sofa-cosserat/build.bat | 9 ++--- recipes/sofa-cosserat/build.sh | 11 +++--- recipes/sofa-glfw/build.bat | 11 ++---- recipes/sofa-glfw/build.sh | 13 +++---- recipes/sofa-modelorderreduction/build.bat | 9 ++--- recipes/sofa-modelorderreduction/build.sh | 11 +++--- recipes/sofa-python3/build.bat | 9 ++--- recipes/sofa-python3/build.sh | 11 +++--- recipes/sofa-softrobots/build.bat | 9 ++--- recipes/sofa-softrobots/build.sh | 11 +++--- recipes/sofa-softrobotsinverse/build.bat | 9 ++--- recipes/sofa-softrobotsinverse/build.sh | 11 +++--- recipes/sofa-stlib/build.bat | 9 ++--- recipes/sofa-stlib/build.sh | 11 +++--- 18 files changed, 77 insertions(+), 161 deletions(-) diff --git a/recipes/sofa-app/build.bat b/recipes/sofa-app/build.bat index 8fb9bf4db08ed..048103381ccd2 100644 --- a/recipes/sofa-app/build.bat +++ b/recipes/sofa-app/build.bat @@ -2,14 +2,10 @@ setlocal EnableDelayedExpansion @echo on :: SceneChecking application -rmdir /S /Q build-scene-checking - -mkdir build-scene-checking -cd build-scene-checking :: Configure cmake %CMAKE_ARGS% ^ - -B . ^ + -B build-scene-checking ^ -S %SRC_DIR%\applications\projects\SceneChecking ^ -G Ninja ^ -DSCENECHECKING_BUILD_TESTS=OFF ^ @@ -17,58 +13,46 @@ cmake %CMAKE_ARGS% ^ if errorlevel 1 exit 1 :: Build. -cmake --build . --parallel "%CPU_COUNT%" +cmake --build build-scene-checking --parallel "%CPU_COUNT%" if errorlevel 1 exit 1 :: Install. -cmake --build . --parallel "%CPU_COUNT%" --target install +cmake --install build-scene-checking if errorlevel 1 exit 1 -cd .. - :: runSofa application -rmdir /S /Q build-sofa-app - -mkdir build-sofa-app -cd build-sofa-app :: Configure cmake %CMAKE_ARGS% ^ - -B . ^ + -B build-sofa-app ^ -S %SRC_DIR%\applications\projects\runSofa ^ -G Ninja ^ -DCMAKE_BUILD_TYPE:STRING=Release if errorlevel 1 exit 1 :: Build. -cmake --build . --parallel "%CPU_COUNT%" +cmake --build build-sofa-app --parallel "%CPU_COUNT%" if errorlevel 1 exit 1 :: Install. -cmake --build . --parallel "%CPU_COUNT%" --target install +cmake --install build-sofa-app if errorlevel 1 exit 1 -cd .. - :: runSofa app requires some data ressources, which will :: be included in this package -rmdir /S /Q build-sofa-examples - -mkdir build-sofa-examples -cd build-sofa-examples :: Configure cmake %CMAKE_ARGS% ^ - -B . ^ + -B build-sofa-examples ^ -S %SRC_DIR%\examples ^ -G Ninja ^ -DCMAKE_BUILD_TYPE:STRING=Release if errorlevel 1 exit 1 :: Build. -cmake --build . --parallel "%CPU_COUNT%" +cmake --build build-sofa-examples --parallel "%CPU_COUNT%" if errorlevel 1 exit 1 :: Install. -cmake --build . --parallel "%CPU_COUNT%" --target install +cmake --install build-sofa-examples if errorlevel 1 exit 1 diff --git a/recipes/sofa-app/build.sh b/recipes/sofa-app/build.sh index 8c013c54c45b3..2eedfc1d8b730 100644 --- a/recipes/sofa-app/build.sh +++ b/recipes/sofa-app/build.sh @@ -10,52 +10,42 @@ fi # SceneChecking application # ---------- -rm -rf build-scene-checking - -mkdir build-scene-checking -cd build-scene-checking # We have to manually set the Rpath for other SOFA libs to the lib/ directory using # the CMAKE_INSTALL_RPATH cmake variable, as SOFA CMakeLists are not designed # initially for a per-component compilation & installation cmake ${CMAKE_ARGS} \ - -B . \ - -S ../applications/projects/SceneChecking/ \ + -B build-scene-checking \ + -S ./applications/projects/SceneChecking/ \ -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DSCENECHECKING_BUILD_TESTS=OFF \ -DCMAKE_INSTALL_RPATH:PATH=${PREFIX}/lib # build -cmake --build . --parallel ${CPU_COUNT} +cmake --build build-scene-checking --parallel ${CPU_COUNT} # install -cmake --build . --parallel ${CPU_COUNT} --target install - -cd .. +cmake --install build-scene-checking # runSofa application # ---------- -rm -rf build-sofa-app - -mkdir build-sofa-app -cd build-sofa-app # We have to manually set the Rpath for other SOFA libs to the lib/ directory using # the CMAKE_INSTALL_RPATH cmake variable, as SOFA CMakeLists are not designed # initially for a per-component compilation & installation cmake ${CMAKE_ARGS} \ - -B . \ - -S ../applications/projects/runSofa/ \ + -B build-sofa-app \ + -S ./applications/projects/runSofa/ \ -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_RPATH:PATH=${PREFIX}/lib # build -cmake --build . --parallel ${CPU_COUNT} +cmake --build build-sofa-app --parallel ${CPU_COUNT} # install -cmake --build . --parallel ${CPU_COUNT} --target install +cmake --install build-sofa-app # For macOS, we have to provide this additionnal script as an hotfix # for users who would like to load SofaPython3 plugin in runSofa @@ -65,24 +55,18 @@ if [[ $target_platform == osx* ]] ; then cp "${RECIPE_DIR}/hotfix-sofa-run-macos.sh" "${PREFIX}/bin/runSofa_with_python" fi -cd .. - # runSofa app requires some data ressources, which will # be included in this package # ---------- -rm -rf build-sofa-examples - -mkdir build-sofa-examples -cd build-sofa-examples cmake ${CMAKE_ARGS} \ - -B . \ - -S ../examples/ \ + -B build-sofa-examples \ + -S ./examples/ \ -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release # build -cmake --build . --parallel ${CPU_COUNT} +cmake --build build-sofa-examples --parallel ${CPU_COUNT} # install -cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file +cmake --install build-sofa-examples \ No newline at end of file diff --git a/recipes/sofa-beamadapter/build.bat b/recipes/sofa-beamadapter/build.bat index a6def840bea02..8135318d33b0d 100644 --- a/recipes/sofa-beamadapter/build.bat +++ b/recipes/sofa-beamadapter/build.bat @@ -1,11 +1,8 @@ setlocal EnableDelayedExpansion -mkdir build -cd build - ::Configure cmake %CMAKE_ARGS% ^ - -B . ^ + -B build ^ -S %SRC_DIR% ^ -G Ninja ^ -DCMAKE_BUILD_TYPE:STRING=Release ^ @@ -13,9 +10,9 @@ cmake %CMAKE_ARGS% ^ if errorlevel 1 exit 1 :: Build. -cmake --build . --parallel "%CPU_COUNT%" +cmake --build build --parallel "%CPU_COUNT%" if errorlevel 1 exit 1 :: Install. -cmake --build . --parallel "%CPU_COUNT%" --target install +cmake --install build if errorlevel 1 exit 1 \ No newline at end of file diff --git a/recipes/sofa-beamadapter/build.sh b/recipes/sofa-beamadapter/build.sh index 3df257b84ec40..4eb6c30fdcf22 100644 --- a/recipes/sofa-beamadapter/build.sh +++ b/recipes/sofa-beamadapter/build.sh @@ -8,18 +8,15 @@ if [[ $target_platform == osx* ]] ; then CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" fi -mkdir build -cd build - cmake ${CMAKE_ARGS} \ - -B. \ - -S .. \ + -B build \ + -S . \ -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DBEAMADAPTER_BUILD_TESTS:BOOL=OFF # build -cmake --build . --parallel ${CPU_COUNT} +cmake --build build --parallel ${CPU_COUNT} # install -cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file +cmake --install build \ No newline at end of file diff --git a/recipes/sofa-cosserat/build.bat b/recipes/sofa-cosserat/build.bat index b4f892d237d69..8df9511b0c915 100644 --- a/recipes/sofa-cosserat/build.bat +++ b/recipes/sofa-cosserat/build.bat @@ -1,11 +1,8 @@ setlocal EnableDelayedExpansion -mkdir build -cd build - ::Configure cmake %CMAKE_ARGS% ^ - -B . ^ + -B build ^ -S %SRC_DIR% ^ -G Ninja ^ -DCMAKE_BUILD_TYPE:STRING=Release ^ @@ -15,9 +12,9 @@ cmake %CMAKE_ARGS% ^ if errorlevel 1 exit 1 :: Build. -cmake --build . --parallel "%CPU_COUNT%" +cmake --build build --parallel "%CPU_COUNT%" if errorlevel 1 exit 1 :: Install. -cmake --build . --parallel "%CPU_COUNT%" --target install +cmake --install build if errorlevel 1 exit 1 \ No newline at end of file diff --git a/recipes/sofa-cosserat/build.sh b/recipes/sofa-cosserat/build.sh index 94860a3a58de0..0c46ad8c850b8 100644 --- a/recipes/sofa-cosserat/build.sh +++ b/recipes/sofa-cosserat/build.sh @@ -8,12 +8,9 @@ if [[ $target_platform == osx* ]] ; then CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" fi -mkdir build -cd build - cmake ${CMAKE_ARGS} \ - -B . \ - -S .. \ + -B build \ + -S . \ -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ @@ -21,7 +18,7 @@ cmake ${CMAKE_ARGS} \ -DCOSSERAT_BUILD_TESTS:BOOL=OFF # build -cmake --build . --parallel ${CPU_COUNT} +cmake --build build --parallel ${CPU_COUNT} # install -cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file +cmake --install build \ No newline at end of file diff --git a/recipes/sofa-glfw/build.bat b/recipes/sofa-glfw/build.bat index 859738b9c64f7..5b3e12d225eb9 100644 --- a/recipes/sofa-glfw/build.bat +++ b/recipes/sofa-glfw/build.bat @@ -1,11 +1,8 @@ setlocal EnableDelayedExpansion -mkdir build -cd build - ::Configure cmake %CMAKE_ARGS% ^ - -B . ^ + -B build ^ -S %SRC_DIR% ^ -G Ninja ^ -DPLUGIN_SOFAGLFW:BOOL=ON ^ @@ -16,16 +13,14 @@ cmake %CMAKE_ARGS% ^ if errorlevel 1 exit 1 :: Build. -cmake --build . --parallel "%CPU_COUNT%" +cmake --build build --parallel "%CPU_COUNT%" if errorlevel 1 exit 1 :: Install. -cmake --build . --parallel "%CPU_COUNT%" --target install +cmake --install build if errorlevel 1 exit 1 :: Testing compilation as 3rd party -cd .. -mkdir build-test cmake %CMAKE_ARGS% ^ -B build-test ^ -S %SRC_DIR%\SofaImGui\extensions\SofaImGui.Camera ^ diff --git a/recipes/sofa-glfw/build.sh b/recipes/sofa-glfw/build.sh index ddedbc2e8824e..8d84f39ad8cd8 100644 --- a/recipes/sofa-glfw/build.sh +++ b/recipes/sofa-glfw/build.sh @@ -8,12 +8,9 @@ if [[ $target_platform == osx* ]] ; then CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" fi -mkdir build -cd build - cmake ${CMAKE_ARGS} \ - -B . \ - -S .. \ + -B build \ + -S . \ -G Ninja \ -DPLUGIN_SOFAGLFW:BOOL=ON \ -DPLUGIN_SOFAIMGUI:BOOL=ON \ @@ -22,15 +19,13 @@ cmake ${CMAKE_ARGS} \ -DSP3_PYTHON_PACKAGES_DIRECTORY:PATH=python${PY_VER}/site-packages # build -cmake --build . --parallel ${CPU_COUNT} +cmake --build build --parallel ${CPU_COUNT} # install -cmake --build . --parallel ${CPU_COUNT} --target install +cmake --install build # testing compilation as 3rd party if [[ $CONDA_BUILD_CROSS_COMPILATION != 1 ]]; then - cd .. - mkdir build-test cmake ${CMAKE_ARGS} \ -B build-test \ -S SofaImGui/extensions/SofaImGui.Camera \ diff --git a/recipes/sofa-modelorderreduction/build.bat b/recipes/sofa-modelorderreduction/build.bat index 71edde9890e66..d2046de1b7564 100644 --- a/recipes/sofa-modelorderreduction/build.bat +++ b/recipes/sofa-modelorderreduction/build.bat @@ -1,11 +1,8 @@ setlocal EnableDelayedExpansion -mkdir build -cd build - ::Configure cmake %CMAKE_ARGS% ^ - -B . ^ + -B build ^ -S %SRC_DIR% ^ -G Ninja ^ -DCMAKE_BUILD_TYPE:STRING=Release ^ @@ -15,9 +12,9 @@ cmake %CMAKE_ARGS% ^ if errorlevel 1 exit 1 :: Build. -cmake --build . --parallel "%CPU_COUNT%" +cmake --build build --parallel "%CPU_COUNT%" if errorlevel 1 exit 1 :: Install. -cmake --build . --parallel "%CPU_COUNT%" --target install +cmake --install build if errorlevel 1 exit 1 \ No newline at end of file diff --git a/recipes/sofa-modelorderreduction/build.sh b/recipes/sofa-modelorderreduction/build.sh index 322f0cfaf9fb5..661ac911a2f65 100644 --- a/recipes/sofa-modelorderreduction/build.sh +++ b/recipes/sofa-modelorderreduction/build.sh @@ -8,14 +8,11 @@ if [[ $target_platform == osx* ]] ; then CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" fi -mkdir build -cd build - # Set CMAKE_INSTALL_RPATH_USE_LINK_PATH is necessary to link to libCollisionOBBCapsule # which installs to the non-standard location $PREFIX/plugins/CollisionOBBCapsule/lib cmake ${CMAKE_ARGS} \ - -B . \ - -S .. \ + -B build \ + -S . \ -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ @@ -24,7 +21,7 @@ cmake ${CMAKE_ARGS} \ -DMODELORDERREDUCTION_BUILD_TESTS:BOOL=OFF # build -cmake --build . --parallel ${CPU_COUNT} +cmake --build build --parallel ${CPU_COUNT} # install -cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file +cmake --install build \ No newline at end of file diff --git a/recipes/sofa-python3/build.bat b/recipes/sofa-python3/build.bat index 62439e0dd42c6..e4d7e3a926f0a 100644 --- a/recipes/sofa-python3/build.bat +++ b/recipes/sofa-python3/build.bat @@ -1,11 +1,8 @@ setlocal EnableDelayedExpansion -mkdir build -cd build - ::Configure cmake %CMAKE_ARGS% ^ - -B . ^ + -B build ^ -S %SRC_DIR% ^ -G Ninja ^ -DCMAKE_BUILD_TYPE:STRING=Release ^ @@ -15,11 +12,11 @@ cmake %CMAKE_ARGS% ^ if errorlevel 1 exit 1 :: Build. -cmake --build . --parallel "%CPU_COUNT%" +cmake --build build --parallel "%CPU_COUNT%" if errorlevel 1 exit 1 :: Install. -cmake --build . --parallel "%CPU_COUNT%" --target install +cmake --install build if errorlevel 1 exit 1 :: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d. diff --git a/recipes/sofa-python3/build.sh b/recipes/sofa-python3/build.sh index 4e735372567a5..a7b297f523d2e 100644 --- a/recipes/sofa-python3/build.sh +++ b/recipes/sofa-python3/build.sh @@ -8,14 +8,11 @@ if [[ $target_platform == osx* ]] ; then CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" fi -mkdir build -cd build - # We have to manually set the Rpath for Python packages to the lib/ directory using # the CMAKE_INSTALL_RPATH cmake variable. cmake ${CMAKE_ARGS} \ - -B . \ - -S .. \ + -B build \ + -S . \ -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_INSTALL_RPATH:PATH=${PREFIX}/lib \ @@ -24,7 +21,7 @@ cmake ${CMAKE_ARGS} \ -DSP3_BUILD_TEST:BOOL=OFF # build -cmake --build . --parallel ${CPU_COUNT} +cmake --build build --parallel ${CPU_COUNT} # install -cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file +cmake --install build \ No newline at end of file diff --git a/recipes/sofa-softrobots/build.bat b/recipes/sofa-softrobots/build.bat index a24f88c7a2510..ef2f3ff842e9f 100644 --- a/recipes/sofa-softrobots/build.bat +++ b/recipes/sofa-softrobots/build.bat @@ -1,11 +1,8 @@ setlocal EnableDelayedExpansion -mkdir build -cd build - ::Configure cmake %CMAKE_ARGS% ^ - -B . ^ + -B build ^ -S %SRC_DIR% ^ -G Ninja ^ -DCMAKE_BUILD_TYPE:STRING=Release ^ @@ -14,9 +11,9 @@ cmake %CMAKE_ARGS% ^ if errorlevel 1 exit 1 :: Build. -cmake --build . --parallel "%CPU_COUNT%" +cmake --build build --parallel "%CPU_COUNT%" if errorlevel 1 exit 1 :: Install. -cmake --build . --parallel "%CPU_COUNT%" --target install +cmake --install build if errorlevel 1 exit 1 \ No newline at end of file diff --git a/recipes/sofa-softrobots/build.sh b/recipes/sofa-softrobots/build.sh index eca6553399339..6adc305d13197 100644 --- a/recipes/sofa-softrobots/build.sh +++ b/recipes/sofa-softrobots/build.sh @@ -8,19 +8,16 @@ if [[ $target_platform == osx* ]] ; then CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" fi -mkdir build -cd build - cmake ${CMAKE_ARGS} \ - -B . \ - -S .. \ + -B build \ + -S . \ -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ -DSOFTROBOTS_BUILD_TESTS:BOOL=OFF # build -cmake --build . --parallel ${CPU_COUNT} +cmake --build build --parallel ${CPU_COUNT} # install -cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file +cmake --install build \ No newline at end of file diff --git a/recipes/sofa-softrobotsinverse/build.bat b/recipes/sofa-softrobotsinverse/build.bat index 19dc5b1e0166e..201584c136174 100644 --- a/recipes/sofa-softrobotsinverse/build.bat +++ b/recipes/sofa-softrobotsinverse/build.bat @@ -1,11 +1,8 @@ setlocal EnableDelayedExpansion -mkdir build -cd build - ::Configure cmake %CMAKE_ARGS% ^ - -B . ^ + -B build ^ -S %SRC_DIR% ^ -G Ninja ^ -DCMAKE_BUILD_TYPE:STRING=Release ^ @@ -16,9 +13,9 @@ cmake %CMAKE_ARGS% ^ if errorlevel 1 exit 1 :: Build. -cmake --build . --parallel "%CPU_COUNT%" +cmake --build build --parallel "%CPU_COUNT%" if errorlevel 1 exit 1 :: Install. -cmake --build . --parallel "%CPU_COUNT%" --target install +cmake --install build if errorlevel 1 exit 1 \ No newline at end of file diff --git a/recipes/sofa-softrobotsinverse/build.sh b/recipes/sofa-softrobotsinverse/build.sh index 5516fb5719aa4..b2d2773704f2e 100644 --- a/recipes/sofa-softrobotsinverse/build.sh +++ b/recipes/sofa-softrobotsinverse/build.sh @@ -8,12 +8,9 @@ if [[ $target_platform == osx* ]] ; then CXXFLAGS="${CXXFLAGS} -D_LIBCPP_DISABLE_AVAILABILITY" fi -mkdir build -cd build - cmake ${CMAKE_ARGS} \ - -B . \ - -S .. \ + -B build \ + -S . \ -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ @@ -22,7 +19,7 @@ cmake ${CMAKE_ARGS} \ -DSOFTROBOTSINVERSE_BUILD_TESTS:BOOL=OFF # build -cmake --build . --parallel ${CPU_COUNT} +cmake --build build --parallel ${CPU_COUNT} # install -cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file +cmake --install build \ No newline at end of file diff --git a/recipes/sofa-stlib/build.bat b/recipes/sofa-stlib/build.bat index 8ffe7b84c26d3..44429f8f1c8e6 100644 --- a/recipes/sofa-stlib/build.bat +++ b/recipes/sofa-stlib/build.bat @@ -1,11 +1,8 @@ setlocal EnableDelayedExpansion -mkdir build -cd build - ::Configure cmake %CMAKE_ARGS% ^ - -B . ^ + -B build ^ -S %SRC_DIR% ^ -G Ninja ^ -DCMAKE_BUILD_TYPE:STRING=Release ^ @@ -14,9 +11,9 @@ cmake %CMAKE_ARGS% ^ if errorlevel 1 exit 1 :: Build. -cmake --build . --parallel "%CPU_COUNT%" +cmake --build build --parallel "%CPU_COUNT%" if errorlevel 1 exit 1 :: Install. -cmake --build . --parallel "%CPU_COUNT%" --target install +cmake --install build if errorlevel 1 exit 1 \ No newline at end of file diff --git a/recipes/sofa-stlib/build.sh b/recipes/sofa-stlib/build.sh index 01121bb817524..025564e11ce1b 100644 --- a/recipes/sofa-stlib/build.sh +++ b/recipes/sofa-stlib/build.sh @@ -2,19 +2,16 @@ set -ex -mkdir build -cd build - cmake ${CMAKE_ARGS} \ - -B . \ - -S .. \ + -B build \ + -S . \ -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=Release \ -DPython_EXECUTABLE:PATH=${PREFIX}/bin/python \ -DPLUGIN_SOFAPYTHON=ON # build -cmake --build . --parallel ${CPU_COUNT} +cmake --build build --parallel ${CPU_COUNT} # install -cmake --build . --parallel ${CPU_COUNT} --target install \ No newline at end of file +cmake --install build \ No newline at end of file From 5e19656b3456ec62d1ad118b241002705e4a0b71 Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Fri, 13 Mar 2026 15:56:59 +0100 Subject: [PATCH 09/13] bump to v25.12 --- recipes/sofa-app/recipe.yaml | 4 +- recipes/sofa-beamadapter/recipe.yaml | 4 +- recipes/sofa-cosserat/recipe.yaml | 4 +- ...-imgui.h-from-ImgGuiGUIEngine-header.patch | 330 ------------------ ...o-impl-and-do-not-expose-private-hea.patch | 305 ---------------- ...FW-cmake-config-in-with-missing-gflw.patch | 26 -- recipes/sofa-glfw/recipe.yaml | 11 +- recipes/sofa-modelorderreduction/recipe.yaml | 4 +- recipes/sofa-python3/recipe.yaml | 4 +- ...5-if-interactive-control-cmake-optio.patch | 28 -- recipes/sofa-softrobots/recipe.yaml | 8 +- recipes/sofa-softrobotsinverse/recipe.yaml | 4 +- recipes/sofa-stlib/recipe.yaml | 4 +- 13 files changed, 18 insertions(+), 718 deletions(-) delete mode 100644 recipes/sofa-glfw/patches/0001-remove-imgui.h-from-ImgGuiGUIEngine-header.patch delete mode 100644 recipes/sofa-glfw/patches/0002-hide-SimpleIni-to-impl-and-do-not-expose-private-hea.patch delete mode 100644 recipes/sofa-glfw/patches/0003-fix-SofaGLFW-cmake-config-in-with-missing-gflw.patch delete mode 100644 recipes/sofa-softrobots/patches/0001-only-requires-Qt5-if-interactive-control-cmake-optio.patch diff --git a/recipes/sofa-app/recipe.yaml b/recipes/sofa-app/recipe.yaml index 122aa62c8e9b5..bae386071104d 100644 --- a/recipes/sofa-app/recipe.yaml +++ b/recipes/sofa-app/recipe.yaml @@ -1,6 +1,6 @@ context: name: sofa-app - version: "25.06.00" + version: "25.12.00" major_minor: ${{ (version | split('.'))[:2] | join('.') }} package: @@ -9,7 +9,7 @@ package: source: url: https://github.com/sofa-framework/sofa/archive/refs/tags/v${{ version }}.tar.gz - sha256: a3a9345d71c3c62c26a0abddf18f7cbbd481bba5f095c92c0956f33530b50e69 + sha256: 79ad3da07cdb968744344a987a75759a193df7473bceebd94fd5eef49485ed83 build: number: 0 diff --git a/recipes/sofa-beamadapter/recipe.yaml b/recipes/sofa-beamadapter/recipe.yaml index 12a14cf743ed1..82da56f9d13bf 100644 --- a/recipes/sofa-beamadapter/recipe.yaml +++ b/recipes/sofa-beamadapter/recipe.yaml @@ -1,6 +1,6 @@ context: name: sofa-beamadapter - version: "25.06.00" + version: "25.12.00" major_minor: ${{ (version | split('.'))[:2] | join('.') }} package: @@ -9,7 +9,7 @@ package: source: url: https://github.com/sofa-framework/BeamAdapter/archive/refs/tags/release-v${{ major_minor }}.tar.gz - sha256: fe1b878427ac1573437f2a33c380c61cb6b77c526638d23141942a940baeb5dd + sha256: 73a3cd2f20df43860fc0fd40662c39c6b1f4984cc8e3ac9f6dde87e8ebc861c3 build: number: 0 diff --git a/recipes/sofa-cosserat/recipe.yaml b/recipes/sofa-cosserat/recipe.yaml index 6c5e5661159ef..e28d1cdb5f5be 100644 --- a/recipes/sofa-cosserat/recipe.yaml +++ b/recipes/sofa-cosserat/recipe.yaml @@ -1,6 +1,6 @@ context: name: sofa-cosserat - version: "25.06.00" + version: "25.12.00" major_minor: ${{ (version | split('.'))[:2] | join('.') }} package: @@ -9,7 +9,7 @@ package: source: url: https://github.com/SofaDefrost/Cosserat/archive/refs/tags/release-v${{ major_minor }}.tar.gz - sha256: 9db628531729400b2a5535c04f4444f674caaf5ebb6c1ad28632d5162100bc24 + sha256: 1811798b96eeb276bd34d309ff65010b1357fb1c221849862e5022fb46bd5139 build: number: 0 diff --git a/recipes/sofa-glfw/patches/0001-remove-imgui.h-from-ImgGuiGUIEngine-header.patch b/recipes/sofa-glfw/patches/0001-remove-imgui.h-from-ImgGuiGUIEngine-header.patch deleted file mode 100644 index 638e89af5249f..0000000000000 --- a/recipes/sofa-glfw/patches/0001-remove-imgui.h-from-ImgGuiGUIEngine-header.patch +++ /dev/null @@ -1,330 +0,0 @@ -From 18eaac6e5ac07515705bf6a8c40da8b27164c59f Mon Sep 17 00:00:00 2001 -From: Olivier Roussel -Date: Mon, 22 Dec 2025 11:30:14 +0100 -Subject: [PATCH] remove imgui.h from ImgGuiGUIEngine header - -remove imgui internal headers from distributed public headers - -hide impl of ScalarWidget - -remove useless headers - -fix missing headers simpleini.h - -use SimpleIni as a dependency - -add SimpleIni dep in SofaImGUi cmake config - -do not install implot and IconFontCppHeaders headers ---- - SofaImGui/CMakeLists.txt | 48 ++++++++----------- - SofaImGui/SofaImGuiConfig.cmake.in | 4 ++ - SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp | 4 +- - SofaImGui/src/SofaImGui/ImGuiGUIEngine.h | 5 +- - .../src/SofaImGui/widgets/ScalarWidget.cpp | 39 +++++++++++++++ - .../src/SofaImGui/widgets/ScalarWidget.h | 11 +---- - SofaImGui/src/SofaImGui/windows/Log.h | 2 - - .../src/SofaImGui/windows/Performances.h | 1 - - SofaImGui/src/SofaImGui/windows/Profiler.h | 2 - - SofaImGui/src/SofaImGui/windows/Settings.h | 1 + - SofaImGui/src/SofaImGui/windows/ViewPort.h | 1 + - 11 files changed, 74 insertions(+), 44 deletions(-) - create mode 100644 SofaImGui/src/SofaImGui/widgets/ScalarWidget.cpp - -diff --git a/SofaImGui/CMakeLists.txt b/SofaImGui/CMakeLists.txt -index 45022cc..74fa7fd 100644 ---- a/SofaImGui/CMakeLists.txt -+++ b/SofaImGui/CMakeLists.txt -@@ -21,6 +21,7 @@ FetchContent_Declare(imgui - ) - FetchContent_MakeAvailable(imgui) - -+# nfd (nativefiledialog-extended) - find_package(nfd CONFIG QUIET) - - if(TARGET nfd::nfd) -@@ -41,7 +42,6 @@ else() - add_library(nfd::nfd ALIAS nfd) # introduced in nfd >= v1.2.1 - endif() - -- - FetchContent_Declare(ImPlot - GIT_REPOSITORY https://github.com/epezent/implot - GIT_TAG 18c72431f8265e2b0b5378a3a73d8a883b2175ff # v0.16 -@@ -54,30 +54,23 @@ FetchContent_Declare(IconFontCppHeaders - ) - FetchContent_MakeAvailable(IconFontCppHeaders) - --FetchContent_Declare(simpleini -- GIT_REPOSITORY https://github.com/brofield/simpleini -- GIT_TAG 09c21bda1dc1b578fa55f4a005d79b0afd481296 # v4.22 --) --FetchContent_MakeAvailable(simpleini) -- --set(IMGUI_HEADER_FILES -- ${imgui_SOURCE_DIR}/backends/imgui_impl_glfw.h -- ${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.h -- ${imgui_SOURCE_DIR}/backends/imgui_impl_opengl2.h -- ${imgui_SOURCE_DIR}/imconfig.h -- ${imgui_SOURCE_DIR}/imgui.h -- ${imgui_SOURCE_DIR}/imgui_internal.h -- ${imgui_SOURCE_DIR}/misc/cpp/imgui_stdlib.h -- ${implot_SOURCE_DIR}/implot.h -- ${implot_SOURCE_DIR}/implot_internal.h -- ${iconfontcppheaders_SOURCE_DIR}/IconsFontAwesome4.h -- ${iconfontcppheaders_SOURCE_DIR}/IconsFontAwesome6.h -- ${simpleini_SOURCE_DIR}/SimpleIni.h -- resources/fa-regular-400.h -- resources/fa-solid-900.h -- resources/Roboto-Medium.h -- resources/Style.h --) -+ -+# SimpleIni -+find_package(SimpleIni QUIET) -+ -+if(NOT TARGET SimpleIni::SimpleIni AND ((DEFINED SOFA_ALLOW_FETCH_DEPENDENCIES AND SOFA_ALLOW_FETCH_DEPENDENCIES) OR (NOT DEFINED SOFA_ALLOW_FETCH_DEPENDENCIES))) -+ message("${PROJECT_NAME}: SimpleIni not found and SOFA_ALLOW_FETCH_DEPENDENCIES is ON, fetching source code...") -+ -+ FetchContent_Declare(simpleini -+ GIT_REPOSITORY https://github.com/brofield/simpleini -+ GIT_TAG 09c21bda1dc1b578fa55f4a005d79b0afd481296 # v4.22 -+ ) -+ FetchContent_MakeAvailable(simpleini) -+ -+elseif(NOT TARGET SimpleIni::SimpleIni) -+ message(FATAL_ERROR "{PROJECT_NAME}: SimpleIni not found and SOFA_ALLOW_FETCH_DEPENDENCIES is OFF and thus cannot be fetched. Install SimpleIni, or enable SOFA_ALLOW_FETCH_DEPENDENCIES to fix this issue.") -+endif() -+ - set(IMGUI_SOURCE_FILES - ${imgui_SOURCE_DIR}/backends/imgui_impl_glfw.cpp - ${imgui_SOURCE_DIR}/backends/imgui_impl_opengl3.cpp -@@ -101,7 +94,6 @@ set(HEADER_FILES - ${SOFAIMGUI_SOURCE_DIR}/ImGuiDataWidget.h - ${SOFAIMGUI_SOURCE_DIR}/ImGuiGUI.h - ${SOFAIMGUI_SOURCE_DIR}/ImGuiGUIEngine.h -- ${SOFAIMGUI_SOURCE_DIR}/ObjectColor.h - ${SOFAIMGUI_SOURCE_DIR}/UIStrings.h - ${SOFAIMGUI_SOURCE_DIR}/widgets/DisplayFlagsWidget.h - ${SOFAIMGUI_SOURCE_DIR}/widgets/LinearSpringWidget.h -@@ -131,6 +123,7 @@ set(SOURCE_FILES - ${SOFAIMGUI_SOURCE_DIR}/initSofaImGui.cpp - ${SOFAIMGUI_SOURCE_DIR}/widgets/DisplayFlagsWidget.cpp - ${SOFAIMGUI_SOURCE_DIR}/widgets/MaterialWidget.cpp -+ ${SOFAIMGUI_SOURCE_DIR}/widgets/ScalarWidget.cpp - ${SOFAIMGUI_SOURCE_DIR}/windows/Performances.cpp - ${SOFAIMGUI_SOURCE_DIR}/windows/Log.cpp - ${SOFAIMGUI_SOURCE_DIR}/windows/MouseManager.cpp -@@ -151,10 +144,11 @@ set(SOURCE_FILES - - set(IMGUI_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/resources ${imgui_SOURCE_DIR} ${implot_SOURCE_DIR} ${iconfontcppheaders_SOURCE_DIR} ${simpleini_SOURCE_DIR}) - --add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${IMGUI_HEADER_FILES} ${IMGUI_SOURCE_FILES}) -+add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${IMGUI_SOURCE_FILES}) - target_include_directories(${PROJECT_NAME} PUBLIC "$") - target_link_libraries(${PROJECT_NAME} PUBLIC SofaGLFW Sofa.GL.Component.Rendering3D ${CMAKE_DL_LIBS}) - target_link_libraries(${PROJECT_NAME} PRIVATE nfd) -+target_link_libraries(${PROJECT_NAME} PUBLIC SimpleIni::SimpleIni) - - # setup the same API exports for imgui - target_compile_definitions(${PROJECT_NAME} PUBLIC IMGUI_API=SOFAIMGUI_API) -diff --git a/SofaImGui/SofaImGuiConfig.cmake.in b/SofaImGui/SofaImGuiConfig.cmake.in -index cfc50d5..11e228d 100644 ---- a/SofaImGui/SofaImGuiConfig.cmake.in -+++ b/SofaImGui/SofaImGuiConfig.cmake.in -@@ -6,6 +6,10 @@ - find_package(SofaGLFW REQUIRED) - find_package(Sofa.GL.Component.Rendering3D REQUIRED) - -+if(NOT TARGET SimpleIni::SimpleIni) -+ sofa_find_package(SimpleIni QUIET REQUIRED) -+endif() -+ - if(NOT TARGET @PROJECT_NAME@) - include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") - endif() -diff --git a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp -index 545f28b..799fe09 100644 ---- a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp -+++ b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp -@@ -24,6 +24,7 @@ - #include - #include - #include -+#include - #include - - #include -@@ -756,8 +757,9 @@ void ImGuiGUIEngine::endFrame() - std::setlocale(LC_NUMERIC, m_localeBackup.c_str()); - } - --void ImGuiGUIEngine::resetView(ImGuiID dockspace_id, const char* windowNameSceneGraph, const char *windowNameLog, const char *windowNameViewport) -+void ImGuiGUIEngine::resetView(_ImGuiID dockspace_id, const char* windowNameSceneGraph, const char *windowNameLog, const char *windowNameViewport) - { -+ static_assert(std::is_same<_ImGuiID, ImGuiID>::value, "_ImGuiID and ImGuiID types must be identical. _ImGuiID must be adjusted."); - ImGuiViewport* viewport = ImGui::GetMainViewport(); - - ImGui::DockBuilderRemoveNode(dockspace_id); // clear any previous layout -diff --git a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h -index dac1e67..ee1e2f7 100644 ---- a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h -+++ b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h -@@ -29,7 +29,6 @@ - #include "guis/AdditionalGUIRegistry.h" - #include "windows/WindowState.h" - #include --#include - #include - - using windows::WindowState; -@@ -74,7 +73,9 @@ protected: - bool isMouseOnViewport { false }; - CSimpleIniA ini; - void loadFile(sofaglfw::SofaGLFWBaseGUI* baseGUI, sofa::core::sptr& groot, std::string filePathName, bool reload = false); -- void resetView(ImGuiID dockspace_id, const char *windowNameSceneGraph, const char *windowNameLog, const char *windowNameViewport) ; -+ -+ using _ImGuiID = unsigned int; -+ void resetView(_ImGuiID dockspace_id, const char *windowNameSceneGraph, const char *windowNameLog, const char *windowNameViewport) ; - - // WindowState members - windows::WindowState winManagerProfiler; -diff --git a/SofaImGui/src/SofaImGui/widgets/ScalarWidget.cpp b/SofaImGui/src/SofaImGui/widgets/ScalarWidget.cpp -new file mode 100644 -index 0000000..9362260 ---- /dev/null -+++ b/SofaImGui/src/SofaImGui/widgets/ScalarWidget.cpp -@@ -0,0 +1,39 @@ -+/****************************************************************************** -+* SOFA, Simulation Open-Framework Architecture * -+* (c) 2006 INRIA, USTL, UJF, CNRS, MGH * -+* * -+* This program is free software; you can redistribute it and/or modify it * -+* under the terms of the GNU General Public License as published by the Free * -+* Software Foundation; either version 2 of the License, or (at your option) * -+* any later version. * -+* * -+* This program is distributed in the hope that it will be useful, but WITHOUT * -+* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * -+* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * -+* more details. * -+* * -+* You should have received a copy of the GNU General Public License along * -+* with this program. If not, see . * -+******************************************************************************* -+* Authors: The SOFA Team and external contributors (see Authors.txt) * -+* * -+* Contact information: contact@sofa-framework.org * -+******************************************************************************/ -+#pragma once -+#include -+#include -+ -+namespace sofaimgui -+{ -+ -+bool showScalarWidget(const std::string& label, const std::string& id, float& value) -+{ -+ return ImGui::InputFloat((label + "##" + id).c_str(), &value, 0.0f, 0.0f, "%.8f", ImGuiInputTextFlags_None); -+} -+ -+bool showScalarWidget(const std::string& label, const std::string& id, double& value) -+{ -+ return ImGui::InputDouble((label + "##" + id).c_str(), &value, 0.0f, 0.0f, "%.8f", ImGuiInputTextFlags_None); -+} -+ -+} -diff --git a/SofaImGui/src/SofaImGui/widgets/ScalarWidget.h b/SofaImGui/src/SofaImGui/widgets/ScalarWidget.h -index e7b4e9e..bb1c63a 100644 ---- a/SofaImGui/src/SofaImGui/widgets/ScalarWidget.h -+++ b/SofaImGui/src/SofaImGui/widgets/ScalarWidget.h -@@ -21,20 +21,13 @@ - ******************************************************************************/ - #pragma once - #include --#include - - namespace sofaimgui - { - --inline bool showScalarWidget(const std::string& label, const std::string& id, float& value) --{ -- return ImGui::InputFloat((label + "##" + id).c_str(), &value, 0.0f, 0.0f, "%.8f", ImGuiInputTextFlags_None); --} -+inline bool showScalarWidget(const std::string& label, const std::string& id, float& value); - --inline bool showScalarWidget(const std::string& label, const std::string& id, double& value) --{ -- return ImGui::InputDouble((label + "##" + id).c_str(), &value, 0.0f, 0.0f, "%.8f", ImGuiInputTextFlags_None); --} -+inline bool showScalarWidget(const std::string& label, const std::string& id, double& value); - - template - void showScalarWidget(sofa::Data& data) -diff --git a/SofaImGui/src/SofaImGui/windows/Log.h b/SofaImGui/src/SofaImGui/windows/Log.h -index 0a70b65..77a75af 100644 ---- a/SofaImGui/src/SofaImGui/windows/Log.h -+++ b/SofaImGui/src/SofaImGui/windows/Log.h -@@ -27,9 +27,7 @@ - #include - #include - --#include - #include --#include - #include "WindowState.h" - - -diff --git a/SofaImGui/src/SofaImGui/windows/Performances.h b/SofaImGui/src/SofaImGui/windows/Performances.h -index b320c4e..1d0e499 100644 ---- a/SofaImGui/src/SofaImGui/windows/Performances.h -+++ b/SofaImGui/src/SofaImGui/windows/Performances.h -@@ -30,7 +30,6 @@ - - #include - #include --#include - #include "WindowState.h" - - -diff --git a/SofaImGui/src/SofaImGui/windows/Profiler.h b/SofaImGui/src/SofaImGui/windows/Profiler.h -index ac843b6..7ee088a 100644 ---- a/SofaImGui/src/SofaImGui/windows/Profiler.h -+++ b/SofaImGui/src/SofaImGui/windows/Profiler.h -@@ -28,9 +28,7 @@ - #include - #include - --#include - #include --#include - #include "WindowState.h" - - -diff --git a/SofaImGui/src/SofaImGui/windows/Settings.h b/SofaImGui/src/SofaImGui/windows/Settings.h -index 5a8e039..cb52c2e 100644 ---- a/SofaImGui/src/SofaImGui/windows/Settings.h -+++ b/SofaImGui/src/SofaImGui/windows/Settings.h -@@ -23,6 +23,7 @@ - - #include - #include "WindowState.h" -+#include - - namespace sofaimgui - { -diff --git a/SofaImGui/src/SofaImGui/windows/ViewPort.h b/SofaImGui/src/SofaImGui/windows/ViewPort.h -index c1fd42c..30cf947 100644 ---- a/SofaImGui/src/SofaImGui/windows/ViewPort.h -+++ b/SofaImGui/src/SofaImGui/windows/ViewPort.h -@@ -23,6 +23,7 @@ - - #include - #include "WindowState.h" -+#include - - namespace windows - { --- -2.43.0 - diff --git a/recipes/sofa-glfw/patches/0002-hide-SimpleIni-to-impl-and-do-not-expose-private-hea.patch b/recipes/sofa-glfw/patches/0002-hide-SimpleIni-to-impl-and-do-not-expose-private-hea.patch deleted file mode 100644 index 3dbad68a54879..0000000000000 --- a/recipes/sofa-glfw/patches/0002-hide-SimpleIni-to-impl-and-do-not-expose-private-hea.patch +++ /dev/null @@ -1,305 +0,0 @@ -From 8851eec4388ea81725edd8f56ac9af37139c5a5b Mon Sep 17 00:00:00 2001 -From: Olivier Roussel -Date: Wed, 7 Jan 2026 17:44:00 +0100 -Subject: [PATCH] hide SimpleIni to impl and do not expose private headers - ViewPort.h and Settings.h - -do not expose Performances.h header as it includes imgui - -fix SimpleIni target as private - -fix imgui headers are not part of SofaImGui anymore, must be treated as dependency ---- - SofaImGui/CMakeLists.txt | 5 +- - SofaImGui/SofaImGuiConfig.cmake.in | 4 -- - .../SofaImGui.Camera/CMakeLists.txt | 11 ++++ - SofaImGui/src/SofaImGui/AppIniFile.cpp | 1 - - SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp | 65 +++++++++++-------- - SofaImGui/src/SofaImGui/ImGuiGUIEngine.h | 8 ++- - 6 files changed, 54 insertions(+), 40 deletions(-) - -diff --git a/SofaImGui/CMakeLists.txt b/SofaImGui/CMakeLists.txt -index 74fa7fd..33bab61 100644 ---- a/SofaImGui/CMakeLists.txt -+++ b/SofaImGui/CMakeLists.txt -@@ -99,7 +99,6 @@ set(HEADER_FILES - ${SOFAIMGUI_SOURCE_DIR}/widgets/LinearSpringWidget.h - ${SOFAIMGUI_SOURCE_DIR}/widgets/MaterialWidget.h - ${SOFAIMGUI_SOURCE_DIR}/widgets/ScalarWidget.h -- ${SOFAIMGUI_SOURCE_DIR}/windows/Performances.h - ${SOFAIMGUI_SOURCE_DIR}/windows/Log.h - ${SOFAIMGUI_SOURCE_DIR}/windows/MouseManager.h - ${SOFAIMGUI_SOURCE_DIR}/windows/Profiler.h -@@ -107,8 +106,6 @@ set(HEADER_FILES - ${SOFAIMGUI_SOURCE_DIR}/windows/DisplayFlags.h - ${SOFAIMGUI_SOURCE_DIR}/windows/Plugins.h - ${SOFAIMGUI_SOURCE_DIR}/windows/Components.h -- ${SOFAIMGUI_SOURCE_DIR}/windows/Settings.h -- ${SOFAIMGUI_SOURCE_DIR}/windows/ViewPort.h - ${SOFAIMGUI_SOURCE_DIR}/AppIniFile.h - ${SOFAIMGUI_SOURCE_DIR}/windows/WindowState.h - ${SOFAIMGUI_SOURCE_DIR}/guis/BaseAdditionalGUI.h -@@ -148,7 +145,7 @@ add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES} ${IMGUI_SOURC - target_include_directories(${PROJECT_NAME} PUBLIC "$") - target_link_libraries(${PROJECT_NAME} PUBLIC SofaGLFW Sofa.GL.Component.Rendering3D ${CMAKE_DL_LIBS}) - target_link_libraries(${PROJECT_NAME} PRIVATE nfd) --target_link_libraries(${PROJECT_NAME} PUBLIC SimpleIni::SimpleIni) -+target_link_libraries(${PROJECT_NAME} PRIVATE SimpleIni::SimpleIni) - - # setup the same API exports for imgui - target_compile_definitions(${PROJECT_NAME} PUBLIC IMGUI_API=SOFAIMGUI_API) -diff --git a/SofaImGui/SofaImGuiConfig.cmake.in b/SofaImGui/SofaImGuiConfig.cmake.in -index 11e228d..cfc50d5 100644 ---- a/SofaImGui/SofaImGuiConfig.cmake.in -+++ b/SofaImGui/SofaImGuiConfig.cmake.in -@@ -6,10 +6,6 @@ - find_package(SofaGLFW REQUIRED) - find_package(Sofa.GL.Component.Rendering3D REQUIRED) - --if(NOT TARGET SimpleIni::SimpleIni) -- sofa_find_package(SimpleIni QUIET REQUIRED) --endif() -- - if(NOT TARGET @PROJECT_NAME@) - include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") - endif() -diff --git a/SofaImGui/extensions/SofaImGui.Camera/CMakeLists.txt b/SofaImGui/extensions/SofaImGui.Camera/CMakeLists.txt -index d287caa..31a9872 100644 ---- a/SofaImGui/extensions/SofaImGui.Camera/CMakeLists.txt -+++ b/SofaImGui/extensions/SofaImGui.Camera/CMakeLists.txt -@@ -5,6 +5,14 @@ project(SofaImGui.Camera VERSION 1.0 LANGUAGES CXX) - find_package(Sofa.Config REQUIRED) - sofa_find_package(SofaImGui REQUIRED) - -+include(FetchContent) -+ -+FetchContent_Declare(imgui -+ GIT_REPOSITORY https://github.com/ocornut/imgui -+ GIT_TAG 11b3a7c8ca23201294464c7f368614a9106af2a1 # v1.91.8-docking -+) -+FetchContent_MakeAvailable(imgui) -+ - set(HEADER_FILES - src/SofaImGui.Camera/config.h.in - src/SofaImGui.Camera/init.h -@@ -18,7 +26,10 @@ set(SOURCE_FILES - src/SofaImGui.Camera/CameraGUI.cpp - ) - -+set(IMGUI_SOURCE_DIR ${imgui_SOURCE_DIR}) -+ - add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) -+target_include_directories(${PROJECT_NAME} PUBLIC "$") - target_link_libraries(${PROJECT_NAME} PUBLIC SofaImGui) - - sofa_create_package_with_targets( -diff --git a/SofaImGui/src/SofaImGui/AppIniFile.cpp b/SofaImGui/src/SofaImGui/AppIniFile.cpp -index 4058b95..b5c5829 100644 ---- a/SofaImGui/src/SofaImGui/AppIniFile.cpp -+++ b/SofaImGui/src/SofaImGui/AppIniFile.cpp -@@ -23,7 +23,6 @@ - #include - #include - #include --#include "windows/Performances.h" - #include "AppIniFile.h" - - -diff --git a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp -index 799fe09..1d6807c 100644 ---- a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp -+++ b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.cpp -@@ -70,6 +70,7 @@ - #include //imgui_internal.h is included in order to use the DockspaceBuilder API (which is still in development) - #include - #include -+#include - #include - #include - #include -@@ -90,6 +91,11 @@ using namespace sofa; - namespace sofaimgui - { - -+struct ImGuiGUIEngine::Settings -+{ -+ CSimpleIniA ini; -+}; -+ - ImGuiGUIEngine::ImGuiGUIEngine() - : winManagerProfiler(helper::system::FileSystem::append(sofaimgui::getConfigurationFolderPath(), std::string("profiler.txt"))) - , winManagerSceneGraph(helper::system::FileSystem::append(sofaimgui::getConfigurationFolderPath(), std::string("scenegraph.txt"))) -@@ -106,6 +112,9 @@ ImGuiGUIEngine::ImGuiGUIEngine() - { - } - -+ImGuiGUIEngine::~ImGuiGUIEngine() -+{} -+ - void ImGuiGUIEngine::init() - { - IMGUI_CHECKVERSION(); -@@ -124,22 +133,21 @@ void ImGuiGUIEngine::init() - io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; - io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; - -- -- -- ini.SetUnicode(); -+ settings = std::make_unique(); -+ settings->ini.SetUnicode(); - if (sofa::helper::system::FileSystem::exists(sofaimgui::AppIniFile::getAppIniFile())) - { -- SI_Error rc = ini.LoadFile(sofaimgui::AppIniFile::getAppIniFile().c_str()); -+ SI_Error rc = settings->ini.LoadFile(sofaimgui::AppIniFile::getAppIniFile().c_str()); - assert(rc == SI_OK); - msg_info("ImGuiGUIEngine") << "Fetching settings from " << sofaimgui::AppIniFile::getAppIniFile(); - } - - const char* pv; -- pv = ini.GetValue("Style", "theme"); -+ pv = settings->ini.GetValue("Style", "theme"); - if (!pv) - { -- ini.SetValue("Style", "theme", sofaimgui::defaultStyle.c_str(), ini::styleDescription); -- SI_Error rc = ini.SaveFile(sofaimgui::AppIniFile::getAppIniFile().c_str()); -+ settings->ini.SetValue("Style", "theme", sofaimgui::defaultStyle.c_str(), ini::styleDescription); -+ SI_Error rc = settings->ini.SaveFile(sofaimgui::AppIniFile::getAppIniFile().c_str()); - if (rc != SI_OK) - { - msg_error("ImGuiGUIEngine") << std::strerror(errno) << "'" << sofaimgui::AppIniFile::getAppIniFile() << "'"; -@@ -189,18 +197,18 @@ void ImGuiGUIEngine::initBackend(GLFWwindow* glfwWindow) - io.Fonts->AddFontFromMemoryCompressedTTF(FA_SOLID_900_compressed_data, FA_SOLID_900_compressed_size, 16 * yscale, &config, icon_ranges); - - // restore the global scale stored in the Settings ini file -- const float globalScale = static_cast(ini.GetDoubleValue("Visualization", "globalScale", 1.0)); -+ const float globalScale = static_cast(settings->ini.GetDoubleValue("Visualization", "globalScale", 1.0)); - this->setScale(globalScale, windowMonitor); - } - - // restore window settings if set -- const bool rememberWindowPosition = ini.GetBoolValue("Window", "rememberWindowPosition", true); -+ const bool rememberWindowPosition = settings->ini.GetBoolValue("Window", "rememberWindowPosition", true); - if(rememberWindowPosition) - { -- if(ini.KeyExists("Window", "windowPosX") && ini.KeyExists("Window", "windowPosY")) -+ if(settings->ini.KeyExists("Window", "windowPosX") && settings->ini.KeyExists("Window", "windowPosY")) - { -- const long windowPosX = ini.GetLongValue("Window", "windowPosX"); -- const long windowPosY = ini.GetLongValue("Window", "windowPosY"); -+ const long windowPosX = settings->ini.GetLongValue("Window", "windowPosX"); -+ const long windowPosY = settings->ini.GetLongValue("Window", "windowPosY"); - - int monitorCount; - GLFWmonitor** monitors = glfwGetMonitors(&monitorCount); -@@ -247,13 +255,13 @@ void ImGuiGUIEngine::initBackend(GLFWwindow* glfwWindow) - - } - -- const bool rememberWindowSize = ini.GetBoolValue("Window", "rememberWindowSize", true); -+ const bool rememberWindowSize = settings->ini.GetBoolValue("Window", "rememberWindowSize", true); - if(rememberWindowSize) - { -- if(ini.KeyExists("Window", "windowSizeX") && ini.KeyExists("Window", "windowSizeY")) -+ if(settings->ini.KeyExists("Window", "windowSizeX") && settings->ini.KeyExists("Window", "windowSizeY")) - { -- const long windowSizeX = ini.GetLongValue("Window", "windowSizeX"); -- const long windowSizeY = ini.GetLongValue("Window", "windowSizeY"); -+ const long windowSizeX = settings->ini.GetLongValue("Window", "windowSizeX"); -+ const long windowSizeY = settings->ini.GetLongValue("Window", "windowSizeY"); - if(windowSizeX > 0 && windowSizeY > 0) - { - glfwSetWindowSize(glfwWindow, static_cast(windowSizeX), static_cast(windowSizeY)); -@@ -313,7 +321,7 @@ void ImGuiGUIEngine::startFrame(sofaglfw::SofaGLFWBaseGUI* baseGUI) - - auto groot = baseGUI->getRootNode(); - -- bool alwaysShowFrame = ini.GetBoolValue("Visualization", "alwaysShowFrame", true); -+ bool alwaysShowFrame = settings->ini.GetBoolValue("Visualization", "alwaysShowFrame", true); - if (alwaysShowFrame) - { - auto sceneFrame = groot->get(); -@@ -671,9 +679,9 @@ void ImGuiGUIEngine::startFrame(sofaglfw::SofaGLFWBaseGUI* baseGUI) - /*************************************** - * Viewport window - **************************************/ -- showViewPort(groot, windowNameViewport, ini, m_fbo, m_viewportWindowSize, -- isMouseOnViewport, winManagerViewPort, baseGUI, -- isViewportDisplayedForTheFirstTime, lastViewPortPos); -+ showViewPort(groot, windowNameViewport, settings->ini, m_fbo, m_viewportWindowSize, -+ isMouseOnViewport, winManagerViewPort, baseGUI, -+ isViewportDisplayedForTheFirstTime, lastViewPortPos); - - - /*************************************** -@@ -731,7 +739,7 @@ void ImGuiGUIEngine::startFrame(sofaglfw::SofaGLFWBaseGUI* baseGUI) - /*************************************** - * Settings window - **************************************/ -- windows::showSettings(windowNameSettings,ini, winManagerSettings, this); -+ windows::showSettings(windowNameSettings, settings->ini, winManagerSettings, this); - - ImGui::Render(); - #if SOFAIMGUI_FORCE_OPENGL2 == 1 -@@ -815,17 +823,18 @@ void ImGuiGUIEngine::afterDraw() - - void ImGuiGUIEngine::terminate() - { -+ - // store window state (position and size) - const auto lastWindowPos = ImGui::GetMainViewport()->Pos; - const auto lastWindowSize = ImGui::GetMainViewport()->Size; -- -+ - // save latest window state -- ini.SetLongValue("Window", "windowPosX", static_cast(lastWindowPos.x)); -- ini.SetLongValue("Window", "windowPosY", static_cast(lastWindowPos.y)); -- ini.SetLongValue("Window", "windowSizeX", static_cast(lastWindowSize.x)); -- ini.SetLongValue("Window", "windowSizeY", static_cast(lastWindowSize.y)); -- [[maybe_unused]] SI_Error rc = ini.SaveFile(sofaimgui::AppIniFile::getAppIniFile().c_str()); -- -+ settings->ini.SetLongValue("Window", "windowPosX", static_cast(lastWindowPos.x)); -+ settings->ini.SetLongValue("Window", "windowPosY", static_cast(lastWindowPos.y)); -+ settings->ini.SetLongValue("Window", "windowSizeX", static_cast(lastWindowSize.x)); -+ settings->ini.SetLongValue("Window", "windowSizeY", static_cast(lastWindowSize.y)); -+ [[maybe_unused]] SI_Error rc = settings->ini.SaveFile(sofaimgui::AppIniFile::getAppIniFile().c_str()); -+ - NFD_Quit(); - - #if SOFAIMGUI_FORCE_OPENGL2 == 1 -diff --git a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h -index ee1e2f7..802d6d5 100644 ---- a/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h -+++ b/SofaImGui/src/SofaImGui/ImGuiGUIEngine.h -@@ -28,7 +28,6 @@ - - #include "guis/AdditionalGUIRegistry.h" - #include "windows/WindowState.h" --#include - #include - - using windows::WindowState; -@@ -49,7 +48,7 @@ class ImGuiGUIEngine : public sofaglfw::BaseGUIEngine - public: - - ImGuiGUIEngine() ; -- ~ImGuiGUIEngine() = default; -+ ~ImGuiGUIEngine(); - - void init() override; - void initBackend(GLFWwindow*) override; -@@ -71,7 +70,10 @@ protected: - std::pair m_currentFBOSize; - std::pair m_viewportWindowSize; - bool isMouseOnViewport { false }; -- CSimpleIniA ini; -+ -+ struct Settings; -+ std::unique_ptr settings; -+ - void loadFile(sofaglfw::SofaGLFWBaseGUI* baseGUI, sofa::core::sptr& groot, std::string filePathName, bool reload = false); - - using _ImGuiID = unsigned int; --- -2.43.0 - diff --git a/recipes/sofa-glfw/patches/0003-fix-SofaGLFW-cmake-config-in-with-missing-gflw.patch b/recipes/sofa-glfw/patches/0003-fix-SofaGLFW-cmake-config-in-with-missing-gflw.patch deleted file mode 100644 index 811dcdb383794..0000000000000 --- a/recipes/sofa-glfw/patches/0003-fix-SofaGLFW-cmake-config-in-with-missing-gflw.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 7723f10811a80258983132bf8b372475cb3401a5 Mon Sep 17 00:00:00 2001 -From: Olivier Roussel -Date: Fri, 9 Jan 2026 14:03:36 +0100 -Subject: [PATCH] fix SofaGLFW cmake config in with missing gflw - ---- - SofaGLFW/SofaGLFWConfig.cmake.in | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/SofaGLFW/SofaGLFWConfig.cmake.in b/SofaGLFW/SofaGLFWConfig.cmake.in -index 009e4de..b84ca58 100644 ---- a/SofaGLFW/SofaGLFWConfig.cmake.in -+++ b/SofaGLFW/SofaGLFWConfig.cmake.in -@@ -8,6 +8,9 @@ find_package(Sofa.Simulation.Graph REQUIRED) - find_package(Sofa.GL REQUIRED) - find_package(Sofa.Component.Visual REQUIRED) - find_package(Sofa.GUI.Common QUIET) -+if(NOT TARGET glfw) -+ sofa_find_package(glfw3 QUIET REQUIRED) -+endif() - - if(NOT TARGET @PROJECT_NAME@) - include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") --- -2.43.0 - diff --git a/recipes/sofa-glfw/recipe.yaml b/recipes/sofa-glfw/recipe.yaml index 4e6fb2f3568a4..62a4517554ec9 100644 --- a/recipes/sofa-glfw/recipe.yaml +++ b/recipes/sofa-glfw/recipe.yaml @@ -1,6 +1,6 @@ context: name: sofa-glfw - version: "25.06.00" + version: "25.12.00" major_minor: ${{ (version | split('.'))[:2] | join('.') }} package: @@ -9,14 +9,7 @@ package: source: url: https://github.com/sofa-framework/SofaGLFW/archive/refs/tags/release-v${{ major_minor }}.tar.gz - sha256: 97aac0871967495f5002d0a43cd0374772c8ea72adbfaa3be4e9431f5d056297 - - patches: - # For the 3 following patches: - # https://github.com/sofa-framework/SofaGLFW/pull/256 - - patches/0001-remove-imgui.h-from-ImgGuiGUIEngine-header.patch - - patches/0002-hide-SimpleIni-to-impl-and-do-not-expose-private-hea.patch - - patches/0003-fix-SofaGLFW-cmake-config-in-with-missing-gflw.patch + sha256: 7f086b9053f28e734c8b776171de5d3663c146c9f9f34a6f27def2a111fc7923 build: number: 0 diff --git a/recipes/sofa-modelorderreduction/recipe.yaml b/recipes/sofa-modelorderreduction/recipe.yaml index 8161ac5d125a2..eea5c8b79a6af 100644 --- a/recipes/sofa-modelorderreduction/recipe.yaml +++ b/recipes/sofa-modelorderreduction/recipe.yaml @@ -1,6 +1,6 @@ context: name: sofa-modelorderreduction - version: "25.06.00" + version: "25.12.00" major_minor: ${{ (version | split('.'))[:2] | join('.') }} package: @@ -9,7 +9,7 @@ package: source: url: https://github.com/SofaDefrost/ModelOrderReduction/archive/refs/tags/release-v${{ major_minor }}.tar.gz - sha256: 8b7c2b13fd6d92d71031894434bf4a987b2f79b06ad801ca892bc9704d1a4464 + sha256: cc7946a6acc7f3c082c131cfd82797dd95f0ebe6c1808018939f3b7e34afe8a0 build: number: 0 diff --git a/recipes/sofa-python3/recipe.yaml b/recipes/sofa-python3/recipe.yaml index ef036774c9970..0dfd7ee2cf5b2 100644 --- a/recipes/sofa-python3/recipe.yaml +++ b/recipes/sofa-python3/recipe.yaml @@ -1,6 +1,6 @@ context: name: sofa-python3 - version: "25.06.00" + version: "25.12.00" major_minor: ${{ (version | split('.'))[:2] | join('.') }} package: @@ -9,7 +9,7 @@ package: source: url: https://github.com/sofa-framework/SofaPython3/archive/refs/tags/release-v${{ major_minor }}.tar.gz - sha256: 30118f4d0ec21f442f05bd4fcb05af62a02b9c2e8d17bb087f56ea2f1a2ac63e + sha256: ee2dd23aa19d302689296ec40dc058b29b676b7d037051f0ed4a810db3317dc1 patches: # See comments in sofa conda package recipe at file diff --git a/recipes/sofa-softrobots/patches/0001-only-requires-Qt5-if-interactive-control-cmake-optio.patch b/recipes/sofa-softrobots/patches/0001-only-requires-Qt5-if-interactive-control-cmake-optio.patch deleted file mode 100644 index f579366051468..0000000000000 --- a/recipes/sofa-softrobots/patches/0001-only-requires-Qt5-if-interactive-control-cmake-optio.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 0f40913a43cb41533535519c9b4e4fdc62b60914 Mon Sep 17 00:00:00 2001 -From: Olivier Roussel -Date: Thu, 18 Sep 2025 15:39:49 +0200 -Subject: [PATCH] only requires Qt5 if interactive control cmake option is ON - ---- - SoftRobotsConfig.cmake.in | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/SoftRobotsConfig.cmake.in b/SoftRobotsConfig.cmake.in -index 9000ee8..d665d04 100644 ---- a/SoftRobotsConfig.cmake.in -+++ b/SoftRobotsConfig.cmake.in -@@ -13,7 +13,10 @@ find_package(Sofa.Component.Controller QUIET REQUIRED) - find_package(Sofa.Component.SolidMechanics.Spring QUIET REQUIRED) - find_package(Sofa.Component.Mapping QUIET REQUIRED) - find_package(Sofa.Component.StateContainer QUIET REQUIRED) --find_package(Qt5 QUIET REQUIRED COMPONENTS Network) -+ -+if(SOFTROBOTS_INTERACTIVECONTROL) -+ find_package(Qt5 QUIET REQUIRED COMPONENTS Network) -+endif() - - if(SOFTROBOTS_HAVE_SOFAPYTHON) - find_package(SofaPython QUIET REQUIRED) --- -2.34.1 - diff --git a/recipes/sofa-softrobots/recipe.yaml b/recipes/sofa-softrobots/recipe.yaml index 010b7e391ac2b..e68ebe0f7b211 100644 --- a/recipes/sofa-softrobots/recipe.yaml +++ b/recipes/sofa-softrobots/recipe.yaml @@ -1,6 +1,6 @@ context: name: sofa-softrobots - version: "25.06.00" + version: "25.12.00" major_minor: ${{ (version | split('.'))[:2] | join('.') }} package: @@ -9,11 +9,7 @@ package: source: url: https://github.com/SofaDefrost/SoftRobots/archive/refs/tags/release-v${{ major_minor }}.tar.gz - sha256: 87d9d693851315de2c369cfcc8ce3324dc7ca949887604b5041a0d3a26f0b590 - - patches: - # https://github.com/SofaDefrost/SoftRobots/pull/339 - - patches/0001-only-requires-Qt5-if-interactive-control-cmake-optio.patch + sha256: 280edf9dc877d79cedf26b1ce02bbb8bec9d5541a44aacbd0ef40cb59a15574b build: number: 0 diff --git a/recipes/sofa-softrobotsinverse/recipe.yaml b/recipes/sofa-softrobotsinverse/recipe.yaml index 20d55add16428..aaee009d6c607 100644 --- a/recipes/sofa-softrobotsinverse/recipe.yaml +++ b/recipes/sofa-softrobotsinverse/recipe.yaml @@ -1,6 +1,6 @@ context: name: sofa-softrobotsinverse - version: "25.06.00" + version: "25.12.00" major_minor: ${{ (version | split('.'))[:2] | join('.') }} package: @@ -9,7 +9,7 @@ package: source: url: https://github.com/SofaDefrost/SoftRobots.Inverse/archive/refs/tags/release-v${{ major_minor }}.tar.gz - sha256: a7158e2423a94aa2aa7b0f9f2fa81eea95acd5f48a49e2de09ab95b43e42bd83 + sha256: 881f2b0a998eda59bad7200279605e943fb8f305c1eb835a4a46977224b5c906 build: number: 0 diff --git a/recipes/sofa-stlib/recipe.yaml b/recipes/sofa-stlib/recipe.yaml index 9b1576a32ccca..62fcb8ed6430d 100644 --- a/recipes/sofa-stlib/recipe.yaml +++ b/recipes/sofa-stlib/recipe.yaml @@ -1,6 +1,6 @@ context: name: sofa-stlib - version: "25.06.00" + version: "25.12.00" major_minor: ${{ (version | split('.'))[:2] | join('.') }} package: @@ -9,7 +9,7 @@ package: source: url: https://github.com/SofaDefrost/STLIB/archive/refs/tags/release-v${{ major_minor }}.tar.gz - sha256: 707b89949f6b2153415ff8ea88fe0d135798560e65b477b437176369e1279e54 + sha256: 72271a4d1af70f617db5f89a4b37a8ef3fc5a9f82a15ca7eedc8f547bc3a209b build: number: 0 From a833ac2d2d0e767087316a2f8ebb908e0590a6ac Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Fri, 13 Mar 2026 20:13:16 +0100 Subject: [PATCH 10/13] fix tests to match new headers location --- recipes/sofa-beamadapter/recipe.yaml | 2 +- recipes/sofa-cosserat/recipe.yaml | 2 +- recipes/sofa-glfw/recipe.yaml | 4 ++-- recipes/sofa-modelorderreduction/recipe.yaml | 2 +- recipes/sofa-softrobots/recipe.yaml | 2 +- recipes/sofa-softrobotsinverse/recipe.yaml | 2 +- recipes/sofa-stlib/recipe.yaml | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/recipes/sofa-beamadapter/recipe.yaml b/recipes/sofa-beamadapter/recipe.yaml index 82da56f9d13bf..a4f73b6d1b29a 100644 --- a/recipes/sofa-beamadapter/recipe.yaml +++ b/recipes/sofa-beamadapter/recipe.yaml @@ -32,7 +32,7 @@ requirements: tests: - package_contents: include: - - BeamAdapter/config.h + - BeamAdapter/BeamAdapter/config.h lib: - BeamAdapter - script: diff --git a/recipes/sofa-cosserat/recipe.yaml b/recipes/sofa-cosserat/recipe.yaml index e28d1cdb5f5be..67355f9fd25ef 100644 --- a/recipes/sofa-cosserat/recipe.yaml +++ b/recipes/sofa-cosserat/recipe.yaml @@ -40,7 +40,7 @@ requirements: tests: - package_contents: include: - - Cosserat/config.h + - Cosserat/Cosserat/config.h lib: - Cosserat - script: diff --git a/recipes/sofa-glfw/recipe.yaml b/recipes/sofa-glfw/recipe.yaml index 62a4517554ec9..036a5e9ea7220 100644 --- a/recipes/sofa-glfw/recipe.yaml +++ b/recipes/sofa-glfw/recipe.yaml @@ -49,8 +49,8 @@ requirements: tests: - package_contents: include: - - SofaGLFW/config.h - - SofaImGui/config.h + - SofaGLFW/SofaGLFW/config.h + - SofaImGui/SofaImGui/config.h lib: - SofaGLFW - SofaImGui diff --git a/recipes/sofa-modelorderreduction/recipe.yaml b/recipes/sofa-modelorderreduction/recipe.yaml index eea5c8b79a6af..538b9b7f5d965 100644 --- a/recipes/sofa-modelorderreduction/recipe.yaml +++ b/recipes/sofa-modelorderreduction/recipe.yaml @@ -40,7 +40,7 @@ requirements: tests: - package_contents: include: - - ModelOrderReduction/config.h + - ModelOrderReduction/ModelOrderReduction/config.h lib: - ModelOrderReduction - script: diff --git a/recipes/sofa-softrobots/recipe.yaml b/recipes/sofa-softrobots/recipe.yaml index e68ebe0f7b211..84c30b9f14969 100644 --- a/recipes/sofa-softrobots/recipe.yaml +++ b/recipes/sofa-softrobots/recipe.yaml @@ -41,7 +41,7 @@ requirements: tests: - package_contents: include: - - SoftRobots/component/initSoftRobots.h + - SoftRobots/SoftRobots/component/initSoftRobots.h lib: - SoftRobots - script: diff --git a/recipes/sofa-softrobotsinverse/recipe.yaml b/recipes/sofa-softrobotsinverse/recipe.yaml index aaee009d6c607..00a154101a6a1 100644 --- a/recipes/sofa-softrobotsinverse/recipe.yaml +++ b/recipes/sofa-softrobotsinverse/recipe.yaml @@ -45,7 +45,7 @@ requirements: tests: - package_contents: include: - - SoftRobots.Inverse/component/config.h + - SoftRobots.Inverse/SoftRobots.Inverse/component/config.h lib: - SoftRobots.Inverse - script: diff --git a/recipes/sofa-stlib/recipe.yaml b/recipes/sofa-stlib/recipe.yaml index 62fcb8ed6430d..ddfa1ca39129a 100644 --- a/recipes/sofa-stlib/recipe.yaml +++ b/recipes/sofa-stlib/recipe.yaml @@ -37,7 +37,7 @@ requirements: tests: - package_contents: include: - - STLIB/initPlugin.h + - STLIB/STLIB/initPlugin.h lib: - STLIB - script: From a7dc84ae4d9f8eb629349a26ce7e81d1d9597a2a Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Fri, 13 Mar 2026 20:22:43 +0100 Subject: [PATCH 11/13] update osx patch for sofa-python3 --- ...otfix-for-libpython-linking-on-macOS.patch | 431 +++++++++--------- 1 file changed, 216 insertions(+), 215 deletions(-) diff --git a/recipes/sofa-python3/patches/0001-hotfix-for-libpython-linking-on-macOS.patch b/recipes/sofa-python3/patches/0001-hotfix-for-libpython-linking-on-macOS.patch index 52555c0b45837..38ccad7939be8 100644 --- a/recipes/sofa-python3/patches/0001-hotfix-for-libpython-linking-on-macOS.patch +++ b/recipes/sofa-python3/patches/0001-hotfix-for-libpython-linking-on-macOS.patch @@ -1,215 +1,216 @@ -From f498ada2dca16d8159acbf083786fe6187e4d843 Mon Sep 17 00:00:00 2001 -From: Olivier Roussel -Date: Thu, 4 Apr 2024 13:56:36 +0200 -Subject: [PATCH] hotfix for libpython linking on macOS - ---- - CMake/SofaPython3Tools.cmake | 34 +------------------------------ - CMakeLists.txt | 39 ------------------------------------ - Plugin/CMakeLists.txt | 12 ++++++++++- - SofaPython3Config.cmake.in | 37 ---------------------------------- - Testing/CMakeLists.txt | 5 +++++ - 5 files changed, 17 insertions(+), 110 deletions(-) - -diff --git a/CMake/SofaPython3Tools.cmake b/CMake/SofaPython3Tools.cmake -index 678743f..e59bf80 100644 ---- a/CMake/SofaPython3Tools.cmake -+++ b/CMake/SofaPython3Tools.cmake -@@ -117,41 +117,9 @@ function(SP3_add_python_module) - # We are doing manually what's usually done with pybind11_add_module(${A_TARGET} SHARED "${A_SOURCES}") - # since we got some problems on MacOS using recent versions of pybind11 where the SHARED argument wasn't taken - # into account -- python_add_library(${A_TARGET} SHARED ${A_HEADERS} ${A_SOURCES}) -+ pybind11_add_module(${A_TARGET} SHARED ${A_HEADERS} ${A_SOURCES}) - add_library(SofaPython3::${A_TARGET} ALIAS ${A_TARGET}) - -- if ("${pybind11_VERSION}" VERSION_GREATER_EQUAL "2.6.0") -- target_link_libraries(${A_TARGET} PRIVATE pybind11::headers) -- target_link_libraries(${A_TARGET} PRIVATE pybind11::embed) -- target_link_libraries(${A_TARGET} PRIVATE pybind11::lto) -- if(MSVC) -- target_link_libraries(${A_TARGET} PRIVATE pybind11::windows_extras) -- endif() -- -- pybind11_extension(${A_TARGET}) -- pybind11_strip(${A_TARGET}) -- else() -- target_link_libraries(${A_TARGET} PRIVATE pybind11::module) -- -- # Equivalent to pybind11_extension(${A_TARGET}) which doesn't exists on pybind11 versions < 5 -- set_target_properties(${A_TARGET} PROPERTIES PREFIX "" SUFFIX "${PYTHON_MODULE_EXTENSION}") -- -- if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo) -- # Equivalent to pybind11_strip(${A_TARGET}) which doesn't exists on pybind11 versions < 5 -- # Strip unnecessary sections of the binary on Linux/macOS -- if(CMAKE_STRIP) -- if(APPLE) -- set(x_opt -x) -- endif() -- -- add_custom_command( -- TARGET ${A_TARGET} -- POST_BUILD -- COMMAND ${CMAKE_STRIP} ${x_opt} $) -- endif() -- endif() -- endif() -- - set_target_properties(${A_TARGET} - PROPERTIES - CXX_VISIBILITY_PRESET "hidden" -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 3774e67..4902809 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -82,35 +82,6 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) - # Set the minimum python version to 3.7 - set(PYBIND11_PYTHON_VERSION 3.7) - --# Find Python3 --find_package(Python ${PYBIND11_PYTHON_VERSION} COMPONENTS Interpreter Development REQUIRED) -- --# Save PYTHON_* vars --set(PYTHON_VERSION_RESET "${PYTHON_VERSION}") --set(PYTHON_EXECUTABLE_RESET "${PYTHON_EXECUTABLE}") --set(PYTHON_LIBRARIES_RESET "${PYTHON_LIBRARIES}") --set(PYTHON_INCLUDE_DIRS_RESET "${PYTHON_INCLUDE_DIRS}") --set(PYTHON_LIBRARY_RESET "${PYTHON_LIBRARY}") --set(PYTHON_INCLUDE_DIR_RESET "${PYTHON_INCLUDE_DIR}") -- --# Change PYTHON_* vars before pybind11 find_package --# to be sure that pybind11 relies on the right Python version --set(PYTHON_VERSION "${Python_VERSION}" CACHE STRING "" FORCE) --set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}" CACHE FILEPATH "" FORCE) --set(PYTHON_LIBRARIES "${Python_LIBRARIES}" CACHE STRING "" FORCE) --set(PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}" CACHE STRING "" FORCE) --if(EXISTS "${Python_LIBRARY}") -- set(PYTHON_LIBRARY "${Python_LIBRARY}" CACHE INTERNAL "" FORCE) --elseif(EXISTS "${Python_LIBRARIES}") -- set(PYTHON_LIBRARY "${Python_LIBRARIES}" CACHE INTERNAL "" FORCE) --endif() --if(EXISTS "${Python_INCLUDE_DIR}") -- set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIR}" CACHE INTERNAL "" FORCE) --elseif(EXISTS "${Python_INCLUDE_DIRS}") -- set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE) --endif() --string(REGEX MATCH "[0-9]+\.[0-9]+" PythonMAJMIN "${Python_VERSION}") -- - # Set the minimum pybind11 version to 2.3 (before that the pybind11::embed target did not exist) - find_package(pybind11 2.3 CONFIG QUIET REQUIRED) - -@@ -146,8 +117,6 @@ message(STATUS "Python: - Libraries: ${Python_LIBRARIES} - User site: ${PYTHON_USER_SITE}" - ) -- -- - message(STATUS "pybind11: - Version: ${pybind11_VERSION} - Config: ${pybind11_CONFIG}" -@@ -246,11 +215,3 @@ if (SP3_LINK_TO_USER_SITE AND SP3_PYTHON_PACKAGES_LINK_DIRECTORY) - endif() - endforeach() - endif() -- --# Reset PYTHON_* vars --set(PYTHON_VERSION "${PYTHON_VERSION_RESET}" CACHE STRING "" FORCE) --set(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE_RESET}" CACHE FILEPATH "" FORCE) --set(PYTHON_LIBRARIES "${PYTHON_LIBRARIES_RESET}" CACHE STRING "" FORCE) --set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS_RESET}" CACHE STRING "" FORCE) --set(PYTHON_LIBRARY "${PYTHON_LIBRARY_RESET}" CACHE INTERNAL "" FORCE) --set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_DIR_RESET}" CACHE INTERNAL "" FORCE) -diff --git a/Plugin/CMakeLists.txt b/Plugin/CMakeLists.txt -index f53e987..7cd08e4 100644 ---- a/Plugin/CMakeLists.txt -+++ b/Plugin/CMakeLists.txt -@@ -35,7 +35,17 @@ add_library(SofaPython3::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) - target_compile_definitions(${PROJECT_NAME} PRIVATE "-DSOFA_BUILD_SOFAPYTHON3") - - target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Graph) --target_link_libraries(${PROJECT_NAME} PUBLIC pybind11::module pybind11::embed) -+ -+# The public linking with pybind lead to have a link with libpython which -+# propagates in the python module .so. On macOS, this extra link with libpython -+# lead to segv when importing the python module in versions of python that don't -+# have a dynamic link with libpython (such as the one provided by conda which is linked -+# statically), but works fine with versions that have such link. -+if(CMAKE_SYSTEM_NAME STREQUAL Darwin) -+ target_link_libraries(${PROJECT_NAME} PRIVATE pybind11::pybind11 pybind11::python_link_helper) -+else() -+ target_link_libraries(${PROJECT_NAME} PUBLIC pybind11::embed) -+endif() - - set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME SofaPython3) - -diff --git a/SofaPython3Config.cmake.in b/SofaPython3Config.cmake.in -index 2c3410a..8922133 100644 ---- a/SofaPython3Config.cmake.in -+++ b/SofaPython3Config.cmake.in -@@ -8,47 +8,10 @@ set(SP3_PYTHON_PACKAGES_DIRECTORY @SP3_PYTHON_PACKAGES_DIRECTORY@) - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") - include(SofaPython3Tools) - --# Find Python3 --if(NOT Python_FOUND) -- find_package(Python @PythonMAJMIN@ EXACT QUIET REQUIRED COMPONENTS Interpreter Development) --endif() - - # Find pybind11 - if(NOT pybind11_FOUND) -- # Save PYTHON_* vars -- set(PYTHON_VERSION_RESET "${PYTHON_VERSION}") -- set(PYTHON_EXECUTABLE_RESET "${PYTHON_EXECUTABLE}") -- set(PYTHON_LIBRARIES_RESET "${PYTHON_LIBRARIES}") -- set(PYTHON_INCLUDE_DIRS_RESET "${PYTHON_INCLUDE_DIRS}") -- set(PYTHON_LIBRARY_RESET "${PYTHON_LIBRARY}") -- set(PYTHON_INCLUDE_DIR_RESET "${PYTHON_INCLUDE_DIR}") -- -- # Change PYTHON_* vars before pybind11 find_package -- # to be sure that pybind11 relies on the right Python version -- set(PYTHON_VERSION "${Python_VERSION}" CACHE STRING "" FORCE) -- set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}" CACHE FILEPATH "" FORCE) -- set(PYTHON_LIBRARIES "${Python_LIBRARIES}" CACHE STRING "" FORCE) -- set(PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}" CACHE STRING "" FORCE) -- if(EXISTS "${Python_LIBRARY}") -- set(PYTHON_LIBRARY "${Python_LIBRARY}" CACHE INTERNAL "" FORCE) -- elseif(EXISTS "${Python_LIBRARIES}") -- set(PYTHON_LIBRARY "${Python_LIBRARIES}" CACHE INTERNAL "" FORCE) -- endif() -- if(EXISTS "${Python_INCLUDE_DIR}") -- set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIR}" CACHE INTERNAL "" FORCE) -- elseif(EXISTS "${Python_INCLUDE_DIRS}") -- set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE) -- endif() -- - find_package(pybind11 @pybind11_VERSION@ QUIET REQUIRED CONFIG) -- -- # Reset PYTHON_* vars -- set(PYTHON_VERSION "${PYTHON_VERSION_RESET}" CACHE STRING "" FORCE) -- set(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE_RESET}" CACHE FILEPATH "" FORCE) -- set(PYTHON_LIBRARIES "${PYTHON_LIBRARIES_RESET}" CACHE STRING "" FORCE) -- set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS_RESET}" CACHE STRING "" FORCE) -- set(PYTHON_LIBRARY "${PYTHON_LIBRARY_RESET}" CACHE INTERNAL "" FORCE) -- set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_DIR_RESET}" CACHE INTERNAL "" FORCE) - endif() - - # Find SofaPython3::XXXXX -diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt -index becc5fa..c7f0adc 100644 ---- a/Testing/CMakeLists.txt -+++ b/Testing/CMakeLists.txt -@@ -17,6 +17,11 @@ set(SOURCE_FILES - - add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) - target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Testing SofaPython3::Plugin) -+# We wan't the pybind11 dependency to propagate to SofaPython3Testing consumers, -+# here Bindings.*.Tests -+if(CMAKE_SYSTEM_NAME STREQUAL Darwin) -+ target_link_libraries(${PROJECT_NAME} PUBLIC pybind11::embed) -+endif() - target_compile_definitions(${PROJECT_NAME} PRIVATE "-DSOFA_BUILD_SOFAPYTHON3") - set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER Testing) - --- -2.34.1 - +From 304e092fb0165c10fe0c3ec5132673db27d9479f Mon Sep 17 00:00:00 2001 +From: Olivier Roussel +Date: Mon, 28 Jul 2025 15:44:13 +0200 +Subject: [PATCH] hotfix for libpython linking on macOS + +--- + CMake/SofaPython3Tools.cmake | 37 +------------------------------ + CMakeLists.txt | 36 ------------------------------- + Plugin/CMakeLists.txt | 12 ++++++++++- + SofaPython3Config.cmake.in | 42 ------------------------------------ + Testing/CMakeLists.txt | 5 +++++ + 5 files changed, 17 insertions(+), 115 deletions(-) + +diff --git a/CMake/SofaPython3Tools.cmake b/CMake/SofaPython3Tools.cmake +index 678743f..5436b72 100644 +--- a/CMake/SofaPython3Tools.cmake ++++ b/CMake/SofaPython3Tools.cmake +@@ -114,44 +114,9 @@ function(SP3_add_python_module) + + find_package(pybind11 CONFIG QUIET REQUIRED) + +- # We are doing manually what's usually done with pybind11_add_module(${A_TARGET} SHARED "${A_SOURCES}") +- # since we got some problems on MacOS using recent versions of pybind11 where the SHARED argument wasn't taken +- # into account +- python_add_library(${A_TARGET} SHARED ${A_HEADERS} ${A_SOURCES}) ++ pybind11_add_module(${A_TARGET} SHARED ${A_HEADERS} ${A_SOURCES}) + add_library(SofaPython3::${A_TARGET} ALIAS ${A_TARGET}) + +- if ("${pybind11_VERSION}" VERSION_GREATER_EQUAL "2.6.0") +- target_link_libraries(${A_TARGET} PRIVATE pybind11::headers) +- target_link_libraries(${A_TARGET} PRIVATE pybind11::embed) +- target_link_libraries(${A_TARGET} PRIVATE pybind11::lto) +- if(MSVC) +- target_link_libraries(${A_TARGET} PRIVATE pybind11::windows_extras) +- endif() +- +- pybind11_extension(${A_TARGET}) +- pybind11_strip(${A_TARGET}) +- else() +- target_link_libraries(${A_TARGET} PRIVATE pybind11::module) +- +- # Equivalent to pybind11_extension(${A_TARGET}) which doesn't exists on pybind11 versions < 5 +- set_target_properties(${A_TARGET} PROPERTIES PREFIX "" SUFFIX "${PYTHON_MODULE_EXTENSION}") +- +- if(NOT MSVC AND NOT ${CMAKE_BUILD_TYPE} MATCHES Debug|RelWithDebInfo) +- # Equivalent to pybind11_strip(${A_TARGET}) which doesn't exists on pybind11 versions < 5 +- # Strip unnecessary sections of the binary on Linux/macOS +- if(CMAKE_STRIP) +- if(APPLE) +- set(x_opt -x) +- endif() +- +- add_custom_command( +- TARGET ${A_TARGET} +- POST_BUILD +- COMMAND ${CMAKE_STRIP} ${x_opt} $) +- endif() +- endif() +- endif() +- + set_target_properties(${A_TARGET} + PROPERTIES + CXX_VISIBILITY_PRESET "hidden" +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d76b3e2..99040a8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -87,35 +87,6 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) + # Set the minimum python version to 3.7 + set(PYBIND11_PYTHON_VERSION 3.7) + +-# Find Python3 +-find_package(Python ${PYBIND11_PYTHON_VERSION} COMPONENTS Interpreter Development REQUIRED) +- +-# Save PYTHON_* vars +-set(PYTHON_VERSION_RESET "${PYTHON_VERSION}") +-set(PYTHON_EXECUTABLE_RESET "${PYTHON_EXECUTABLE}") +-set(PYTHON_LIBRARIES_RESET "${PYTHON_LIBRARIES}") +-set(PYTHON_INCLUDE_DIRS_RESET "${PYTHON_INCLUDE_DIRS}") +-set(PYTHON_LIBRARY_RESET "${PYTHON_LIBRARY}") +-set(PYTHON_INCLUDE_DIR_RESET "${PYTHON_INCLUDE_DIR}") +- +-# Change PYTHON_* vars before pybind11 find_package +-# to be sure that pybind11 relies on the right Python version +-set(PYTHON_VERSION "${Python_VERSION}" CACHE STRING "" FORCE) +-set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}" CACHE FILEPATH "" FORCE) +-set(PYTHON_LIBRARIES "${Python_LIBRARIES}" CACHE STRING "" FORCE) +-set(PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}" CACHE STRING "" FORCE) +-if(EXISTS "${Python_LIBRARY}") +- set(PYTHON_LIBRARY "${Python_LIBRARY}" CACHE INTERNAL "" FORCE) +-elseif(EXISTS "${Python_LIBRARIES}") +- set(PYTHON_LIBRARY "${Python_LIBRARIES}" CACHE INTERNAL "" FORCE) +-endif() +-if(EXISTS "${Python_INCLUDE_DIR}") +- set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIR}" CACHE INTERNAL "" FORCE) +-elseif(EXISTS "${Python_INCLUDE_DIRS}") +- set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE) +-endif() +-string(REGEX MATCH "[0-9]+\.[0-9]+" PythonMAJMIN "${Python_VERSION}") +- + # Set the minimum pybind11 version to 2.3 (before that the pybind11::embed target did not exist) + find_package(pybind11 2.3 CONFIG QUIET REQUIRED) + +@@ -252,10 +223,3 @@ if (SP3_LINK_TO_USER_SITE AND SP3_PYTHON_PACKAGES_LINK_DIRECTORY) + endforeach() + endif() + +-# Reset PYTHON_* vars +-set(PYTHON_VERSION "${PYTHON_VERSION_RESET}" CACHE STRING "" FORCE) +-set(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE_RESET}" CACHE FILEPATH "" FORCE) +-set(PYTHON_LIBRARIES "${PYTHON_LIBRARIES_RESET}" CACHE STRING "" FORCE) +-set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS_RESET}" CACHE STRING "" FORCE) +-set(PYTHON_LIBRARY "${PYTHON_LIBRARY_RESET}" CACHE INTERNAL "" FORCE) +-set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_DIR_RESET}" CACHE INTERNAL "" FORCE) +diff --git a/Plugin/CMakeLists.txt b/Plugin/CMakeLists.txt +index f53e987..7cd08e4 100644 +--- a/Plugin/CMakeLists.txt ++++ b/Plugin/CMakeLists.txt +@@ -35,7 +35,17 @@ add_library(SofaPython3::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) + target_compile_definitions(${PROJECT_NAME} PRIVATE "-DSOFA_BUILD_SOFAPYTHON3") + + target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Simulation.Graph) +-target_link_libraries(${PROJECT_NAME} PUBLIC pybind11::module pybind11::embed) ++ ++# The public linking with pybind lead to have a link with libpython which ++# propagates in the python module .so. On macOS, this extra link with libpython ++# lead to segv when importing the python module in versions of python that don't ++# have a dynamic link with libpython (such as the one provided by conda which is linked ++# statically), but works fine with versions that have such link. ++if(CMAKE_SYSTEM_NAME STREQUAL Darwin) ++ target_link_libraries(${PROJECT_NAME} PRIVATE pybind11::pybind11 pybind11::python_link_helper) ++else() ++ target_link_libraries(${PROJECT_NAME} PUBLIC pybind11::embed) ++endif() + + set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME SofaPython3) + +diff --git a/SofaPython3Config.cmake.in b/SofaPython3Config.cmake.in +index 52669ce..7b2177b 100644 +--- a/SofaPython3Config.cmake.in ++++ b/SofaPython3Config.cmake.in +@@ -8,55 +8,13 @@ set(SP3_PYTHON_PACKAGES_DIRECTORY @SP3_PYTHON_PACKAGES_DIRECTORY@) + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") + include(SofaPython3Tools) + +-# Find Python3 +-if(NOT TARGET Python::Python) +- if(CMAKE_VERSION VERSION_LESS "3.24.0") +- find_package(Python @PythonMAJMIN@ EXACT QUIET REQUIRED COMPONENTS Interpreter Development) +- else() +- find_package(Python @PythonMAJMIN@ EXACT QUIET REQUIRED COMPONENTS Interpreter Development GLOBAL) +- endif() +-endif() +- + # Find pybind11 + if(NOT TARGET pybind11) +- # Save PYTHON_* vars +- set(PYTHON_VERSION_RESET "${PYTHON_VERSION}") +- set(PYTHON_EXECUTABLE_RESET "${PYTHON_EXECUTABLE}") +- set(PYTHON_LIBRARIES_RESET "${PYTHON_LIBRARIES}") +- set(PYTHON_INCLUDE_DIRS_RESET "${PYTHON_INCLUDE_DIRS}") +- set(PYTHON_LIBRARY_RESET "${PYTHON_LIBRARY}") +- set(PYTHON_INCLUDE_DIR_RESET "${PYTHON_INCLUDE_DIR}") +- +- # Change PYTHON_* vars before pybind11 find_package +- # to be sure that pybind11 relies on the right Python version +- set(PYTHON_VERSION "${Python_VERSION}" CACHE STRING "" FORCE) +- set(PYTHON_EXECUTABLE "${Python_EXECUTABLE}" CACHE FILEPATH "" FORCE) +- set(PYTHON_LIBRARIES "${Python_LIBRARIES}" CACHE STRING "" FORCE) +- set(PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}" CACHE STRING "" FORCE) +- if(EXISTS "${Python_LIBRARY}") +- set(PYTHON_LIBRARY "${Python_LIBRARY}" CACHE INTERNAL "" FORCE) +- elseif(EXISTS "${Python_LIBRARIES}") +- set(PYTHON_LIBRARY "${Python_LIBRARIES}" CACHE INTERNAL "" FORCE) +- endif() +- if(EXISTS "${Python_INCLUDE_DIR}") +- set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIR}" CACHE INTERNAL "" FORCE) +- elseif(EXISTS "${Python_INCLUDE_DIRS}") +- set(PYTHON_INCLUDE_DIR "${Python_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE) +- endif() +- + if(CMAKE_VERSION VERSION_LESS "3.24.0") + find_package(pybind11 @pybind11_VERSION@ QUIET REQUIRED CONFIG) + else() + find_package(pybind11 @pybind11_VERSION@ QUIET REQUIRED CONFIG GLOBAL) + endif() +- +- # Reset PYTHON_* vars +- set(PYTHON_VERSION "${PYTHON_VERSION_RESET}" CACHE STRING "" FORCE) +- set(PYTHON_EXECUTABLE "${PYTHON_EXECUTABLE_RESET}" CACHE FILEPATH "" FORCE) +- set(PYTHON_LIBRARIES "${PYTHON_LIBRARIES_RESET}" CACHE STRING "" FORCE) +- set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIRS_RESET}" CACHE STRING "" FORCE) +- set(PYTHON_LIBRARY "${PYTHON_LIBRARY_RESET}" CACHE INTERNAL "" FORCE) +- set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_DIR_RESET}" CACHE INTERNAL "" FORCE) + endif() + + # Find SofaPython3::XXXXX +diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt +index becc5fa..c7f0adc 100644 +--- a/Testing/CMakeLists.txt ++++ b/Testing/CMakeLists.txt +@@ -17,6 +17,11 @@ set(SOURCE_FILES + + add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES}) + target_link_libraries(${PROJECT_NAME} PUBLIC Sofa.Testing SofaPython3::Plugin) ++# We wan't the pybind11 dependency to propagate to SofaPython3Testing consumers, ++# here Bindings.*.Tests ++if(CMAKE_SYSTEM_NAME STREQUAL Darwin) ++ target_link_libraries(${PROJECT_NAME} PUBLIC pybind11::embed) ++endif() + target_compile_definitions(${PROJECT_NAME} PRIVATE "-DSOFA_BUILD_SOFAPYTHON3") + set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER Testing) + +-- +2.34.1 + From f85047b3d032f5bdd45a4ab88d00967c65671c3f Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Sat, 14 Mar 2026 09:23:48 +0100 Subject: [PATCH 12/13] unvendor simpleini & use conda package --- recipes/sofa-glfw/recipe.yaml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/recipes/sofa-glfw/recipe.yaml b/recipes/sofa-glfw/recipe.yaml index 036a5e9ea7220..1693c387a0bba 100644 --- a/recipes/sofa-glfw/recipe.yaml +++ b/recipes/sofa-glfw/recipe.yaml @@ -13,12 +13,6 @@ source: build: number: 0 - files: - # SimpleIni (header-only) is still fetched and used for compilation only, but - # its CMakeLists force installation even if we do not want to include it in our package - exclude: - - ${{ "Library/" if win }}include/SimpleIni/ - - ${{ "Library/" if win }}share/cmake/SimpleIni/ requirements: build: @@ -71,9 +65,6 @@ about: - 3rdparty-licenses/IconFontCppHeaders/LICENSE.txt # ZLIB - 3rdparty-licenses/imgui/LICENSE.txt # MIT - 3rdparty-licenses/implot/LICENSE.txt # MIT - # https://github.com/conda-forge/staged-recipes/pull/31757 - # If merged, we could unvendor simpleini and use the package - - 3rdparty-licenses/simpleini/LICENSE.txt # MIT repository: https://github.com/sofa-framework/SofaGLFW extra: From 2e048d224911af163b582e7f53e691ddff4193a9 Mon Sep 17 00:00:00 2001 From: Olivier Roussel Date: Fri, 20 Mar 2026 16:25:12 +0100 Subject: [PATCH 13/13] patch sofa-python3 on windows for some duplicate modules installed --- recipes/sofa-python3/build.bat | 32 ++++++++++++++++++ recipes/sofa-python3/recipe.yaml | 16 +++++++++ .../sofa-python3/scripts/replace_str_file.py | 33 +++++++++++++++++++ 3 files changed, 81 insertions(+) create mode 100644 recipes/sofa-python3/scripts/replace_str_file.py diff --git a/recipes/sofa-python3/build.bat b/recipes/sofa-python3/build.bat index e4d7e3a926f0a..ca66942fe3f74 100644 --- a/recipes/sofa-python3/build.bat +++ b/recipes/sofa-python3/build.bat @@ -25,3 +25,35 @@ for %%F in (activate deactivate) DO ( if not exist %PREFIX%\etc\conda\%%F.d mkdir %PREFIX%\etc\conda\%%F.d copy %RECIPE_DIR%\%%F.bat %PREFIX%\etc\conda\%%F.d\%PKG_NAME%_%%F.bat ) + +:: Patch the generated CMake files of some bindings modules +:: that points to wrong .lib / .pyd files. This is due to the fact that +:: SofaPython3 CMakeLists for these modules install twice their libraries (lib and pyd): +:: one install inside $PREFIX/Library/(lib|bin), one other on $PREFIX/Lib/site-packages. +:: Python needs the one in site-packages, but CMake config files points to the ones +:: in $PREFIX/Library/(lib|bin). As this could not be fixed upstream yet, we have +:: to patch them afterwards here + +:: Patch SofaRuntime CMake targets +python %RECIPE_DIR%\scripts\replace_str_file.py %PREFIX%\Library\lib\cmake\SofaPython3\Bindings.SofaRuntimeTargets-release.cmake ^ + "\${_IMPORT_PREFIX}/(lib|bin)/SofaRuntime" ^ + "${_IMPORT_PREFIX}/lib/../../Lib/site-packages/SofaRuntime/SofaRuntime" +if errorlevel 1 exit 1 + +:: Patch SofaRuntime CMake targets +python %RECIPE_DIR%\scripts\replace_str_file.py %PREFIX%\Library\lib\cmake\SofaPython3\Bindings.SofaTypesTargets-release.cmake ^ + "\${_IMPORT_PREFIX}/(lib|bin)/SofaTypes" ^ + "${_IMPORT_PREFIX}/lib/../../Lib/site-packages/SofaTypes/SofaTypes" +if errorlevel 1 exit 1 + +:: Patch SofaGui CMake targets +python %RECIPE_DIR%\scripts\replace_str_file.py %PREFIX%\Library\lib\cmake\SofaPython3\Bindings.SofaGuiTargets-release.cmake ^ + "\${_IMPORT_PREFIX}/(lib|bin)/Gui" ^ + "${_IMPORT_PREFIX}/lib/../../Lib/site-packages/Sofa/Gui" +if errorlevel 1 exit 1 + +:: Patch SofaExporter CMake targets +python %RECIPE_DIR%\scripts\replace_str_file.py %PREFIX%\Library\lib\cmake\SofaPython3\Bindings.SofaExporterTargets-release.cmake ^ + "\${_IMPORT_PREFIX}/(lib|bin)/SofaExporter" ^ + "${_IMPORT_PREFIX}/lib/../../Lib/site-packages/SofaExporter" +if errorlevel 1 exit 1 diff --git a/recipes/sofa-python3/recipe.yaml b/recipes/sofa-python3/recipe.yaml index 0dfd7ee2cf5b2..a5125e93e11c5 100644 --- a/recipes/sofa-python3/recipe.yaml +++ b/recipes/sofa-python3/recipe.yaml @@ -22,6 +22,22 @@ source: build: number: 0 + files: + # SofaPython3 as a weird conception of each module, both + # a as a python binding module and a SOFA component (which contain CMake config files), + # so each is installed twice. This causes problems with duplicates and incorrectly + # installed pyd and lib files (both at Library/{lib/bin} and lib/site-packages). + # Fix here remove the duplicate one in Library/{lib/bin} and patch its CMake config files + # to points the one inside site-packages instead. But this should be fixed upstream. + # See https://github.com/sofa-framework/conda-ci/issues/27 + exclude: + - if: win + then: + - Library/bin/*.pyd + - Library/lib/SofaRuntime.lib + - Library/lib/SofaExporter.lib + - Library/lib/Gui.lib + - Library/lib/SofaTypes.lib requirements: build: diff --git a/recipes/sofa-python3/scripts/replace_str_file.py b/recipes/sofa-python3/scripts/replace_str_file.py new file mode 100644 index 0000000000000..c40fad4202134 --- /dev/null +++ b/recipes/sofa-python3/scripts/replace_str_file.py @@ -0,0 +1,33 @@ +import sys +from pathlib import Path +import re + +# Replace regex by a string in a given file +# Used to patch CMake config files of SofaPython3 on Windows +def main(): + if len(sys.argv) != 4: + print("Usage: python replace_str_file.py ") + sys.exit(1) + + file_path = Path(sys.argv[1]) + exp_find = sys.argv[2] + str_replace = sys.argv[3] + + if not file_path.exists(): + print(f"Error: file not found: {file_path}") + sys.exit(1) + + content = file_path.read_text(encoding="utf-8") + + new_content = re.sub(exp_find, str_replace, content) + + if new_content != content: + file_path.write_text(new_content, encoding="utf-8") + print(f"Updated: {file_path}") + else: + print(f"Error: Failed to change in: {file_path}") + print(f"Regex: {exp_find} -> {str_replace}") + sys.exit(1) + +if __name__ == "__main__": + main() \ No newline at end of file