Skip to content

Commit 37dd5d3

Browse files
committed
fix
1 parent 352efca commit 37dd5d3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

scripts/build-postgres-darwin.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ for binary in "${binaries_to_check[@]}"; do
167167

168168
# Only process if the binary exists
169169
if [ -f "$binary_path" ]; then
170-
otool -L "$binary_path" | awk '{print $1}' | grep -E '/opt/homebrew|/usr/local|@executable_path' | while read dep; do
170+
otool -L "$binary_path" | awk '{print $1}' | grep -E '/opt/homebrew|/usr/local|@executable_path'"$INSTALL_DIR" | while read dep; do
171171
# Copy the dependency to the lib folder if it’s not already there
172172
cp -Lf "$dep" "$INSTALL_DIR/lib/" 2>/dev/null || true
173173
install_name_tool -change "$dep" "@executable_path/../lib/$(basename "$dep")" "$binary_path"
@@ -180,6 +180,7 @@ for binary in "${binaries_to_check[@]}"; do
180180
ln -sf "$base_name" "$INSTALL_DIR/lib/$symlink_name"
181181
fi
182182
done
183+
codesign --force --sign - "$binary_path"
183184
fi
184185
done
185186

@@ -195,12 +196,13 @@ for icu_lib in "${icu_libs[@]}"; do
195196
otool -L "$INSTALL_DIR/lib/$icu_lib" | awk '{print $1}' | grep "@loader_path" | while read dep; do
196197
install_name_tool -change "$dep" "@loader_path/$(basename "$dep")" "$INSTALL_DIR/lib/$icu_lib"
197198
done
199+
codesign --force --sign - "$INSTALL_DIR/lib/$icu_lib"
198200
done
199201

200202
# Update library paths within each .dylib in the lib directory
201203
for dylib in $INSTALL_DIR/lib/*.dylib; do
202204
install_name_tool -id "@executable_path/../lib/$(basename "$dylib")" "$dylib"
203-
otool -L "$dylib" | awk '{print $1}' | grep -E '/opt/homebrew|/usr/local|@executable_path' | while read dep; do
205+
otool -L "$dylib" | awk '{print $1}' | grep -E '/opt/homebrew|/usr/local|@executable_path'"$INSTALL_DIR" | while read dep; do
204206
# Ensure the library is copied to the lib folder if it’s not already there
205207
cp -Lf "$dep" "$INSTALL_DIR/lib/" 2>/dev/null || true
206208
install_name_tool -change "$dep" "@executable_path/../lib/$(basename "$dep")" "$dylib"
@@ -221,7 +223,7 @@ done
221223
cd $INSTALL_DIR
222224
cp -Rf $(git rev-parse --show-toplevel)/share/postgresql/extension/* share/extension
223225
tar -cJvf $TRG_DIR/postgres-macos.txz \
224-
share/extension \
226+
share \
225227
lib \
226228
bin/initdb \
227229
bin/pg_ctl \

0 commit comments

Comments
 (0)