Gaetan Lepage
2024-12-20 08:16:12 +01:00
parent 03356fcd8a
commit b583f03b4d
3 changed files with 63 additions and 68 deletions
+45 -29
View File
@@ -1,36 +1,51 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
pkg-config,
stdenv,
# nativeBuildInputs
binaryen,
rustfmt,
lld,
darwin,
pkg-config,
protobuf,
rustfmt,
# buildInputs
freetype,
glib,
gtk3,
libxkbcommon,
openssl,
protobuf,
vulkan-loader,
wayland,
apple-sdk_11,
versionCheckHook,
# passthru
nix-update-script,
python3Packages,
}:
rustPlatform.buildRustPackage rec {
pname = "rerun";
version = "0.20.2";
version = "0.21.0";
src = fetchFromGitHub {
owner = "rerun-io";
repo = "rerun";
rev = "refs/tags/${version}";
hash = "sha256-AoI+BKDqHRsBrZAAwrE17xCduIP9wI7WPSSpn7SMz/M=";
tag = version;
hash = "sha256-U+Q8u1XKBD9c49eXAgc5vASKytgyAEYyYv8XNfftlZU=";
};
useFetchCargoVendor = true;
cargoHash = "sha256-LB8P9ceHN4zq+8qv1h0nDKW9FVTEbSrX/Zbv2WB29ck=";
# The path in `build.rs` is wrong for some reason, so we patch it to make the passthru tests work
postPatch = ''
substituteInPlace rerun_py/build.rs \
--replace-fail '"rerun_sdk/rerun_cli/rerun"' '"rerun_sdk/rerun"'
'';
cargoHash = "sha256-d68dNAAGY+a0DpL82S/qntu2XOsoVqHpfU2L9NcoJQc=";
cargoBuildFlags = [ "--package rerun-cli" ];
cargoTestFlags = [ "--package rerun-cli" ];
@@ -57,18 +72,12 @@ rustPlatform.buildRustPackage rec {
libxkbcommon
vulkan-loader
]
++ lib.optionals stdenv.hostPlatform.isLinux [ (lib.getLib wayland) ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.AppKit
darwin.apple_sdk.frameworks.CoreFoundation
darwin.apple_sdk.frameworks.CoreGraphics
darwin.apple_sdk.frameworks.CoreServices
darwin.apple_sdk.frameworks.Foundation
darwin.apple_sdk.frameworks.IOKit
darwin.apple_sdk.frameworks.Metal
darwin.apple_sdk.frameworks.QuartzCore
darwin.apple_sdk.frameworks.Security
]
++ lib.optionals stdenv.hostPlatform.isLinux [ (lib.getLib wayland) ];
# Undefined symbols for architecture x86_64: "_NSAccessibilityTabButtonSubrole"
# ld: symbol(s) not found for architecture x86_64
apple-sdk_11
];
addDlopenRunpaths = map (p: "${lib.getLib p}/lib") (
lib.optionals stdenv.hostPlatform.isLinux [
@@ -97,21 +106,28 @@ rustPlatform.buildRustPackage rec {
postPhases = lib.optionals stdenv.hostPlatform.isLinux [ "addDlopenRunpathsPhase" ];
# The path in `build.rs` is wrong for some reason, so we patch it to make the passthru tests work
patches = [ ./tests.patch ];
passthru.tests = {
inherit (python3Packages) rerun-sdk;
nativeInstallCheckInputs = [
versionCheckHook
];
versionCheckProgramArg = [ "--version" ];
doInstallCheck = true;
passthru = {
updateScript = nix-update-script { };
tests = {
inherit (python3Packages) rerun-sdk;
};
};
meta = with lib; {
meta = {
description = "Visualize streams of multimodal data. Fast, easy to use, and simple to integrate. Built in Rust using egui";
homepage = "https://github.com/rerun-io/rerun";
changelog = "https://github.com/rerun-io/rerun/blob/${src.rev}/CHANGELOG.md";
license = with licenses; [
changelog = "https://github.com/rerun-io/rerun/blob/${src.tag}/CHANGELOG.md";
license = with lib.licenses; [
asl20
mit
];
maintainers = with maintainers; [
maintainers = with lib.maintainers; [
SomeoneSerge
robwalt
];
-16
View File
@@ -1,16 +0,0 @@
rerun_py/build.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rerun_py/build.rs b/rerun_py/build.rs
index 3d292c55b..28e54f06b 100644
--- a/rerun_py/build.rs
+++ b/rerun_py/build.rs
@@ -17,7 +17,7 @@ fn main() {
#[cfg(not(target_os = "windows"))]
let rerun_bin = std::env::current_dir()
.expect("std::env::current_dir() failed")
- .join("rerun_sdk/rerun_cli/rerun");
+ .join("rerun_sdk/rerun");
if !rerun_bin.exists() {
eprintln!("ERROR: Expected to find `rerun` at `{rerun_bin:?}`.");
@@ -1,21 +1,25 @@
{
buildPythonPackage,
lib,
rustPlatform,
stdenv,
buildPythonPackage,
rerun,
python,
# nativeBuildInputs
rustPlatform,
# dependencies
attrs,
darwin,
numpy,
opencv4,
pillow,
pyarrow,
rerun,
torch,
typing-extensions,
pytestCheckHook,
python,
libiconv,
semver,
opencv4,
typing-extensions,
# tests
pytestCheckHook,
torch,
}:
buildPythonPackage {
@@ -26,7 +30,7 @@ buildPythonPackage {
src
version
cargoDeps
patches
postPatch
;
nativeBuildInputs = [
@@ -35,23 +39,14 @@ buildPythonPackage {
rerun
];
buildInputs =
[
libiconv # No-op on Linux, necessary on Darwin.
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.AppKit
darwin.apple_sdk.frameworks.CoreServices
];
propagatedBuildInputs = [
dependencies = [
attrs
numpy
opencv4
pillow
pyarrow
typing-extensions
semver
opencv4
typing-extensions
];
buildAndTestSubdir = "rerun_py";