安装xcode命令行
xcode-select --install
安装homebrew
/bin/zsh -c "$(curl -fsSL [https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh](https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh))"
github 代理
使用gitclone 代替git clonne 其实就算替换github地址为镜像地址
curl -O https://cdn.jsdelivr.net/gh/742481030/gitclone@2.0/gitclone)&&chmod u+x gitclone && mv gitclone /usr/local/bin/gitclone
安装nginx+php+mysql+redis
nohub brew install PHP&& brew install nginx&& brew install mysql&&brew install redis &
设置自启
brew services start php
brew services start nginx
brew services start mysql
brew services start nginx
brew services start redis
安装rclone 扩展你的硬盘
本人修改了rclone 可以支持世纪互联 onedrive和sharepoint,这里就不说怎么编译的了
安装go cgo交叉编译环境
安装go
brew install go
安装gcc交叉编译
arm工具链没找到,不用sqllite go可以交叉编译
brew install gcc@10
command -v x86_64-linux-musl-gcc || brew install FiloSottile/musl-cross/musl-cross
command -v x86_64-w64-mingw32-gcc || brew install mingw-w64
常用gcc编译这里以cloudreve为例
env CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CXX=x86_64-w64-mingw32-g++ GOOS=windows GOARCH=amd64 go build -v -ldflags "-s -w" -o cloudrev_x64.exe && upx -9 cloudrev_x64.exe ||echo "win64编译失败"
env CGO_ENABLED=1 CC=i686-w64-mingw32-gcc CXX=i686-w64w64-mingw32-g++ GOOS=windows GOARCH=386 go build -v -ldflags "-s -w" -o cloudre_x86.exe && upx -9 cloudre_x86.exe ||echo "win32编译失败"
env CGO_ENABLED=1 CC=x86_64-linux-musl-gcc GOOS=linux GOARCH=amd64 go build -ldflags "-linkmode external -extldflags -static -s -w" -o cloudreve_linux-64 && upx -9 cloudreve_linux-64 || echo "linux编译失败"
安装nodejs yarn
command -v node || brew install node
command -v yarn || brew install yarn
安装netcoresdk
curl -o coresdk.pkg https://download.visualstudio.microsoft.com/download/pr/1c1abbc4-1944-42e3-a591-4c665ffef858/328023243b52a9d165523c693ed83a93/dotnet-sdk-2.1.810-osx-x64.pkg && sudo installer -pkg coresdk.pkg -target /
安装jdk8
编译安装
curl -L -o jdk8.pkg https://share.mxin.ltd/?id=017IENQAPWCRXBLZCBLRGY6MOY4WY3ESCY && sudo installer -pkg jdk8.pkg -target /
brew 安装
brew install tomcat
开机自启
brew services start tomcat
环境变量
echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> /Users/jane/.bash_profile
安装upx 可执行文件压缩工具
command -v upx ||brew install uxp
安装supervisord
brew install supervisord
安装压缩工具 keka
brew cask install keka
编译php8
下载php
wget https://downloads.php.net/~carusogabriel/php-8.0.0rc1.tar.gz && tar zxvf php-8.0.0rc1.tar.gz
cd php-8.0.0rc1
编译参数
./configure --prefix=/usr/local/Cellar/php/8.0 \
--localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/8.0 --with-config-file-path=/usr/local/etc/php/8.0 \
--with-config-file-scan-dir=/usr/local/etc/php/8.0/conf.d --with-pear=/usr/local/Cellar/php/8.0/share/php/pear \
--with-os-sdkpath=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk --enable-bcmath --enable-calendar --enable-dba \
--enable-dtrace --enable-exif --enable-ftp --enable-fpm --enable-gd --enable-intl --enable-mbregex --enable-mbstring --enable-mysqlnd\
--enable-pcntl --enable-phpdbg --enable-phpdbg-readline --enable-phpdbg-webhelper --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg \
--enable-sysvsem --enable-sysvshm --with-bz2=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr --with-curl \
--with-external-gd --with-external-pcre --with-ffi --with-fpm-user=_www --with-fpm-group=_www --with-gettext=/usr/local/opt/gettext --with-gmp=/usr/local/opt/gmp\
--with-iconv=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr --with-kerberos --with-layout=GNU --with-ldap=/usr/local/opt/openldap --with-ldap-sasl \
--with-libxml --with-libedit --with-mhash=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr --with-mysql-sock=/tmp/mysql.sock --with-mysqli=mysqlnd \
--with-ndbm=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr --with-openssl --with-password-argon2=/usr/local/opt/argon2 \
--with-pdo-dblib=/usr/local/opt/freetds --with-pdo-mysql=mysqlnd --with-pdo-odbc=unixODBC,/usr/local/opt/unixodbc --with-pdo-pgsql=/usr/local/opt/libpq \
--with-pdo-sqlite --with-pgsql=/usr/local/opt/libpq --with-pic --with-pspell=/usr/local/opt/aspell --with-sodium --with-sqlite3\
--with-tidy=/usr/local/opt/tidy-html5 --with-unixODBC --with-xmlrpc --with-xsl --with-zip \
--with-zlib PKG_CONFIG_PATH=/usr/local/opt/openssl@1.1/lib/pkgconfig:/usr/local/opt/argon2/lib/pkgconfig:/usr/local/opt/brotli/lib/pkgconfig:/usr/local/opt/c-ares/lib/pkgconfig:/usr/local/opt/libidn/lib/pkgconfig:/usr/local/opt/libmetalink/lib/pkgconfig:/usr/local/opt/libssh2/lib/pkgconfig:/usr/local/opt/jansson/lib/pkgconfig:/usr/local/opt/jemalloc/lib/pkgconfig:/usr/local/opt/libevent/lib/pkgconfig:/usr/local/opt/nghttp2/lib/pkgconfig:/usr/local/opt/rtmpdump/lib/pkgconfig:/usr/local/opt/zstd/lib/pkgconfig:/usr/local/opt/curl-openssl/lib/pkgconfig:/usr/local/opt/unixodbc/lib/pkgconfig:/usr/local/opt/libpng/lib/pkgconfig:/usr/local/opt/freetype/lib/pkgconfig:/usr/local/opt/fontconfig/lib/pkgconfig:/usr/local/opt/jpeg/lib/pkgconfig:/usr/local/opt/libtiff/lib/pkgconfig:/usr/local/opt/webp/lib/pkgconfig:/usr/local/opt/gd/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/pcre/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig:/usr/local/opt/sqlite/lib/pkgconfig:/usr/local/opt/xz/lib/pkgconfig:/usr/local/opt/python@3.8/lib/pkgconfig:/usr/local/opt/glib/lib/pkgconfig:/usr/local/opt/gmp/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/libpq/lib/pkgconfig:/usr/local/opt/libsodium/lib/pkgconfig:/usr/local/opt/libzip/lib/pkgconfig:/usr/local/opt/oniguruma/lib/pkgconfig:/usr/local/opt/pcre2/lib/pkgconfig:/usr/local/opt/tidy-html5/lib/pkgconfig PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/local/Homebrew/Library/Homebrew/os/mac/pkgconfig/10.14 SASL_CFLAGS=-I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sasl SASL_LIBS=-lsasl2
make&& make install
网友评论