diff --git a/extensions/generators/npm.py b/extensions/generators/npm.py new file mode 100644 index 0000000..24b9844 --- /dev/null +++ b/extensions/generators/npm.py @@ -0,0 +1,30 @@ +import json + +from conan import ConanFile +from conan.errors import ConanException +from conan.tools.files import copy, save +from pathlib import Path + + +class npm: + def __init__(self, conanfile: ConanFile): + self._conanfile = conanfile + + def generate(self): + if self._conanfile.settings.os != "Emscripten": + self._conanfile.output.error("Can only deploy to NPM when build for Emscripten") + raise ConanException("Can only deploy to NPM when build for Emscripten") + + root_package = [dep for dep in self._conanfile.dependencies.direct_host.values()][0] + + # Copy the *.js and *.d.ts + copy(self._conanfile, "*.js", src=root_package.package_folder, dst=self._conanfile.generators_folder) + copy(self._conanfile, "*.d.ts", src=root_package.package_folder, dst=self._conanfile.generators_folder) + + # Create the package.json + save(self._conanfile, str(Path(self._conanfile.generators_folder, "package.json")), + json.dumps(root_package.conf_info.get(f"user.{root_package.ref.name.lower()}:package_json"))) + + # Create the .npmrc file + save(self._conanfile, str(Path(self._conanfile.generators_folder, ".npmrc")), + "//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}\n@ultimaker:registry=https://npm.pkg.github.com\nalways-auth=true") diff --git a/profiles/cura.jinja b/profiles/cura.jinja index bc2c743..310c950 100644 --- a/profiles/cura.jinja +++ b/profiles/cura.jinja @@ -1,5 +1,13 @@ include(default) +[replace_requires] +{% if platform.system() == 'Linux' %} +# FIXME: once gRPC is updated to 1.67.0 or higher +# Using 255.10 or higher https://github.com/conan-io/conan-center-index/issues/24889 +# https://github.com/conan-io/conan-center-index/blob/879e140d9438ab491aceea766d0cf0ae3595dae8/recipes/grpc/all/conanfile.py#L122 +libsystemd/*: libsystemd/[>=255.10] +{% endif %} + [settings] compiler.cppstd=17 curaengine*:compiler.cppstd=20 @@ -9,7 +17,7 @@ curaengine_grpc_definitions*:compiler.cppstd=20 scripta*:compiler.cppstd=20 umspatial*:compiler.cppstd=20 dulcificum*:compiler.cppstd=20 -curator*:compiler.cppstd=20 +curator/*:compiler.cppstd=20 [options] asio-grpc/*:local_allocator=recycling_allocator diff --git a/profiles/cura_build.jinja b/profiles/cura_build.jinja index de80517..031c77d 100644 --- a/profiles/cura_build.jinja +++ b/profiles/cura_build.jinja @@ -2,3 +2,7 @@ include(default) [settings] compiler.cppstd=17 +curator/*:compiler.cppstd=20 + +[conf] +tools.build:skip_test=True diff --git a/profiles/cura_clang.jinja b/profiles/cura_clang.jinja index fc7eaaa..60ace18 100644 --- a/profiles/cura_clang.jinja +++ b/profiles/cura_clang.jinja @@ -1,13 +1,10 @@ include(cura.jinja) - -[tool_requires] +{% set compiler, version, compiler_exe = detect_api.detect_clang_compiler(compiler_exe="clang") %} [settings] -compiler=clang -compiler.version=18 +compiler={{ compiler }} +compiler.version={{ version.major }} compiler.libcxx=libstdc++11 -[options] - [conf] -tools.build:compiler_executables={"c":"clang", "cpp":"clang++"} +tools.build:compiler_executables={"c":"{{ compiler_exe }}", "cpp":"{{ compiler_exe }}++"} diff --git a/profiles/cura_wasm.jinja b/profiles/cura_wasm.jinja index 372fc79..f46195d 100644 --- a/profiles/cura_wasm.jinja +++ b/profiles/cura_wasm.jinja @@ -10,10 +10,13 @@ arch=wasm [conf] tools.build:skip_test=True +tools.cmake.cmake_layout:build_folder_vars=['settings.os'] +user.curator:printers=['ultimaker_sketch','ultimaker_sketch_large','ultimaker_sketch_sprint','ultimaker_method'] [options] curaengine/*:enable_plugins=False curaengine/*:enable_arcus=False curator/*:with_cura_resources=True curator/*:disable_logging=True +dulcificum/*:with_python_bindings=False libzip/*:crypto=False