rerun: add C++ SDK support, build librerun_c from source (#457945)
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
stdenv,
|
stdenv,
|
||||||
rustPlatform,
|
rustPlatform,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
|
arrow-cpp,
|
||||||
# nativeBuildInputs
|
# nativeBuildInputs
|
||||||
binaryen,
|
binaryen,
|
||||||
lld,
|
lld,
|
||||||
@@ -36,6 +37,11 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||||||
pname = "rerun";
|
pname = "rerun";
|
||||||
version = "0.26.2";
|
version = "0.26.2";
|
||||||
|
|
||||||
|
outputs = [
|
||||||
|
"out"
|
||||||
|
"dev"
|
||||||
|
];
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "rerun-io";
|
owner = "rerun-io";
|
||||||
repo = "rerun";
|
repo = "rerun";
|
||||||
@@ -51,7 +57,10 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||||||
|
|
||||||
cargoHash = "sha256-EH/R+OgLeLNrZnkIGqutTo4K9XzhW+CGwG/uQKwWGXA=";
|
cargoHash = "sha256-EH/R+OgLeLNrZnkIGqutTo4K9XzhW+CGwG/uQKwWGXA=";
|
||||||
|
|
||||||
cargoBuildFlags = [ "--package rerun-cli" ];
|
cargoBuildFlags = [
|
||||||
|
"--package rerun-cli"
|
||||||
|
"--package rerun_c"
|
||||||
|
];
|
||||||
cargoTestFlags = [ "--package rerun-cli" ];
|
cargoTestFlags = [ "--package rerun-cli" ];
|
||||||
buildNoDefaultFeatures = true;
|
buildNoDefaultFeatures = true;
|
||||||
buildFeatures = [
|
buildFeatures = [
|
||||||
@@ -128,6 +137,8 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||||||
]
|
]
|
||||||
++ lib.optionals stdenv.hostPlatform.isLinux [ (lib.getLib wayland) ];
|
++ lib.optionals stdenv.hostPlatform.isLinux [ (lib.getLib wayland) ];
|
||||||
|
|
||||||
|
propagatedBuildInputs = [ arrow-cpp ];
|
||||||
|
|
||||||
addDlopenRunpaths = map (p: "${lib.getLib p}/lib") (
|
addDlopenRunpaths = map (p: "${lib.getLib p}/lib") (
|
||||||
lib.optionals stdenv.hostPlatform.isLinux [
|
lib.optionals stdenv.hostPlatform.isLinux [
|
||||||
libxkbcommon
|
libxkbcommon
|
||||||
@@ -155,6 +166,23 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||||||
|
|
||||||
postPhases = lib.optionals stdenv.hostPlatform.isLinux [ "addDlopenRunpathsPhase" ];
|
postPhases = lib.optionals stdenv.hostPlatform.isLinux [ "addDlopenRunpathsPhase" ];
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
# Install C++ SDK components
|
||||||
|
mkdir -p $dev/include
|
||||||
|
cp -r $src/rerun_cpp/src/* $dev/include/
|
||||||
|
|
||||||
|
# Install rerun_c library (built from Rust)
|
||||||
|
if [ -f "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/librerun_c.a" ]; then
|
||||||
|
cp "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/librerun_c.a" $out/lib/
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install CMake config files
|
||||||
|
mkdir -p $dev/lib/cmake/rerun_sdk
|
||||||
|
cp $src/rerun_cpp/CMakeLists.txt $dev/lib/cmake/rerun_sdk/
|
||||||
|
cp $src/rerun_cpp/Config.cmake.in $dev/lib/cmake/rerun_sdk/
|
||||||
|
cp $src/rerun_cpp/download_and_build_arrow.cmake $dev/lib/cmake/rerun_sdk/
|
||||||
|
'';
|
||||||
|
|
||||||
nativeInstallCheckInputs = [
|
nativeInstallCheckInputs = [
|
||||||
versionCheckHook
|
versionCheckHook
|
||||||
];
|
];
|
||||||
@@ -169,7 +197,7 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
|||||||
};
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "Visualize streams of multimodal data. Fast, easy to use, and simple to integrate. Built in Rust using egui";
|
description = "Visualize streams of multimodal data. Fast, easy to use, and simple to integrate. Built in Rust using egui. Includes C++ SDK";
|
||||||
homepage = "https://github.com/rerun-io/rerun";
|
homepage = "https://github.com/rerun-io/rerun";
|
||||||
changelog = "https://github.com/rerun-io/rerun/blob/${finalAttrs.version}/CHANGELOG.md";
|
changelog = "https://github.com/rerun-io/rerun/blob/${finalAttrs.version}/CHANGELOG.md";
|
||||||
license = with lib.licenses; [
|
license = with lib.licenses; [
|
||||||
|
|||||||
Reference in New Issue
Block a user