[med-svn] [Git][med-team/sight][master] Add patch to fix dynamic loading of libraries

Flavien Bridault (@fbridault-guest) gitlab at salsa.debian.org
Fri Oct 15 08:41:22 BST 2021



Flavien Bridault pushed to branch master at Debian Med / sight


Commits:
66d505d0 by Flavien Bridault at 2021-10-15T09:32:14+02:00
Add patch to fix dynamic loading of libraries


- - - - -


4 changed files:

- debian/changelog
- + debian/patches/fix-dynamic-load.patch
- − debian/patches/fix-module-path.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -2,7 +2,8 @@ sight (21.0.0-1) UNRELEASED; urgency=medium
   [Flavien Bridault]
   * Rename vrrender package into sightviewer
   * Add package for sightcalibrator
-  * d/p/: refresh patches
+  * d/p/: remove patch to fix vrrender launch, no longer needed
+    Add patch to fix the loading of dynamic libraries at runtime    
 
   [Andreas Tille]
   * Team upload.


=====================================
debian/patches/fix-dynamic-load.patch
=====================================
@@ -0,0 +1,29 @@
+Author: Flavien Bridault <fbridault at ircad.fr>
+Description: Fix dynamic loading of libraries.
+Bug: https://git.ircad.fr/sight/sight/-/issues/788
+--- sight.orig/libs/core/core/runtime/detail/dl/Native.cpp
++++ sight/libs/core/core/runtime/detail/dl/Native.cpp
+@@ -57,7 +57,22 @@
+ const std::filesystem::path Native::getFullPath() const
+ {
+ #if defined(linux) || defined(__linux)
+-    const std::filesystem::path result = m_searchPath / ("lib" + this->getName() + ".so");
++    std::filesystem::path result;
++
++    const std::regex nativeFileRegex( "lib" + this->getName() + "\\.so\\.?[0-9\\.]*" );
++
++    // Walk through the module directory, seeking for a matching file.
++    std::filesystem::directory_iterator curDirEntry(m_searchPath);
++    std::filesystem::directory_iterator endDirEntry;
++    for(; curDirEntry != endDirEntry; ++curDirEntry)
++    {
++        std::filesystem::path curEntryPath( *curDirEntry );
++        if( std::regex_match( curEntryPath.filename().string(), nativeFileRegex ) )
++        {
++            result = m_searchPath / curEntryPath.filename();
++            break;
++        }
++    }
+ #elif defined(WIN32)
+     const std::filesystem::path result = m_searchPath / (this->getName() + ".dll");
+ #elif defined(__APPLE__)


=====================================
debian/patches/fix-module-path.patch deleted
=====================================
@@ -1,18 +0,0 @@
-Author: Flavien Bridault <fbridault at ircad.fr>
-Description: Fix vrrender launch.
-Bug: https://git.ircad.fr/sight/sight/-/issues/680
-Bug-Debian: http://bugs.debian.org/982262
-
---- sight.orig/libs/core/core/runtime/detail/Runtime.cpp
-+++ sight/libs/core/core/runtime/detail/Runtime.cpp
-@@ -58,8 +58,8 @@
- 
- Runtime::Runtime()
- {
--    // The lib location is 'SIGHT_DIR/lib/sight_core.dll'
--    m_workingPath = ::boost::dll::program_location().parent_path().parent_path().string();
-+    // The lib location is 'SIGHT_DIR/lib/x86_64-gnu-linux/sight_core.dll'
-+    m_workingPath = ::boost::dll::program_location().parent_path().parent_path().parent_path().string();
- }
- 
- //------------------------------------------------------------------------------


=====================================
debian/patches/series
=====================================
@@ -1 +1 @@
-fix-module-path.patch
+fix-dynamic-load.patch



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

-- 
View it on GitLab: https://salsa.debian.org/med-team/sight/-/commit/66d505d0bbb40a1a419ad1947eb3aa79d2f48dfc
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/20211015/d2ea31fa/attachment-0001.htm>


More information about the debian-med-commit mailing list