diff --git a/pantor/ruckig/Ruckig_cmp.gox b/pantor/ruckig/Ruckig_cmp.gox new file mode 100644 index 0000000..c67ad39 --- /dev/null +++ b/pantor/ruckig/Ruckig_cmp.gox @@ -0,0 +1,4 @@ +compareVer (a, b) => { + // ruckig publishes semver tags like "v0.17.3". + return semver.compare(a.Version, b.Version) +} diff --git a/pantor/ruckig/v0.17.3/Ruckig_llar.gox b/pantor/ruckig/v0.17.3/Ruckig_llar.gox new file mode 100644 index 0000000..30a7213 --- /dev/null +++ b/pantor/ruckig/v0.17.3/Ruckig_llar.gox @@ -0,0 +1,88 @@ +import "os" + +id "pantor/ruckig" + +fromVer "v0.17.3" + +onBuild ctx => { + installDir := ctx.outputDir + + c := cmake.new(ctx.SourceDir, ctx.SourceDir+"/_build", installDir) + c.buildType "Release" + + // ruckig is a C++20 CMake library. Build only the core static library: + // disable the examples, unit tests, the nanobind Python wrapper and the + // (network) cloud client, matching the community package interface. The + // cloud client would otherwise inject vendored third_party headers and a + // WITH_CLOUD_CLIENT define that are not part of the core install. + c.defineBool "BUILD_SHARED_LIBS", false + c.defineBool "CMAKE_POSITION_INDEPENDENT_CODE", true + c.defineBool "BUILD_EXAMPLES", false + c.defineBool "BUILD_TESTS", false + c.defineBool "BUILD_PYTHON_MODULE", false + c.defineBool "BUILD_CLOUD_CLIENT", false + + c.configure + c.build + c.install + + // Consumers link the installed "ruckig" library (target ruckig::ruckig). + ctx.setMetadata "-lruckig" +} + +onTest ctx => { + installDir := ctx.outputDir + + // Keep the consumer build in its own tree so onTest behaves identically + // on a cache hit (onBuild skipped, no _build dir) and a cache miss. + testDir := ctx.SourceDir + "/_testconsumer" + testBuild := testDir + "/_build" + + os.mkdirAll(testDir, 0o755)! + + // Consumer mirrors the Conan test_package: a single-DoF trajectory update. + cpp := `#include +#include + +int main() { + using namespace ruckig; + + Ruckig<1> otg(0.01); + InputParameter<1> input; + OutputParameter<1> output; + + input.target_position = {1.0}; + input.max_velocity = {1.0}; + input.max_acceleration = {1.0}; + input.max_jerk = {1.0}; + + auto result = otg.update(input, output); + printf("Ruckig update result: %d\n", static_cast(result)); + return 0; +} +` + os.writeFile(testDir+"/test_package.cpp", []byte(cpp), 0o644)! + + cml := `cmake_minimum_required(VERSION 3.15) +project(ruckig_test_package LANGUAGES CXX) + +find_package(ruckig REQUIRED CONFIG) + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package PRIVATE ruckig::ruckig) +` + os.writeFile(testDir+"/CMakeLists.txt", []byte(cml), 0o644)! + + tc := cmake.new(testDir, testBuild, testBuild+"/_out") + tc.buildType "Release" + tc.use installDir + + tc.configure + tc.build + + // A non-zero exit surfaces via lastErr and fails the test. + exec testBuild + "/test_package" + if lastErr != nil { + panic lastErr + } +} diff --git a/pantor/ruckig/versions.json b/pantor/ruckig/versions.json new file mode 100644 index 0000000..0eeb217 --- /dev/null +++ b/pantor/ruckig/versions.json @@ -0,0 +1,4 @@ +{ + "path": "pantor/ruckig", + "deps": {} +}