[med-svn] [Git][med-team/sight][wip] Fix gcc12 build and most lintian warnings

Flavien Bridault (@fbridault-guest) gitlab at salsa.debian.org
Mon Aug 1 08:35:58 BST 2022



Flavien Bridault pushed to branch wip at Debian Med / sight


Commits:
e5ec7af2 by Flavien Bridault at 2022-08-01T09:35:32+02:00
Fix gcc12 build and most lintian warnings


- - - - -


11 changed files:

- debian/changelog
- debian/control
- debian/libsight.install
- debian/not-installed
- + debian/patches/gcc12.patch
- + debian/patches/lintian_warnings.patch
- + debian/patches/manpages.patch
- + debian/patches/move-sightlog-in-libexec.patch
- debian/patches/series
- debian/sightcalibrator.install
- debian/sightviewer.install


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+sight (21.1.1-2) UNRELEASED; urgency=medium
+
+  * d/p/: Remove patches applied upstream
+    Add several patches to fix lintian warnings
+    Add fix to build with gcc12 (Closes: #1013036 #1016276)
+
+ -- Flavien Bridault <fbridault at ircad.fr>  Sat, 30 Jul 2022 09:51:09 +0200
+
 sight (21.1.1-1) unstable; urgency=medium
 
   [ Pierre Gruet ]
@@ -10,6 +18,8 @@ sight (21.1.1-1) unstable; urgency=medium
   [ Flavien Bridault ]
   * New upstream version
   * d/p/: Remove patches applied upstream
+    Add several patches to fix lintian warnings
+    Add fix to build with gcc12. Closes: #1013036
   * d/rules: disable samples build
   * Build-Depends: remove libcamp-dev
   * Depends: remove libcamp


=====================================
debian/control
=====================================
@@ -6,6 +6,7 @@ Priority: optional
 Build-Depends: cmake (>=3.19.0),
                dcmtk,
                debhelper-compat (= 13),
+               dh-exec,
                dbus-x11,
                libarchive-dev,
                libboost-all-dev,
@@ -24,6 +25,7 @@ Build-Depends: cmake (>=3.19.0),
                libvtk9-dev,
                libvtkgdcm-dev,
                libvtk9-qt-dev,
+               pandoc,
                qt3d5-dev,
                qtmultimedia5-dev,
                qtquickcontrols2-5-dev,
@@ -122,8 +124,8 @@ Description: DICOM viewer
  reconstruction, and volume rendering.
  .
  Many image formats are handled such as DICOM, mhd,
- inr.gz, vtk, vti,... Segmentations meshes can also
- be imported from DICOM and vtk formats, and visualized
+ inr.gz, vtk, vti,... Reconstructions can also be imported from 
+ DICOM segmentations or VTK supported formats, and visualized
  in mixed rendering with images.
  .
  Tools are provided to measure distances of
@@ -141,7 +143,7 @@ Description: Camera calibration software
  User-friendly application to calibrate mono and stereo cameras.
  .
  SightCalibrator can take images, video files, or any supported
- camera device as input. It detects the presence of a checkboard
+ camera device as input. It detects the presence of a checkerboard
  in images. The parameters of the checkboard can be customized.
  Individual images can then be marked to be used in the
  computation of the calibration. Last, the intrinsic and extrinsic


=====================================
debian/libsight.install
=====================================
@@ -1,4 +1,10 @@
-usr/bin/sightrun*
-usr/bin/sightlog*
+#! /usr/bin/dh-exec
+usr/bin/sightrun.bin => /usr/bin/sightrun
+usr/bin/sightlog.bin => /usr/libexec/sightlog
 usr/lib/*/libsight*.so.*
-usr/share/sight/[!S]*
+usr/share/sight/[a-u]*
+usr/share/sight/viz_qt3d
+usr/share/sight/viz_scene3d/*.cfg
+usr/share/sight/viz_scene3d/Media/compositors
+usr/share/sight/viz_scene3d/Media/[g-z]*
+usr/share/man/man1/sightrun.1


=====================================
debian/not-installed
=====================================
@@ -12,4 +12,8 @@ usr/bin/charucoBoard*
 usr/bin/charucoboard
 usr/bin/dicomanonymizer*
 usr/bin/dicomxplorer*
+usr/bin/sightlog
+usr/bin/sightrun
 usr/bin/versiongenerator*
+usr/share/sight/viz_scene3d/Media/fonts/DejaVuSans.ttf
+usr/share/sight/NetworkProxy*


=====================================
debian/patches/gcc12.patch
=====================================
@@ -0,0 +1,33 @@
+Author: Flavien Bridault <fbridault at ircad.fr>
+Description: Fix build with gcc12.
+Bug: https://git.ircad.fr/sight/sight/-/issues/919
+--- sight.orig/libs/core/core/com/SlotConnectionBase.hpp
++++ sight/libs/core/core/com/SlotConnectionBase.hpp
+@@ -32,7 +32,7 @@
+  * @brief Base class for Slot connection implementation.
+  * This class is for internal use purpose.
+  */
+-struct CORE_CLASS_API SlotConnectionBase : virtual core::BaseObject
++struct CORE_CLASS_API SlotConnectionBase : core::BaseObject
+ {
+     /**
+      * @name Typedefs
+--- sight.orig/libs/viz/scene3d/collisionTools/CollisionTools.cpp
++++ sight/libs/viz/scene3d/collisionTools/CollisionTools.cpp
+@@ -155,7 +155,7 @@
+ {
+     Ogre::Vector3 result;
+     Ogre::MovableObject* target = nullptr;
+-    float closestDistance;
++    float closestDistance = -1.0f;
+ 
+     // Check we are initialised.
+     if(mRaySceneQuery != nullptr)
+@@ -181,7 +181,6 @@
+     // There are some minor optimizations (distance based) that mean we wont have to
+     // check all of the objects most of the time, but the worst case scenario is that
+     // we need to test every triangle of every object.
+-    closestDistance = -1.0f;
+     Ogre::Vector3 closestResult;
+     Ogre::RaySceneQueryResult& queryResult = mRaySceneQuery->getLastResults();
+     for(std::size_t qrIdx = 0 ; qrIdx < queryResult.size() ; qrIdx++)


=====================================
debian/patches/lintian_warnings.patch
=====================================
@@ -0,0 +1,62 @@
+Author: Flavien Bridault <fbridault at ircad.fr>
+Description: Fix few lintian warnings.
+Forwarded: not-needed
+--- sight.orig/libs/viz/scene3d/rc/Media/materials/genDefaultMaterial.py
++++ sight/libs/viz/scene3d/rc/Media/materials/genDefaultMaterial.py
+@@ -1,4 +1,4 @@
+-#! /usr/bin/env python
++#!/usr/bin/python3
+ 
+ from jinja2 import Environment, PackageLoader, Template
+ from pprint import pprint
+--- sight.orig/libs/viz/scene3d/cmake/resources.cfg.in
++++ sight/libs/viz/scene3d/cmake/resources.cfg.in
+@@ -1,5 +1,5 @@
+ [Sight]
+-FileSystem=Media/fonts/
++FileSystem=/usr/share/fonts/truetype/dejavu/
+ FileSystem=Media/
+ 
+ FileSystem=Media/glsl/common
+@@ -29,4 +29,4 @@
+ FileSystem=Media/compositors/frag
+ FileSystem=Media/compositors/postFX
+ 
+-FileSystem=Media/meshes
+\ No newline at end of file
++FileSystem=Media/meshes
+--- sight.orig/cmake/build/macros.cmake
++++ sight/cmake/build/macros.cmake
+@@ -716,7 +716,7 @@
+             # Install shortcut
+             string(TOLOWER ${SIGHT_TARGET} APP_NAME)
+ 
+-            set(LAUNCHER "sightrun.bin")
++            set(LAUNCHER "sightrun")
+             set(PROFILE_PATH "${SIGHT_TARGET}/profile.xml")
+             if(FW_BUILD_EXTERNAL)
+                 set(LAUNCHER_PATH "${Sight_BINARY_DIR}")
+--- sight.orig/cmake/install/linux/package.cmake
++++ sight/cmake/install/linux/package.cmake
+@@ -8,8 +8,8 @@
+ 
+     if("${TARGET_TYPE}" STREQUAL "APP")
+ 
+-        set(LAUNCHER_PATH "bin/sightrun.bin")
+-        set(LAUNCHER "sightrun.bin")
++        set(LAUNCHER_PATH "bin/sightrun")
++        set(LAUNCHER "sightrun")
+         set(PROFILE_PATH "${PRJ_NAME}/profile.xml")
+ 
+         if(${FW_BUILD_EXTERNAL})
+@@ -20,8 +20,8 @@
+         endif()
+     elseif("${TARGET_TYPE}" STREQUAL "EXECUTABLE")
+ 
+-        set(LAUNCHER_PATH "bin/${PRJ_NAME}.bin")
+-        set(LAUNCHER "${PRJ_NAME}.bin")
++        set(LAUNCHER_PATH "bin/${PRJ_NAME}")
++        set(LAUNCHER "${PRJ_NAME}")
+         set(PROFILE_PATH "")
+ 
+     elseif()


=====================================
debian/patches/manpages.patch
=====================================
@@ -0,0 +1,272 @@
+Author: Flavien Bridault <fbridault at ircad.fr>
+Description: Add manual pages for sightrun, sightviewer and sightcalibrator.
+Bug: https://git.ircad.fr/sight/sight/-/issues/918
+--- /dev/null
++++ sight/apps/SightCalibrator/man.md
+@@ -0,0 +1,61 @@
++% SIGHTCALIBRATOR(1)
++% IRCAD
++% June 2022
++
++# NAME
++
++sighcalibrator - a camera calibration application.
++
++# SYNOPSIS
++
++**sighcalibrator** \[OPTIONS\]
++
++# DESCRIPTION
++
++**sighcalibrator** is a user-friendly application to calibrate mono and stereo cameras. It can take images, video files,
++or any supported camera device as input. It detects the presence of a checkerboard in images. The parameters of the checkerboard can be customized. Individual images can then be marked to be used in the computation of
++the calibration. Last, the intrinsic and extrinsic parameters can be exported in OpenCV format, Yaml or XML.
++
++# OPTIONS
++
++**-h**, **\--help**
++:   Display a friendly help message.
++
++**\--clog**
++:   Enable log output to console.
++
++**\--no-clog**
++:   Disable log output to console.
++
++**\--flog**
++:   Enable log output to file.
++
++**\--no-flog**
++:   Disable log output to file.
++
++**\--log-output arg**
++:   Log output filename. Default to sight.log.
++
++**\--log-trace**
++:   Set log level to trace.
++
++**\--log-debug**
++:   Set log level to debug.
++
++**\--log-info**
++:   Set log level to info.
++
++**\--log-warn**
++:   Set log level to warn.
++
++**\--log-error**
++:   Set log level to error.
++
++**\--log-fatal**
++:   Set log level to fatal.
++
++# BUGS
++
++For community support, see GitHub Issues: <https://github.com/IRCAD/Sight/issues>.
++
++Also, internal bug reports can be found on <https://git.ircad.fr/sight/sight/-/issues>.
+--- /dev/null
++++ sight/apps/SightViewer/man.md
+@@ -0,0 +1,63 @@
++% SIGHTVIEWER(1)
++% IRCAD
++% June 2022
++
++# NAME
++
++sightviewer - medical image viewer.
++
++# SYNOPSIS
++
++**sightviewer** \[OPTIONS\]
++
++# DESCRIPTION
++
++**sightviewer** is a medical image viewer featuring negatoscope, multi-planar reconstruction, and volume rendering.
++Many image formats are handled such as DICOM, mhd, inr.gz, vtk, vti,... Reconstructions can also be imported from DICOM
++segmentations or VTK supported formats, and visualized in mixed rendering with images.
++Tools are provided to measure distances of structures in the image and to place landmarks.
++Last, SightViewer can also connect directly to a PACS, and then request, download or upload DICOM files.
++
++# OPTIONS
++
++**-h**, **\--help**
++:   Display a friendly help message.
++
++**\--clog**
++:   Enable log output to console.
++
++**\--no-clog**
++:   Disable log output to console.
++
++**\--flog**
++:   Enable log output to file.
++
++**\--no-flog**
++:   Disable log output to file.
++
++**\--log-output arg**
++:   Log output filename. Default to sight.log.
++
++**\--log-trace**
++:   Set log level to trace.
++
++**\--log-debug**
++:   Set log level to debug.
++
++**\--log-info**
++:   Set log level to info.
++
++**\--log-warn**
++:   Set log level to warn.
++
++**\--log-error**
++:   Set log level to error.
++
++**\--log-fatal**
++:   Set log level to fatal.
++
++# BUGS
++
++For community support, see GitHub Issues: <https://github.com/IRCAD/Sight/issues>.
++
++Also, internal bug reports can be found on <https://git.ircad.fr/sight/sight/-/issues>.
+--- /dev/null
++++ sight/cmake/build/linux/manpage.cmake
+@@ -0,0 +1,42 @@
++set(PANDOCCOMMAND_FOUND 0)
++find_program(PANDOCCOMMAND_PATH NAMES pandoc DOC "Path to Pandoc processor. Used to generate man pages from Markdown.")
++
++if(NOT EXISTS ${PANDOCCOMMAND_PATH})
++    message(
++        WARNING
++            "Pandoc processor not found, man pages will not be generated. Install pandoc or use the CMAKE_PROGRAM_PATH"
++            "variable."
++    )
++else()
++    set(PANDOCCOMMAND_FOUND 1)
++endif()
++
++# Add the targets to generate and install manual page with Pandoc
++function(add_man_page TARGET)
++    set(SRC "${CMAKE_CURRENT_SOURCE_DIR}/man.md")
++
++    if(EXISTS "${SRC}")
++
++        if(NOT ${PANDOCCOMMAND_FOUND})
++            return()
++        endif()
++
++        string(TOLOWER ${TARGET} TARGET_LOWER)
++        set(OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_LOWER}.1)
++
++        add_custom_command(
++            OUTPUT ${OUTPUT_PATH}
++            COMMAND ${PANDOCCOMMAND_PATH} -s -t man ${SRC} -o ${OUTPUT_PATH}
++            DEPENDS ${SRC}
++            WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
++            COMMENT "Generating man page ${SUBDIR_PATH_DIRECTORY}/${SUBDIR_PATH_NAME_WLE}"
++            VERBATIM
++        )
++
++        add_custom_target(
++            "man_${TARGET}" ALL DEPENDS ${OUTPUT_PATH} COMMENT "Dependency to trigger man page generation"
++        )
++
++        install(FILES ${OUTPUT_PATH} DESTINATION "${CMAKE_INSTALL_FULL_MANDIR}/man1" COMPONENT doc)
++    endif()
++endfunction(add_man_page)
+--- sight.orig/cmake/build/macros.cmake
++++ sight/cmake/build/macros.cmake
+@@ -1,3 +1,7 @@
++if(UNIX)
++    include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/build/linux/manpage.cmake)
++endif()
++
+ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+ 
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
+@@ -294,6 +298,8 @@
+                 WORLD_EXECUTE
+         )
+ 
++        add_man_page(${SIGHT_TARGET})
++
+     elseif(WIN32)
+         string(TOLOWER ${SIGHT_TARGET}.bat ${SIGHT_TARGET}_SCRIPT)
+         set(PROJECT_EXECUTABLE ${SIGHT_TARGET})
+@@ -749,6 +755,9 @@
+                     WORLD_READ
+                     WORLD_EXECUTE
+             )
++
++            add_man_page(${SIGHT_TARGET})
++
+         elseif(WIN32)
+             # Install shortcut
+             string(TOLOWER ${SIGHT_TARGET} APP_NAME)
+--- /dev/null
++++ sight/utils/sightrun/man.md
+@@ -0,0 +1,62 @@
++% SIGHTRUN(1)
++% IRCAD
++% June 2022
++
++# NAME
++
++sightrun - launcher for _Sight_ applications.
++
++# SYNOPSIS
++
++**sightrun** \[OPTIONS\] \[PROFILE(=profile.xml)\] \[PROFILE-ARGS ...\]
++
++# DESCRIPTION
++
++**sightrun** is the launcher for applications built with _Sight_, the Surgical Image Guidance and Healthcare Toolkit.
++
++# OPTIONS
++
++**-h**, **\--help**
++:   Display a friendly help message.
++
++**-B**
++:   Adds a module path.
++
++**\--clog**
++:   Enable log output to console.
++
++**\--no-clog**
++:   Disable log output to console.
++
++**\--flog**
++:   Enable log output to file.
++
++**\--no-flog**
++:   Disable log output to file.
++
++**\--log-output arg**
++:   Log output filename. Default to sight.log.
++
++**\--log-trace**
++:   Set log level to trace.
++
++**\--log-debug**
++:   Set log level to debug.
++
++**\--log-info**
++:   Set log level to info.
++
++**\--log-warn**
++:   Set log level to warn.
++
++**\--log-error**
++:   Set log level to error.
++
++**\--log-fatal**
++:   Set log level to fatal.
++
++# BUGS
++
++For community support, see GitHub Issues: <https://github.com/IRCAD/Sight/issues>.
++
++Also, internal bug reports can be found on <https://git.ircad.fr/sight/sight/-/issues>.


=====================================
debian/patches/move-sightlog-in-libexec.patch
=====================================
@@ -0,0 +1,13 @@
+Author: Flavien Bridault <fbridault at ircad.fr>
+Description: sightlog is installed in /usr/libexec, this updates its path in the loading code.
+Forwarded: not-needed
+--- sight.orig/libs/core/core/log/SpyLogger.cpp
++++ sight/libs/core/core/log/SpyLogger.cpp
+@@ -194,6 +194,7 @@
+             {
+                 decltype(boost::this_process::path()) bin_paths;
+                 bin_paths.push_back(boost::dll::program_location().remove_filename());
++                bin_paths.push_back("/usr/libexec");
+                 return boost::process::search_path("sightlog", bin_paths);
+             }();
+ 


=====================================
debian/patches/series
=====================================
@@ -1,5 +1,9 @@
+move-sightlog-in-libexec.patch
+lintian_warnings.patch
 disable-default-password.patch
 fix-itk5-build.patch
 fix-itk-build.patch
 fix-multi-arch-folder-detection.patch
 opencv4_6_0.patch
+gcc12.patch
+manpages.patch


=====================================
debian/sightcalibrator.install
=====================================
@@ -1,2 +1,3 @@
 usr/bin/sightcalibrator
 usr/share/sight/SightCalibrator*
+usr/share/man/man1/sightcalibrator.1


=====================================
debian/sightviewer.install
=====================================
@@ -1,2 +1,3 @@
 usr/bin/sightviewer
 usr/share/sight/SightViewer*
+usr/share/man/man1/sightviewer.1



View it on GitLab: https://salsa.debian.org/med-team/sight/-/commit/e5ec7af2955bf98b5ef68692f074512675665058

-- 
View it on GitLab: https://salsa.debian.org/med-team/sight/-/commit/e5ec7af2955bf98b5ef68692f074512675665058
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220801/79db0132/attachment-0001.htm>


More information about the debian-med-commit mailing list