Skip to content

Commit aa5da33

Browse files
authored
Merge pull request #289150 from SomeoneSerge/new-package/rerun
rerun: init at 0.13.0
2 parents fd4c968 + 6ffd74b commit aa5da33

File tree

4 files changed

+231
-0
lines changed

4 files changed

+231
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From f6c5dde13a39bd149d892162e2ef72267f4c4a57 Mon Sep 17 00:00:00 2001
2+
From: Someone Serge <[email protected]>
3+
Date: Thu, 15 Feb 2024 18:05:16 +0000
4+
Subject: [PATCH] re_space_view_time_series: utils: patch out doctests w
5+
unstable features
6+
7+
---
8+
crates/re_space_view_time_series/src/util.rs | 7 +------
9+
1 file changed, 1 insertion(+), 6 deletions(-)
10+
11+
diff --git a/crates/re_space_view_time_series/src/util.rs b/crates/re_space_view_time_series/src/util.rs
12+
index 83ce5362f..59d3b9734 100644
13+
--- a/crates/re_space_view_time_series/src/util.rs
14+
+++ b/crates/re_space_view_time_series/src/util.rs
15+
@@ -288,12 +288,7 @@ fn add_series_runs(
16+
/// is finite `x == x.next_up().next_down()` also holds.
17+
///
18+
/// ```rust
19+
-/// #![feature(float_next_up_down)]
20+
-/// // f64::EPSILON is the difference between 1.0 and the next number up.
21+
-/// assert_eq!(1.0f64.next_up(), 1.0 + f64::EPSILON);
22+
-/// // But not for most numbers.
23+
-/// assert!(0.1f64.next_up() < 0.1 + f64::EPSILON);
24+
-/// assert_eq!(9007199254740992f64.next_up(), 9007199254740994.0);
25+
+/// // PATCHED OUT THE UNSTABLE float_next_up_down
26+
/// ```
27+
///
28+
/// [`NEG_INFINITY`]: f64::NEG_INFINITY
29+
--
30+
2.43.0
31+

pkgs/by-name/re/rerun/package.nix

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
{
2+
lib,
3+
rustPlatform,
4+
fetchFromGitHub,
5+
pkg-config,
6+
stdenv,
7+
binaryen,
8+
rustfmt,
9+
lld,
10+
darwin,
11+
freetype,
12+
glib,
13+
gtk3,
14+
libxkbcommon,
15+
openssl,
16+
protobuf,
17+
vulkan-loader,
18+
wayland,
19+
python3Packages,
20+
}:
21+
22+
rustPlatform.buildRustPackage rec {
23+
pname = "rerun";
24+
version = "0.13.0";
25+
26+
src = fetchFromGitHub {
27+
owner = "rerun-io";
28+
repo = "rerun";
29+
rev = version;
30+
hash = "sha256-HgzzuvCpzKgWC8it0PSq62hBjjqpdgYtQQ50SNbr3do=";
31+
};
32+
patches = [
33+
# Disables a doctest that depends on a nightly feature
34+
./0001-re_space_view_time_series-utils-patch-out-doctests-w.patch
35+
];
36+
37+
cargoHash = "sha256-qvnkOlcjADV4b+JfFAy9yNaZGaf0ZO7hh9HBg5XmPi0=";
38+
39+
nativeBuildInputs = [
40+
(lib.getBin binaryen) # wasm-opt
41+
42+
# @SomeoneSerge: Upstream suggests `mold`, but I didn't get it to work
43+
lld
44+
45+
pkg-config
46+
protobuf
47+
rustfmt
48+
];
49+
50+
buildInputs =
51+
[
52+
freetype
53+
glib
54+
gtk3
55+
(lib.getDev openssl)
56+
libxkbcommon
57+
vulkan-loader
58+
]
59+
++ lib.optionals stdenv.isDarwin [
60+
darwin.apple_sdk.frameworks.AppKit
61+
darwin.apple_sdk.frameworks.CoreFoundation
62+
darwin.apple_sdk.frameworks.CoreGraphics
63+
darwin.apple_sdk.frameworks.CoreServices
64+
darwin.apple_sdk.frameworks.Foundation
65+
darwin.apple_sdk.frameworks.IOKit
66+
darwin.apple_sdk.frameworks.Metal
67+
darwin.apple_sdk.frameworks.QuartzCore
68+
darwin.apple_sdk.frameworks.Security
69+
]
70+
++ lib.optionals stdenv.isLinux [ (lib.getLib wayland) ];
71+
72+
env.CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld";
73+
74+
addBuildInputRunpathsPhase = ''
75+
declare _extraRunpaths
76+
_sep=
77+
for p in "''${pkgsHostTarget[@]}" ; do
78+
if [[ -d "$p/lib" ]] ; then
79+
_extraRunpaths+="$_sep$p/lib"
80+
if [[ -z "$_sep" ]] ; then
81+
_sep=:
82+
fi
83+
fi
84+
done
85+
86+
elfHasDynamicSection() {
87+
patchelf --print-rpath "$1" >& /dev/null
88+
}
89+
90+
while IFS= read -r -d $'\0' path ; do
91+
if elfHasDynamicSection "$path" ; then
92+
patchelf "$path" --add-rpath "''${_extraRunpaths}"
93+
fi
94+
done < <(
95+
for o in $(getAllOutputNames) ; do
96+
find "''${!o}" -type f -and "(" -executable -or -iname '*.so' ")" -print0
97+
done
98+
)
99+
100+
unset _extraRunpaths
101+
unset _sep
102+
'';
103+
104+
postPhases = lib.optionals stdenv.isLinux [ "addBuildInputRunpathsPhase" ];
105+
106+
cargoTestFlags = [
107+
"-p"
108+
"rerun"
109+
"--workspace"
110+
"--exclude=crates/rerun/src/lib.rs"
111+
];
112+
113+
passthru.tests = {
114+
inherit (python3Packages) rerun-sdk;
115+
};
116+
117+
meta = with lib; {
118+
description = "Visualize streams of multimodal data. Fast, easy to use, and simple to integrate. Built in Rust using egui";
119+
homepage = "https://github.com/rerun-io/rerun";
120+
changelog = "https://github.com/rerun-io/rerun/blob/${src.rev}/CHANGELOG.md";
121+
license = with licenses; [
122+
asl20
123+
mit
124+
];
125+
maintainers = with maintainers; [ SomeoneSerge ];
126+
mainProgram = "rerun";
127+
};
128+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
buildPythonPackage,
3+
lib,
4+
rustPlatform,
5+
stdenv,
6+
attrs,
7+
numpy,
8+
pillow,
9+
pyarrow,
10+
rerun,
11+
torch,
12+
typing-extensions,
13+
pytestCheckHook,
14+
python,
15+
}:
16+
17+
buildPythonPackage {
18+
pname = "rerun-sdk";
19+
inherit (rerun) version;
20+
pyproject = true;
21+
22+
inherit (rerun) src;
23+
inherit (rerun) cargoDeps;
24+
25+
nativeBuildInputs = [
26+
rustPlatform.cargoSetupHook
27+
rustPlatform.maturinBuildHook
28+
];
29+
30+
propagatedBuildInputs = [
31+
attrs
32+
numpy
33+
pillow
34+
pyarrow
35+
typing-extensions
36+
];
37+
38+
buildAndTestSubdir = "rerun_py";
39+
40+
# https://github.com/NixOS/nixpkgs/issues/289340
41+
#
42+
# Alternatively, one could
43+
# dontUsePythonImportsCheck = true;
44+
# dontUsePytestCheck = true;
45+
postInstall = ''
46+
rm $out/${python.sitePackages}/rerun_sdk.pth
47+
ln -s rerun_sdk/rerun $out/${python.sitePackages}/rerun
48+
'';
49+
50+
pythonImportsCheck = [ "rerun" ];
51+
52+
nativeCheckInputs = [
53+
pytestCheckHook
54+
torch
55+
];
56+
57+
inherit (rerun) addBuildInputRunpathsPhase;
58+
postPhases = lib.optionals stdenv.isLinux [ "addBuildInputRunpathsPhase" ];
59+
60+
disabledTestPaths = [
61+
# "fixture 'benchmark' not found"
62+
"tests/python/log_benchmark/test_log_benchmark.py"
63+
];
64+
65+
meta = {
66+
description = "Python bindings for `rerun` (an interactive visualization tool for stream data)";
67+
inherit (rerun.meta) changelog homepage license maintainers;
68+
mainProgram = "rerun";
69+
};
70+
}

pkgs/top-level/python-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12680,6 +12680,8 @@ self: super: with self; {
1268012680

1268112681
reretry = callPackage ../development/python-modules/reretry { };
1268212682

12683+
rerun-sdk = callPackage ../development/python-modules/rerun-sdk { };
12684+
1268312685
resampy = callPackage ../development/python-modules/resampy { };
1268412686

1268512687
resize-right = callPackage ../development/python-modules/resize-right { };

0 commit comments

Comments
 (0)