File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,3 +12,4 @@ package 'nvidia-opencl-dev'
1212package 'ocl-icd-opencl-dev'
1313package 'opencl-headers'
1414package 'pkg-config'
15+ package 'patchelf'
Original file line number Diff line number Diff line change @@ -87,4 +87,16 @@ else()
8787 target_include_directories (${CMAKE_PROJECT_NAME } SYSTEM PUBLIC "${onnxruntime_SOURCE_DIR } /include" )
8888 install (FILES ${Onnxruntime_INSTALL_LIBS} DESTINATION "${CMAKE_INSTALL_LIBDIR} /obs-plugins/${CMAKE_PROJECT_NAME } " )
8989 set_target_properties (${CMAKE_PROJECT_NAME } PROPERTIES INSTALL_RPATH "$ORIGIN/${CMAKE_PROJECT_NAME } " )
90+
91+ find_program (PATCHELF_EXE patchelf )
92+ if (PATCHELF_EXE)
93+ add_custom_command (
94+ TARGET ${CMAKE_PROJECT_NAME }
95+ POST_BUILD
96+ COMMAND ${PATCHELF_EXE} --replace-needed libonnxruntime.so.1 libonnxruntime.so.${Onnxruntime_VERSION}
97+ $<TARGET_FILE :${CMAKE_PROJECT_NAME } >
98+ COMMENT "Fixing ONNX dependency name for portability" )
99+ else ()
100+ message (WARNING "patchelf not found! The binary will still look for libonnxruntime.so.1" )
101+ endif ()
90102endif ()
Original file line number Diff line number Diff line change @@ -202,6 +202,19 @@ modules:
202202 chmod 755 ${FLATPAK_DEST}/uic-wrapper
203203 sources : []
204204
205+ # patchelf - for direct so version linking
206+ - name : patchelf
207+ buildsystem : simple
208+ build-commands :
209+ - install -D patchelf ${FLATPAK_DEST}/bin/patchelf
210+ sources :
211+ - type : archive
212+ url : https://github.com/NixOS/patchelf/releases/download/0.18.0/patchelf-0.18.0-x86_64.tar.gz
213+ strip-components : 2
214+ sha256 : ce84f2447fb7a8679e58bc54a20dc2b01b37b5802e12c57eece772a6f14bf3f0
215+ cleanup :
216+ - /bin/patchelf
217+ - /bin
205218 # OBS LocalVocal - Main plugin
206219 - name : obs-localvocal
207220 buildsystem : cmake-ninja
You can’t perform that action at this time.
0 commit comments