From 22ed6259dc6ca2b462498a8f7294a4b2e8c11cbe Mon Sep 17 00:00:00 2001 From: Ben Darwin Date: Wed, 26 Apr 2023 17:42:52 -0400 Subject: [PATCH] rtabmap: unstable-2022-09-24 -> 0.21.0; unbreak --- .../rtabmap/0001-remove-printer-support.patch | 139 ------------------ pkgs/applications/video/rtabmap/default.nix | 50 ++++--- pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 30 insertions(+), 161 deletions(-) delete mode 100644 pkgs/applications/video/rtabmap/0001-remove-printer-support.patch diff --git a/pkgs/applications/video/rtabmap/0001-remove-printer-support.patch b/pkgs/applications/video/rtabmap/0001-remove-printer-support.patch deleted file mode 100644 index f3b31ed95861..000000000000 --- a/pkgs/applications/video/rtabmap/0001-remove-printer-support.patch +++ /dev/null @@ -1,139 +0,0 @@ -From c04ce502d29f7769efbff730d1f9060b8c24629a Mon Sep 17 00:00:00 2001 -From: ckie -Date: Tue, 8 Feb 2022 19:18:49 +0200 -Subject: [PATCH] remove printer support - ---- - app/src/CMakeLists.txt | 4 ++-- - guilib/src/CMakeLists.txt | 4 ++-- - guilib/src/GraphViewer.cpp | 12 +----------- - guilib/src/ImageView.cpp | 16 ---------------- - guilib/src/utilite/UPlot.cpp | 9 --------- - 5 files changed, 5 insertions(+), 40 deletions(-) - -diff --git a/app/src/CMakeLists.txt b/app/src/CMakeLists.txt -index b20a07d4..2cad8c1e 100644 ---- a/app/src/CMakeLists.txt -+++ b/app/src/CMakeLists.txt -@@ -63,9 +63,9 @@ ENDIF() - TARGET_LINK_LIBRARIES(rtabmap rtabmap_core rtabmap_gui rtabmap_utilite ${LIBRARIES}) - IF(Qt5_FOUND) - IF(Qt5Svg_FOUND) -- QT5_USE_MODULES(rtabmap Widgets Core Gui Svg PrintSupport) -+ QT5_USE_MODULES(rtabmap Widgets Core Gui Svg) - ELSE() -- QT5_USE_MODULES(rtabmap Widgets Core Gui PrintSupport) -+ QT5_USE_MODULES(rtabmap Widgets Core Gui) - ENDIF() - ENDIF(Qt5_FOUND) - -diff --git a/guilib/src/CMakeLists.txt b/guilib/src/CMakeLists.txt -index 3711205b..a393aa25 100644 ---- a/guilib/src/CMakeLists.txt -+++ b/guilib/src/CMakeLists.txt -@@ -208,9 +208,9 @@ ADD_LIBRARY(rtabmap_gui ${SRC_FILES}) - TARGET_LINK_LIBRARIES(rtabmap_gui rtabmap_core rtabmap_utilite ${LIBRARIES}) - IF(Qt5_FOUND) - IF(Qt5Svg_FOUND) -- QT5_USE_MODULES(rtabmap_gui Widgets Core Gui Svg PrintSupport) -+ QT5_USE_MODULES(rtabmap_gui Widgets Core Gui Svg) - ELSE() -- QT5_USE_MODULES(rtabmap_gui Widgets Core Gui PrintSupport) -+ QT5_USE_MODULES(rtabmap_gui Widgets Core Gui) - ENDIF() - ENDIF(Qt5_FOUND) - -diff --git a/guilib/src/GraphViewer.cpp b/guilib/src/GraphViewer.cpp -index 58907c34..7b41061f 100644 ---- a/guilib/src/GraphViewer.cpp -+++ b/guilib/src/GraphViewer.cpp -@@ -38,7 +38,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - #include - #include - #include --#include - #include - #ifdef QT_SVG_LIB - #include -@@ -2011,16 +2010,7 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event) - this->scene()->setSceneRect(this->scene()->itemsBoundingRect()); // Re-shrink the scene to it's bounding contents - QSize sceneSize = this->scene()->sceneRect().size().toSize(); - -- if(QFileInfo(filePath).suffix().compare("pdf") == 0) -- { -- QPrinter printer(QPrinter::HighResolution); -- printer.setOrientation(QPrinter::Portrait); -- printer.setOutputFileName( filePath ); -- QPainter p(&printer); -- scene()->render(&p); -- p.end(); -- } -- else if(QFileInfo(filePath).suffix().compare("svg") == 0) -+ if(QFileInfo(filePath).suffix().compare("svg") == 0) - { - #ifdef QT_SVG_LIB - QSvgGenerator svgGen; -diff --git a/guilib/src/ImageView.cpp b/guilib/src/ImageView.cpp -index 714f2d36..887e7bdc 100644 ---- a/guilib/src/ImageView.cpp -+++ b/guilib/src/ImageView.cpp -@@ -37,7 +37,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - #include - #include - #include --#include - #include - #include "rtabmap/utilite/ULogger.h" - #include "rtabmap/gui/KeypointItem.h" -@@ -843,21 +842,6 @@ void ImageView::contextMenuEvent(QContextMenuEvent * e) - } - - _savedFileName = text; -- if(QFileInfo(text).suffix().compare("pdf") == 0) -- { -- QPrinter printer(QPrinter::HighResolution); -- printer.setOrientation(QPrinter::Portrait); -- printer.setOutputFileName( text ); -- QPainter p(&printer); -- p.begin(&printer); -- double xscale = printer.pageRect().width()/double(_graphicsView->sceneRect().width()); -- double yscale = printer.pageRect().height()/double(_graphicsView->sceneRect().height()); -- double scale = qMin(xscale, yscale); -- p.scale(scale, scale); -- _graphicsView->scene()->render(&p, _graphicsView->sceneRect(), _graphicsView->sceneRect()); -- p.end(); -- } -- else - { - QImage img(_graphicsView->sceneRect().width(), _graphicsView->sceneRect().height(), QImage::Format_ARGB32_Premultiplied); - QPainter p(&img); -diff --git a/guilib/src/utilite/UPlot.cpp b/guilib/src/utilite/UPlot.cpp -index 1b11c65e..8bf94841 100644 ---- a/guilib/src/utilite/UPlot.cpp -+++ b/guilib/src/utilite/UPlot.cpp -@@ -42,7 +42,6 @@ - #include - #include - #include --#include - #include - #include - #ifdef QT_SVG_LIB -@@ -2849,14 +2848,6 @@ void UPlot::contextMenuEvent(QContextMenuEvent * event) - else - { - #endif -- if(QFileInfo(text).suffix().compare("pdf") == 0) -- { -- QPrinter printer; -- printer.setOutputFormat(QPrinter::PdfFormat); -- printer.setOutputFileName(text); -- this->render(&printer); -- } -- else - { - QPixmap figure = QPixmap::grabWidget(this); - figure.save(text); --- -2.34.1 - diff --git a/pkgs/applications/video/rtabmap/default.nix b/pkgs/applications/video/rtabmap/default.nix index cecf6a3e4d3d..ecfd8a676bca 100644 --- a/pkgs/applications/video/rtabmap/default.nix +++ b/pkgs/applications/video/rtabmap/default.nix @@ -1,24 +1,40 @@ -{ lib, stdenv, fetchFromGitHub, pkg-config, cmake, opencv, pcl, libusb1, eigen -, wrapQtAppsHook, qtbase, g2o, ceres-solver, libpointmatcher, octomap, freenect -, libdc1394, librealsense, libGL, libGLU, vtk_8_withQt5, wrapGAppsHook, liblapack -, xorg }: +{ lib +, stdenv +, fetchFromGitHub +, pkg-config +, cmake +, opencv +, pcl +, libusb1 +, eigen +, wrapQtAppsHook +, qtbase +, g2o +, ceres-solver +, libpointmatcher +, octomap +, freenect +, libdc1394 +, librealsense +, libGL +, libGLU +, vtkWithQt5 +, wrapGAppsHook +, liblapack +, xorg +}: stdenv.mkDerivation rec { pname = "rtabmap"; - version = "unstable-2022-09-24"; + version = "0.21.0"; src = fetchFromGitHub { owner = "introlab"; repo = "rtabmap"; - rev = "fa31affea0f0bd54edf1097b8289209c7ac0548e"; - sha256 = "sha256-kcY+o31fSmwxBcvF/e+Wu6OIqiQzLKgEJJxcj+g3qDM="; + rev = "refs/tags/${version}"; + hash = "sha256-1xb8O3VrErldid2OgAUMG28mSUO7QBUsPuSz8p03tSI"; }; - patches = [ - # Our Qt5 seems to be missing PrintSupport.. I think? - ./0001-remove-printer-support.patch - ]; - nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook wrapGAppsHook ]; buildInputs = [ ## Required @@ -41,25 +57,17 @@ stdenv.mkDerivation rec { qtbase libGL libGLU - vtk_8_withQt5 + vtkWithQt5 ]; # Disable warnings that are irrelevant to us as packagers cmakeFlags = [ "-Wno-dev" ]; - # We run one of the executables we build while the build is - # still running (and patchelf hasn't been invoked) which means - # the RPATH is not set correctly. This hacks around that error: - # - # build/bin/rtabmap-res_tool: error while loading shared libraries: librtabmap_utilite.so.0.20: cannot open shared object file: No such file or directory - LD_LIBRARY_PATH = "/build/source/build/bin"; - meta = with lib; { description = "Real-Time Appearance-Based 3D Mapping"; homepage = "https://introlab.github.io/rtabmap/"; license = licenses.bsd3; maintainers = with maintainers; [ ckie ]; platforms = with platforms; linux; - broken = true; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index dac8b735a293..ec3e69a96dca 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11484,7 +11484,7 @@ with pkgs; rocket = libsForQt5.callPackage ../tools/graphics/rocket { }; rtabmap = libsForQt5.callPackage ../applications/video/rtabmap/default.nix { - pcl = pcl.override { vtk = vtk_8_withQt5; }; + pcl = pcl.override { vtk = vtkWithQt5; }; }; rtaudio = callPackage ../development/libraries/audio/rtaudio {