finished set_library_path for MacOS .app build

pull/521/head
AlexandreRouma 2021-11-15 17:20:06 +01:00
rodzic 40e2564ef9
commit 7ad616d62b
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -1,14 +1,18 @@
#!/bin/sh
set -e
# Options
WANTED_LIB=$1
NEW_PATH=$2
EXEC=$3
# Function to extract the first element of a space seperated list
get_first_arg() {
echo $1
}
CURRENT_RPATH=$(get_first_arg $(otool -L $EXEC | grep $WANTED_LIB))
# Get current path
CURRENT_PATH=$(get_first_arg $(otool -L $EXEC | grep $WANTED_LIB))
echo $CURRENT_RPATH
# Change to the new path
install_name_tool -change $CURRENT_PATH $NEW_PATH $EXEC