From 8afef12be195a551c3f8f694e3b1157122b55ffd Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Wed, 6 Mar 2024 21:07:30 +0000 Subject: [PATCH 1/9] Add CppInterOp recipe --- .../recipes_emscripten/CppInterOp/build.sh | 23 +++++++++ ...Work-around-a-bug-in-the-llvm-config.patch | 28 +++++++++++ .../0002-cmake-Fix-install-folder.patch | 13 +++++ .../recipes_emscripten/CppInterOp/recipe.yaml | 48 +++++++++++++++++++ 4 files changed, 112 insertions(+) create mode 100644 recipes/recipes_emscripten/CppInterOp/build.sh create mode 100644 recipes/recipes_emscripten/CppInterOp/patches/CppInterOp/0001-cmake-Work-around-a-bug-in-the-llvm-config.patch create mode 100644 recipes/recipes_emscripten/CppInterOp/patches/CppInterOp/0002-cmake-Fix-install-folder.patch create mode 100644 recipes/recipes_emscripten/CppInterOp/recipe.yaml diff --git a/recipes/recipes_emscripten/CppInterOp/build.sh b/recipes/recipes_emscripten/CppInterOp/build.sh new file mode 100644 index 00000000000..9748fcbf815 --- /dev/null +++ b/recipes/recipes_emscripten/CppInterOp/build.sh @@ -0,0 +1,23 @@ +mkdir build +cd build + +export CMAKE_PREFIX_PATH=$PREFIX +export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX + +# Configure step +emcmake cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ + -DUSE_CLING=OFF \ + -DUSE_REPL=ON \ + -DCMAKE_PREFIX_PATH=$PREFIX \ + -DLLVM_DIR=$PREFIX \ + -DClang_DIR=$PREFIX \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_INSTALL_PREFIX=$PREFIX \ + -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \ + ../ + +# Build step +EMCC_CFLAGS='-sERROR_ON_UNDEFINED_SYMBOLS=0' emmake make -j1 + +# Install step +emmake make install diff --git a/recipes/recipes_emscripten/CppInterOp/patches/CppInterOp/0001-cmake-Work-around-a-bug-in-the-llvm-config.patch b/recipes/recipes_emscripten/CppInterOp/patches/CppInterOp/0001-cmake-Work-around-a-bug-in-the-llvm-config.patch new file mode 100644 index 00000000000..bb145f6a990 --- /dev/null +++ b/recipes/recipes_emscripten/CppInterOp/patches/CppInterOp/0001-cmake-Work-around-a-bug-in-the-llvm-config.patch @@ -0,0 +1,28 @@ +From 3069b953dd1303eb4bd1171a8f5c5501ecdafc29 Mon Sep 17 00:00:00 2001 +From: Vassil Vassilev +Date: Sun, 3 Mar 2024 20:32:15 +0000 +Subject: [PATCH] [cmake] Work around a bug in the llvm config. + +In short we use variables which require including `GNUInstallDirs` but we are +expecting somebody else to include it for us. + +See llvm/llvm-project#83802 +--- + CMakeLists.txt | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 548e535..f4efb0e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,7 @@ + cmake_minimum_required(VERSION 3.13) + ++include(GNUInstallDirs) ++ + set(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + "${CMAKE_CURRENT_SOURCE_DIR}/cmake" +-- +2.37.1 (Apple Git-137.1) + diff --git a/recipes/recipes_emscripten/CppInterOp/patches/CppInterOp/0002-cmake-Fix-install-folder.patch b/recipes/recipes_emscripten/CppInterOp/patches/CppInterOp/0002-cmake-Fix-install-folder.patch new file mode 100644 index 00000000000..4211b448277 --- /dev/null +++ b/recipes/recipes_emscripten/CppInterOp/patches/CppInterOp/0002-cmake-Fix-install-folder.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d8b340a..d4e066b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -326,7 +326,7 @@ configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/CppInterOp/CppInterOpConfigVersion.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/CppInterOp/CppInterOpConfigVersion.cmake + @ONLY) +-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/CppInterOp ++install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/CppInterOp/ + DESTINATION lib/cmake/CppInterOp + FILES_MATCHING + PATTERN "*.cmake" \ No newline at end of file diff --git a/recipes/recipes_emscripten/CppInterOp/recipe.yaml b/recipes/recipes_emscripten/CppInterOp/recipe.yaml new file mode 100644 index 00000000000..bcb9ea05789 --- /dev/null +++ b/recipes/recipes_emscripten/CppInterOp/recipe.yaml @@ -0,0 +1,48 @@ +context: + version: 1.2.0 + +package: + name: llvm + version: '{{ version }}' + +source: + url: https://github.com/compiler-research/CppInterOp/archive/refs/tags/{{ revision_tag }}.tar.gz + sha256: b3cf25f500624fe12ffc40f858a04c46daea808298e64d924b594eb35ca1c806 + patches: + - patches/cppinterop/0001-cmake-Work-around-a-bug-in-the-llvm-config.patch + - patches/cppinterop/0002-cmake-Fix-install-folder.patch + +build: + number: 0 + +requirements: + build: + - '{{ compiler("cxx") }}' + - cmake + - make # [unix] + host: + - llvm + +about: + home: https://github.com/compiler-research/CppInterOp + license: Apache-2.0 WITH LLVM-exception + license_family: Apache + license_file: cppinterop/LICENSE.txt + summary: | + The CppInterOp library provides a minimalist approach for other languages + to interoperate with C++ entities. + description: | + CppInterOp exposes API from Clang and LLVM in a backward compatibe way. + The API support downstream tools that utilize interactive C++ by using + the compiler as a service. That is, embed Clang and LLVM as a libraries + in their codebases. The API are designed to be minimalistic and aid + non-trivial tasks such as language interoperability on the fly. In such + scenarios CppInterOp can be used to provide the necessary introspection + information to the other side helping the language cross talk. + doc_url: https://cppinterop.readthedocs.io/en/{{ version }} + dev_url: https://cppinterop.readthedocs.io/en/{{ version }}/DevelopersDocumentation.html + +extra: + recipe-maintainers: + - alexander-penev + - vgvassilev From 30e44be0723cbe178f9791ea360a91ed3825153b Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 7 Mar 2024 13:07:50 +0000 Subject: [PATCH 2/9] Add as maintainer --- recipes/recipes_emscripten/CppInterOp/recipe.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/recipes_emscripten/CppInterOp/recipe.yaml b/recipes/recipes_emscripten/CppInterOp/recipe.yaml index bcb9ea05789..15dfc479d18 100644 --- a/recipes/recipes_emscripten/CppInterOp/recipe.yaml +++ b/recipes/recipes_emscripten/CppInterOp/recipe.yaml @@ -46,3 +46,4 @@ extra: recipe-maintainers: - alexander-penev - vgvassilev + - mcbarton From d3da2442ee4456ceffc546515f52828446388e03 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 7 Mar 2024 13:34:42 +0000 Subject: [PATCH 3/9] Change recipe name to CppInterOp --- recipes/recipes_emscripten/CppInterOp/recipe.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/recipes_emscripten/CppInterOp/recipe.yaml b/recipes/recipes_emscripten/CppInterOp/recipe.yaml index 15dfc479d18..8ddc2b78c15 100644 --- a/recipes/recipes_emscripten/CppInterOp/recipe.yaml +++ b/recipes/recipes_emscripten/CppInterOp/recipe.yaml @@ -2,7 +2,7 @@ context: version: 1.2.0 package: - name: llvm + name: CppInterOp version: '{{ version }}' source: From 12aa7b3ac7befd8b772225122df1eb486a118801 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 7 Mar 2024 13:40:32 +0000 Subject: [PATCH 4/9] Update recipe.yaml to have version --- recipes/recipes_emscripten/CppInterOp/recipe.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/recipes_emscripten/CppInterOp/recipe.yaml b/recipes/recipes_emscripten/CppInterOp/recipe.yaml index 8ddc2b78c15..a069698cc9e 100644 --- a/recipes/recipes_emscripten/CppInterOp/recipe.yaml +++ b/recipes/recipes_emscripten/CppInterOp/recipe.yaml @@ -6,7 +6,7 @@ package: version: '{{ version }}' source: - url: https://github.com/compiler-research/CppInterOp/archive/refs/tags/{{ revision_tag }}.tar.gz + url: https://github.com/compiler-research/CppInterOp/archive/refs/tags/{{ version }}.tar.gz sha256: b3cf25f500624fe12ffc40f858a04c46daea808298e64d924b594eb35ca1c806 patches: - patches/cppinterop/0001-cmake-Work-around-a-bug-in-the-llvm-config.patch From 8c7775a369a0a907da9c83faa784deddecd7df94 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 7 Mar 2024 13:52:44 +0000 Subject: [PATCH 5/9] Fix CppInterOp url --- recipes/recipes_emscripten/CppInterOp/recipe.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/recipes_emscripten/CppInterOp/recipe.yaml b/recipes/recipes_emscripten/CppInterOp/recipe.yaml index a069698cc9e..01db44ab586 100644 --- a/recipes/recipes_emscripten/CppInterOp/recipe.yaml +++ b/recipes/recipes_emscripten/CppInterOp/recipe.yaml @@ -6,7 +6,7 @@ package: version: '{{ version }}' source: - url: https://github.com/compiler-research/CppInterOp/archive/refs/tags/{{ version }}.tar.gz + url: https://github.com/compiler-research/CppInterOp/archive/refs/tags/v{{ version }}.tar.gz sha256: b3cf25f500624fe12ffc40f858a04c46daea808298e64d924b594eb35ca1c806 patches: - patches/cppinterop/0001-cmake-Work-around-a-bug-in-the-llvm-config.patch From 5ef008b81d87f0986cf27674e0bc9e743321be5d Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:02:18 +0000 Subject: [PATCH 6/9] Fix patch path --- recipes/recipes_emscripten/{CppInterOp => cppinterop}/build.sh | 0 .../0001-cmake-Work-around-a-bug-in-the-llvm-config.patch | 0 .../patches/cppinterop}/0002-cmake-Fix-install-folder.patch | 0 .../recipes_emscripten/{CppInterOp => cppinterop}/recipe.yaml | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) rename recipes/recipes_emscripten/{CppInterOp => cppinterop}/build.sh (100%) rename recipes/recipes_emscripten/{CppInterOp/patches/CppInterOp => cppinterop/patches/cppinterop}/0001-cmake-Work-around-a-bug-in-the-llvm-config.patch (100%) rename recipes/recipes_emscripten/{CppInterOp/patches/CppInterOp => cppinterop/patches/cppinterop}/0002-cmake-Fix-install-folder.patch (100%) rename recipes/recipes_emscripten/{CppInterOp => cppinterop}/recipe.yaml (98%) diff --git a/recipes/recipes_emscripten/CppInterOp/build.sh b/recipes/recipes_emscripten/cppinterop/build.sh similarity index 100% rename from recipes/recipes_emscripten/CppInterOp/build.sh rename to recipes/recipes_emscripten/cppinterop/build.sh diff --git a/recipes/recipes_emscripten/CppInterOp/patches/CppInterOp/0001-cmake-Work-around-a-bug-in-the-llvm-config.patch b/recipes/recipes_emscripten/cppinterop/patches/cppinterop/0001-cmake-Work-around-a-bug-in-the-llvm-config.patch similarity index 100% rename from recipes/recipes_emscripten/CppInterOp/patches/CppInterOp/0001-cmake-Work-around-a-bug-in-the-llvm-config.patch rename to recipes/recipes_emscripten/cppinterop/patches/cppinterop/0001-cmake-Work-around-a-bug-in-the-llvm-config.patch diff --git a/recipes/recipes_emscripten/CppInterOp/patches/CppInterOp/0002-cmake-Fix-install-folder.patch b/recipes/recipes_emscripten/cppinterop/patches/cppinterop/0002-cmake-Fix-install-folder.patch similarity index 100% rename from recipes/recipes_emscripten/CppInterOp/patches/CppInterOp/0002-cmake-Fix-install-folder.patch rename to recipes/recipes_emscripten/cppinterop/patches/cppinterop/0002-cmake-Fix-install-folder.patch diff --git a/recipes/recipes_emscripten/CppInterOp/recipe.yaml b/recipes/recipes_emscripten/cppinterop/recipe.yaml similarity index 98% rename from recipes/recipes_emscripten/CppInterOp/recipe.yaml rename to recipes/recipes_emscripten/cppinterop/recipe.yaml index 01db44ab586..9a236b4c043 100644 --- a/recipes/recipes_emscripten/CppInterOp/recipe.yaml +++ b/recipes/recipes_emscripten/cppinterop/recipe.yaml @@ -2,7 +2,7 @@ context: version: 1.2.0 package: - name: CppInterOp + name: cppinterop version: '{{ version }}' source: From 123e6f5d28bc46ea6c8727b8dc0cbaa75234d4d1 Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:34:28 +0000 Subject: [PATCH 7/9] Set build type cmake --- recipes/recipes_emscripten/cppinterop/build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/recipes/recipes_emscripten/cppinterop/build.sh b/recipes/recipes_emscripten/cppinterop/build.sh index 9748fcbf815..ba68ce69eb1 100644 --- a/recipes/recipes_emscripten/cppinterop/build.sh +++ b/recipes/recipes_emscripten/cppinterop/build.sh @@ -5,14 +5,14 @@ export CMAKE_PREFIX_PATH=$PREFIX export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX # Configure step -emcmake cmake -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ +emcmake cmake -DCMAKE_BUILD_TYPE=Release \ -DUSE_CLING=OFF \ -DUSE_REPL=ON \ -DCMAKE_PREFIX_PATH=$PREFIX \ - -DLLVM_DIR=$PREFIX \ - -DClang_DIR=$PREFIX \ + -DLLVM_DIR=$PREFIX \ + -DClang_DIR=$PREFIX \ -DBUILD_SHARED_LIBS=ON \ - -DCMAKE_INSTALL_PREFIX=$PREFIX \ + -DCMAKE_INSTALL_PREFIX=$PREFIX \ -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \ ../ From 7f03f9adb7fa4df6ca86cdaeee02904eaea84dbd Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 7 Mar 2024 14:46:42 +0000 Subject: [PATCH 8/9] Fix license_file tag --- recipes/recipes_emscripten/cppinterop/recipe.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/recipes_emscripten/cppinterop/recipe.yaml b/recipes/recipes_emscripten/cppinterop/recipe.yaml index 9a236b4c043..dab7ce21613 100644 --- a/recipes/recipes_emscripten/cppinterop/recipe.yaml +++ b/recipes/recipes_emscripten/cppinterop/recipe.yaml @@ -27,7 +27,7 @@ about: home: https://github.com/compiler-research/CppInterOp license: Apache-2.0 WITH LLVM-exception license_family: Apache - license_file: cppinterop/LICENSE.txt + license_file: LICENSE.TXT summary: | The CppInterOp library provides a minimalist approach for other languages to interoperate with C++ entities. From eecf7f0ee37309cd24e0441073a3e85193dd811f Mon Sep 17 00:00:00 2001 From: mcbarton <150042563+mcbarton@users.noreply.github.com> Date: Thu, 7 Mar 2024 16:56:13 +0000 Subject: [PATCH 9/9] Add LICENSE.TXT --- .../recipes_emscripten/cppinterop/LICENSE.TXT | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 recipes/recipes_emscripten/cppinterop/LICENSE.TXT diff --git a/recipes/recipes_emscripten/cppinterop/LICENSE.TXT b/recipes/recipes_emscripten/cppinterop/LICENSE.TXT new file mode 100644 index 00000000000..2ec51d75f36 --- /dev/null +++ b/recipes/recipes_emscripten/cppinterop/LICENSE.TXT @@ -0,0 +1,27 @@ +BSD-3-Clause license +Copyright (c) 2015-2022, conda-forge contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE.