-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: remove the shell script and docs for installing APISIX on MacOS (
- Loading branch information
1 parent
aa4da82
commit 847db2a
Showing
8 changed files
with
14 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,6 @@ ENV_LUAROCKS ?= luarocks | |
ENV_INST_PREFIX ?= /usr | ||
ENV_INST_LUADIR ?= $(ENV_INST_PREFIX)/share/lua/5.1 | ||
ENV_INST_BINDIR ?= $(ENV_INST_PREFIX)/bin | ||
ENV_HOMEBREW_PREFIX ?= /usr/local | ||
ENV_RUNTIME_VER ?= $(shell $(ENV_NGINX_EXEC) -V 2>&1 | tr ' ' '\n' | grep 'APISIX_RUNTIME_VER' | cut -d '=' -f2) | ||
|
||
-include .requirements | ||
|
@@ -67,29 +66,6 @@ ifneq ($(shell test -d $(ENV_OPENSSL_PREFIX) && echo -n yes), yes) | |
endif | ||
endif | ||
|
||
# ENV patch for darwin | ||
ifeq ($(ENV_OS_NAME), darwin) | ||
ifeq ($(ENV_OS_ARCH), arm64) | ||
ENV_HOMEBREW_PREFIX := /opt/homebrew | ||
ENV_INST_BINDIR := $(ENV_INST_PREFIX)/local/bin | ||
ENV_INST_LUADIR := $(shell which lua | xargs realpath | sed 's/bin\/lua//g') | ||
endif | ||
|
||
# OSX archive `._` cache file | ||
ENV_TAR := COPYFILE_DISABLE=1 $(ENV_TAR) | ||
ENV_LUAROCKS := $(ENV_LUAROCKS) --lua-dir=$(ENV_HOMEBREW_PREFIX)/opt/[email protected] | ||
|
||
ifeq ($(shell test -d $(ENV_HOMEBREW_PREFIX)/opt/openresty-openssl && echo -n yes), yes) | ||
ENV_OPENSSL_PREFIX := $(ENV_HOMEBREW_PREFIX)/opt/openresty-openssl | ||
endif | ||
ifeq ($(shell test -d $(ENV_HOMEBREW_PREFIX)/opt/openresty-openssl3 && echo -n yes), yes) | ||
ENV_OPENSSL_PREFIX := $(ENV_HOMEBREW_PREFIX)/opt/openresty-openssl3 | ||
endif | ||
ifeq ($(shell test -d $(ENV_HOMEBREW_PREFIX)/opt/pcre && echo -n yes), yes) | ||
ENV_PCRE_PREFIX := $(ENV_HOMEBREW_PREFIX)/opt/pcre | ||
endif | ||
endif | ||
|
||
|
||
# Makefile basic extension function | ||
_color_red =\E[1;31m | ||
|
@@ -144,13 +120,7 @@ endif | |
.PHONY: help | ||
help: | ||
@$(call func_echo_success_status, "Makefile rules:") | ||
@echo | ||
@if [ '$(ENV_OS_NAME)' = 'darwin' ]; then \ | ||
awk '{ if(match($$0, /^#{3}([^:]+):(.*)$$/)){ split($$0, res, ":"); gsub(/^#{3}[ ]*/, "", res[1]); _desc=$$0; gsub(/^#{3}([^:]+):[ \t]*/, "", _desc); printf(" make %-15s : %-10s\n", res[1], _desc) } }' Makefile; \ | ||
else \ | ||
awk '{ if(match($$0, /^\s*#{3}\s*([^:]+)\s*:\s*(.*)$$/, res)){ printf(" make %-15s : %-10s\n", res[1], res[2]) } }' Makefile; \ | ||
fi | ||
@echo | ||
@awk '{ if(match($$0, /^\s*#{3}\s*([^:]+)\s*:\s*(.*)$$/, res)){ printf(" make %-15s : %-10s\n", res[1], res[2]) } }' Makefile | ||
|
||
|
||
### deps : Installing dependencies | ||
|
@@ -161,7 +131,6 @@ deps: install-runtime | |
mkdir -p ~/.luarocks; \ | ||
$(ENV_LUAROCKS) config $(ENV_LUAROCKS_FLAG_LOCAL) variables.OPENSSL_LIBDIR $(addprefix $(ENV_OPENSSL_PREFIX), /lib); \ | ||
$(ENV_LUAROCKS) config $(ENV_LUAROCKS_FLAG_LOCAL) variables.OPENSSL_INCDIR $(addprefix $(ENV_OPENSSL_PREFIX), /include); \ | ||
[ '$(ENV_OS_NAME)' == 'darwin' ] && $(ENV_LUAROCKS) config $(ENV_LUAROCKS_FLAG_LOCAL) variables.PCRE_INCDIR $(addprefix $(ENV_PCRE_PREFIX), /include); \ | ||
$(ENV_LUAROCKS) install apisix-master-0.rockspec --tree deps --only-deps $(ENV_LUAROCKS_SERVER_OPT); \ | ||
else \ | ||
$(call func_echo_warn_status, "WARNING: You're not using LuaRocks 3.x; please remove the luarocks and reinstall it via https://raw.githubusercontent.com/apache/apisix/master/utils/linux-install-luarocks.sh"); \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,12 +81,6 @@ function install_dependencies_with_apt() { | |
sudo apt-get install -y curl make gcc g++ cpanminus libpcre3 libpcre3-dev libldap2-dev unzip openresty-zlib-dev openresty-pcre-dev | ||
} | ||
|
||
# Install dependencies on mac osx | ||
function install_dependencies_on_mac_osx() { | ||
# install OpenResty, etcd and some compilation tools | ||
brew install openresty/brew/openresty luarocks [email protected] wget curl git pcre openldap | ||
} | ||
|
||
# Identify the different distributions and call the corresponding function | ||
function multi_distro_installation() { | ||
if grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then | ||
|
@@ -102,7 +96,7 @@ function multi_distro_installation() { | |
elif grep -Eqi "Arch" /etc/issue || grep -Eqi "EndeavourOS" /etc/issue || grep -Eq "Arch" /etc/*-release; then | ||
install_dependencies_with_aur | ||
else | ||
echo "Non-supported operating system version" | ||
echo "Non-supported distribution, APISIX is only supported on Linux-based systems" | ||
exit 1 | ||
fi | ||
install_apisix_runtime | ||
|
@@ -120,7 +114,7 @@ function multi_distro_uninstallation() { | |
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then | ||
sudo apt-get autoremove -y openresty-zlib-dev openresty-pcre-dev | ||
else | ||
echo "Non-supported operating system version" | ||
echo "Non-supported distribution, APISIX is only supported on Linux-based systems" | ||
exit 1 | ||
fi | ||
} | ||
|
@@ -152,12 +146,11 @@ function main() { | |
if [[ "${OS_NAME}" == "linux" ]]; then | ||
multi_distro_installation | ||
install_luarocks | ||
elif [[ "${OS_NAME}" == "darwin" ]]; then | ||
install_dependencies_on_mac_osx | ||
return | ||
else | ||
echo "Non-supported distribution" | ||
echo "Non-supported distribution, APISIX is only supported on Linux-based systems" | ||
exit 1 | ||
fi | ||
return | ||
fi | ||
|
||
case_opt=$1 | ||
|
@@ -169,7 +162,7 @@ function main() { | |
if [[ "${OS_NAME}" == "linux" ]]; then | ||
multi_distro_uninstallation | ||
else | ||
echo "Non-supported distribution" | ||
echo "Non-supported distribution, APISIX is only supported on Linux-based systems" | ||
fi | ||
;; | ||
*) | ||
|