Commit a68cd0aa authored by Manuel Grizonnet's avatar Manuel Grizonnet

Merge branch...

Merge branch '1672-linux-self-extracting-binary-does-not-install-correctly-on-debian-stretch' into 'develop'

Resolve "Linux self extracting binary does not install correctly on Debian Stretch"

Closes #1672

See merge request !180
parents 64690304 9629e2fe
......@@ -39,8 +39,6 @@ cd "$DIRNAME_0"
OUT_DIR=$(pwd)
PATCH_ELF_EXE="$OUT_DIR/patchelf"
#do not move below block. it must be before "unset LD_LIBRARY_PATH" code
#check if we have any python bindings
if [ -f "$OUT_DIR/lib/python/_otbApplication.so" ] ; then
......@@ -52,13 +50,11 @@ fi
unset LD_LIBRARY_PATH
# we remove files in $OUT_DIR/lib/gtk which we CANNOT add new rpath
BINARY_FILES=$(find "$OUT_DIR/lib" "$OUT_DIR/bin" "$OUT_DIR/plugins" -type f -exec file {} \; | grep -v '/lib/gtk/' | grep -i elf|cut -f1 -d':')
BINARY_FILES=$(find "./lib" "./bin" "./plugins" -type f -exec file {} \; | grep -v '/lib/gtk/' | grep -i ': elf ' | cut -f1 -d':')
# run patchelf
for bin_file in $BINARY_FILES; do
#echo "adding rpath to $bin_file"
if [ -f "$bin_file" ]; then
"$PATCH_ELF_EXE" "--set-rpath" "$OUT_DIR/lib" "$bin_file"
fi
./patchelf "--set-rpath" "$OUT_DIR/lib" "$bin_file"
done
#install uninstall_otb script
......
......@@ -51,18 +51,16 @@ unset DYLD_FALLBACK_LIBRARY_PATH
echo "Configuring..."
LIB_FILES=$(find "$OUT_DIR/lib" "$OUT_DIR/plugins" -type f -exec file {} \; | grep -i "Mach-O"|cut -d ':' -f1)
BIN_FILES=$(find "$OUT_DIR/bin" -type f -exec file {} \; | grep -i "Mach-O*.*executable"|cut -d ':' -f1)
LIB_FILES=$(find "./lib" "./plugins" -type f -exec file {} \; | grep -i ": Mach-O "|cut -d ':' -f1)
BIN_FILES=$(find "./bin" -type f -exec file {} \; | grep -i ": Mach-O .*executable"|cut -d ':' -f1)
# run install_name_tool
for input_file in $LIB_FILES $BIN_FILES; do
#echo "adding rpath to $OUT_DIR/$lib_file"
if [ -f "$input_file" ]; then
input_file_old_rpaths=$(otool -l "$input_file" | grep -A 3 "LC_RPATH" | grep -oE 'path .* \(offset' | cut -d ' ' -f 2)
for rpath_old in $input_file_old_rpaths; do
install_name_tool "-delete_rpath" "$rpath_old" "$input_file"
done
install_name_tool "-add_rpath" "$OUT_DIR/lib" "$input_file"
fi
input_file_old_rpaths=$(otool -l "$input_file" | grep -A 3 "LC_RPATH" | grep -oE 'path .* \(offset' | cut -d ' ' -f 2)
for rpath_old in $input_file_old_rpaths; do
install_name_tool "-delete_rpath" "$rpath_old" "$input_file"
done
install_name_tool "-add_rpath" "$OUT_DIR/lib" "$input_file"
done
#install uninstall_otb script
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment