Skip to content

Commit 8c49188

Browse files
authored
Fix unable to build on macOS (#53)
Upgrade xmake verison to 2.8.9. Remove check xz (xmake currently only distributes gz pack). Fix typo: command_exist ->commands_exist. Fix xmake build process.
1 parent e2028bc commit 8c49188

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

build.sh

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ while [[ $# > 0 ]]; do
105105
esac
106106
done
107107

108-
XMAKE_VERSION="2.6.1"
108+
XMAKE_VERSION="2.8.9"
109109

110110
# Get current dir
111111
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@@ -229,27 +229,18 @@ if [[ ! -d "$XMAKE_DIR" ]] || [[ ! -x "$xmake" ]]; then
229229
fi
230230

231231
log-8601-local "Downloading and building xmake, this might take a while..."
232-
if commands_exist xz; then
233-
pack=xz
234-
elif command_exist gzip; then
232+
if commands_exist gzip; then
235233
pack=gz
236234
else
237-
msg-error "No decompression binary found, please install xz or gzip to continue"
235+
msg-error "No decompression binary found, please install gzip to continue"
238236
fi
239237

240238
log-8601-local "Downloading xmake runner..."
241239
curl -fSL "https://github.com/xmake-io/xmake/releases/download/v$XMAKE_VERSION/xmake-v$XMAKE_VERSION.$pack.run" > "$TOOLS_DIR/xmake.run"
242240
log-8601-local "Downloading xmake maybe..."
243241
sh "$TOOLS_DIR/xmake.run" --noexec --target "$XMAKE_BUILD_DIR"
244-
log-8601-local "Building xmake..."
245-
if (cd "$XMAKE_BUILD_DIR" && $make build); then
246-
msg-success "Build successful"
247-
else
248-
msg-error "Failed to build xmake"
249-
exit 1
250-
fi
251-
log-8601-local "Installing xmake..."
252-
if (cd "$XMAKE_BUILD_DIR" && DESTDIR="$TOOLS_DIR" PREFIX="xmake" $make install); then
242+
log-8601-local "Buinding and installing xmake..."
243+
if (cd "$XMAKE_BUILD_DIR" && ./configure && DESTDIR="$TOOLS_DIR" PREFIX="xmake" $make install); then
253244
msg-success "xmake installed successfully"
254245
else
255246
msg-error "Failed to install xmake"
@@ -263,4 +254,4 @@ do
263254
log-8601-local "Building for $arch..."
264255
"$xmake" f -a $arch -m $PROFILE --include_logging=$WITH_LOGGING
265256
"$xmake" "$@"
266-
done
257+
done

0 commit comments

Comments
 (0)