From 7c536cd2537d9d8fac57edbed183a811c9c9db15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Fri, 8 May 2026 13:21:20 +0200 Subject: [PATCH 1/2] e57inspector: init at 0.3.1 --- pkgs/by-name/e5/e57inspector/package.nix | 75 ++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 pkgs/by-name/e5/e57inspector/package.nix diff --git a/pkgs/by-name/e5/e57inspector/package.nix b/pkgs/by-name/e5/e57inspector/package.nix new file mode 100644 index 000000000000..f8cdcf60ae0b --- /dev/null +++ b/pkgs/by-name/e5/e57inspector/package.nix @@ -0,0 +1,75 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + qt6, + xercesc, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "e57inspector"; + version = "0.3.1"; + + src = fetchFromGitHub { + owner = "sisakat"; + repo = "e57inspector"; + tag = "v${finalAttrs.version}"; + hash = "sha256-McLPbvS7j+6UVEcQ34/ngGiCxsdF/Whs5wZt5cP2UkI="; + fetchSubmodules = true; + }; + + strictDeps = true; + __structuredAttrs = true; + + patches = [ + # Support loading E57 files from CLI arguments, + # so we can use that in the NixOS VM test to load a sample file. + # Remove with next release (see https://github.com/sisakat/e57inspector/pull/8) + (fetchpatch { + name = "e57inspector-Allow-loading-file-from-CLI.patch"; + url = "https://github.com/nh2/e57inspector/commit/a5a899ee58952ffc2971d18b3734ea405e0020f3.patch"; + hash = "sha256-QRUv0CvX+OdH88CzI/6XjPXnAVIsf6N/Ix/qqCsSaRw="; + }) + ]; + + postPatch = '' + # Fix cmake_minimum_required version compatibility with CMake >= 4.0 + substituteInPlace app/cmake/gitversion.cmake \ + --replace-fail "cmake_minimum_required(VERSION 3.0.0)" "cmake_minimum_required(VERSION 3.5)" + ''; + + nativeBuildInputs = [ + cmake + qt6.wrapQtAppsHook + ]; + + buildInputs = [ + qt6.qtbase + qt6.qttools + xercesc + ]; + + # Upstream CMakeLists.txt has no install() rules. + installPhase = '' + runHook preInstall + + install -Dm755 app/e57inspector -t $out/bin + install -Dm755 panorama/e57inspector_panorama -t $out/bin + + runHook postInstall + ''; + + meta = { + description = "Cross-platform E57 file viewer to list and view stored point clouds, images and metadata"; + homepage = "https://github.com/sisakat/e57inspector"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ + nh2 + chpatrick + ]; + teams = [ lib.teams.geospatial ]; + platforms = lib.platforms.linux; + mainProgram = "e57inspector"; + }; +}) From f3d20a1d7497bfcf9e41ee7f2015cf05f8020d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= Date: Fri, 8 May 2026 13:57:04 +0200 Subject: [PATCH 2/2] e57inspector.tests: Add NixOS VM test --- nixos/tests/all-tests.nix | 1 + nixos/tests/e57inspector.nix | 38 ++++++++++++++++++++++++ pkgs/by-name/e5/e57inspector/package.nix | 6 ++++ 3 files changed, 45 insertions(+) create mode 100644 nixos/tests/e57inspector.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 1283bb8bf3cd..9d2af35327e3 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -491,6 +491,7 @@ in drupal = runTest ./drupal.nix; dublin-traceroute = runTest ./dublin-traceroute.nix; dwl = runTestOn [ "x86_64-linux" "aarch64-linux" ] ./dwl.nix; + e57inspector = runTest ./e57inspector.nix; early-mount-options = runTest ./early-mount-options.nix; earlyoom = runTestOn [ "x86_64-linux" ] ./earlyoom.nix; easytier = runTest ./easytier.nix; diff --git a/nixos/tests/e57inspector.nix b/nixos/tests/e57inspector.nix new file mode 100644 index 000000000000..d421b69f2101 --- /dev/null +++ b/nixos/tests/e57inspector.nix @@ -0,0 +1,38 @@ +{ pkgs, ... }: +{ + name = "e57inspector"; + meta.maintainers = with pkgs.lib.maintainers; [ + nh2 + chpatrick + ]; + + nodes.machine = + { ... }: + { + imports = [ + ./common/x11.nix + ]; + + services.xserver.enable = true; + environment.systemPackages = [ + pkgs.e57inspector + pkgs.xdotool + ]; + }; + + testScript = + let + testFile = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/asmaloney/libE57Format-test-data/bbcacec05d60f923869545c5eab33d94c390d50e/self/ColouredCubeFloat.e57"; + hash = "sha256-bb95crNYvX3Qhkx4k6Sqe2GjOf1u4nxxswMfdjyXfTM="; + }; + in + '' + start_all() + machine.wait_for_x() + + machine.execute("e57inspector ${testFile} >&2 &") + machine.wait_until_succeeds("xdotool search --pid $(pidof .e57inspector-wrapped)") + machine.screenshot("screen") + ''; +} diff --git a/pkgs/by-name/e5/e57inspector/package.nix b/pkgs/by-name/e5/e57inspector/package.nix index f8cdcf60ae0b..895ced7a183c 100644 --- a/pkgs/by-name/e5/e57inspector/package.nix +++ b/pkgs/by-name/e5/e57inspector/package.nix @@ -2,9 +2,11 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, qt6, xercesc, + nixosTests, }: stdenv.mkDerivation (finalAttrs: { @@ -60,6 +62,10 @@ stdenv.mkDerivation (finalAttrs: { runHook postInstall ''; + passthru.tests = { + e57inspector = nixosTests.e57inspector; + }; + meta = { description = "Cross-platform E57 file viewer to list and view stored point clouds, images and metadata"; homepage = "https://github.com/sisakat/e57inspector";