Skip to content

Commit ed203d3

Browse files
committed
Revert "Recurse dylibs to catch libcrypto"
This reverts commit 0e6c39f.
1 parent 35adf81 commit ed203d3

File tree

1 file changed

+25
-30
lines changed

1 file changed

+25
-30
lines changed

packages/macos/get-dylibs.sh

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,32 @@
22

33
INSTALLDIR=$1
44

5-
while true; do
6-
EXES=$(find $INSTALLDIR -type f -perm -u+x)
7-
LIBS=$(otool -L $EXES | grep -E "/opt/homebrew|/usr/local/opt" | grep -v python | sort | uniq | grep -o -E "/.*\.dylib")
5+
EXES=$(find $INSTALLDIR -type f -perm -u+x)
6+
LIBS=$(otool -L $EXES | grep -E "/opt/homebrew|/usr/local/opt" | grep -v python | sort | uniq | grep -o -E "/.*\.dylib")
87

9-
if [ ! $LIBS ]; then
10-
echo "All libraries done"
11-
exit 0;
12-
fi
8+
if [ ! $LIBS ]; then
9+
exit 1;
10+
fi
1311

14-
echo "Libraries found: $LIBS"
15-
16-
while IFS= read -r lib; do
17-
echo
18-
echo $lib
19-
libname=$(echo $lib | grep -o -E "[^/]*\.dylib")
20-
echo $libname
21-
echo
22-
while IFS= read -r exe; do
23-
if file $exe | grep "Mach-O 64-bit" > /dev/null; then
24-
if otool -L $exe | grep -o $lib > /dev/null; then
25-
echo "$exe $(otool -L $exe | grep -o $lib)"
26-
exedir=$(echo $exe | grep -o -E ".*/")
27-
install_name_tool -change $lib @loader_path/$libname $exe
28-
if ! otool -l $exe | grep "LC_RPATH" -A2 | grep "@loader_path" > /dev/null; then
29-
install_name_tool -add_rpath @loader_path/ $exe
30-
fi
31-
if [ ! -f $exedir$libname ]; then
32-
cp $lib $exedir$libname
33-
fi
12+
while IFS= read -r lib; do
13+
echo
14+
echo $lib
15+
libname=$(echo $lib | grep -o -E "[^/]*\.dylib")
16+
echo $libname
17+
echo
18+
while IFS= read -r exe; do
19+
if file $exe | grep "Mach-O 64-bit executable" > /dev/null; then
20+
if otool -L $exe | grep -o $lib > /dev/null; then
21+
echo "$exe $(otool -L $exe | grep -o $lib)"
22+
exedir=$(echo $exe | grep -o -E ".*/")
23+
install_name_tool -change $lib @loader_path/$libname $exe
24+
if ! otool -l $exe | grep "LC_RPATH" -A2 | grep "@loader_path" > /dev/null; then
25+
install_name_tool -add_rpath @loader_path/ $exe
26+
fi
27+
if [ ! -f $exedir$libname ]; then
28+
cp $lib $exedir$libname
3429
fi
3530
fi
36-
done <<< "$EXES"
37-
done <<< "$LIBS"
38-
done
31+
fi
32+
done <<< "$EXES"
33+
done <<< "$LIBS"

0 commit comments

Comments
 (0)