Skip to content

Commit

Permalink
chore(build): fix exec script of LuaRocks on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ADD-SP committed Oct 24, 2024
1 parent 9a5353e commit af22dcb
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions build/luarocks/templates/luarocks_exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,26 @@ OPENSSL_DIR=$root_path/$openssl_path
# but the linker expects `libexpat.so` to be present.
# So we create a symlink to the actual file
# if it doesn't exist.
if ! test -e $EXPAT_DIR/lib/libexpat.so; then
so=$(ls $EXPAT_DIR/lib/libexpat.*)
if [[ -z $so ]]; then
echo "No expat library found in $EXPAT_DIR/lib"
exit 1
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS uses `.dylib``
if ! test -e $EXPAT_DIR/lib/libexpat.dylib; then
dylib=$(ls $EXPAT_DIR/lib/libexpat.*)
if [[ -z $dylib ]]; then
echo "No expat library found in $EXPAT_DIR/lib"
exit 1
fi
ln -s $dylib $EXPAT_DIR/lib/libexpat.dylib
fi
else
# Linux uses `.so``
if ! test -e $EXPAT_DIR/lib/libexpat.so; then
so=$(ls $EXPAT_DIR/lib/libexpat.*)
if [[ -z $so ]]; then
echo "No expat library found in $EXPAT_DIR/lib"
exit 1
fi
ln -s $so $EXPAT_DIR/lib/libexpat.so
fi
ln -s $so $EXPAT_DIR/lib/libexpat.so
fi

# we use system libyaml on macos
Expand Down

0 comments on commit af22dcb

Please sign in to comment.