之前 brew2.0+的时候可以通过扒指定版本的 name.rb 文件,通过 rb 文件安装,升级 brew3.0+后无法使用这种方式了。brew install name@version
也不行。
1
shyling 2021-05-25 15:02:34 +08:00 1
brew install -s ./node.rb
|
2
IgniteWhite 2021-05-25 16:24:32 +08:00 via iPhone
我会自己维护一个 tap,放指定版本的 rb 文件,专门自用,有多台机子也能用,很可靠。
|
3
fffang OP brew 真的很坑。
|
4
xingheng 2021-05-26 08:20:32 +08:00
@IgniteWhite #2 好奇一下你的 tap 是私有的吗? brew 能支持直接走 ssh 协议吗?
|
5
IgniteWhite 2021-05-26 10:28:43 +08:00
@xingheng 我放在 GitHub,公开的,只放了两个 cask: https://github.com/g6ai/homebrew-ale
不清楚 SSH,官方做 tap 的文档建议用 GitHub,因为方便 homebrew 直接用 repo 名字来识别,tap 的时候不用输完整网址。 如果在 GitHub 上做私有 tap,google 了一下看到了一个教程 https://gist.github.com/mlafeldt/8e7d50ee0b1de44e256d |
6
fffang OP |
7
fffang OP @shyling
brew install -s grpc.rb 显示 Cask 'grpc' is unreadable: wrong constant name #<Class:0x00007fb401956070> 然后又去下最新版本了 ``` class Grpc < Formula desc "Next generation open source RPC library and framework" homepage "https://grpc.io/" url "https://github.com/grpc/grpc.git", tag: "v1.32.0", revision: "414bb8322de2411eee1f4e841ff29d887bec7884", shallow: false license "Apache-2.0" revision 1 head "https://github.com/grpc/grpc.git" livecheck do url "https://github.com/grpc/grpc/releases/latest" regex(%r{href=.*?/tag/v?(\d+(?:\.\d+)+)["' >]}i) end bottle do cellar :any rebuild 1 sha256 "0588400a642f91dc3a04a51af045f20f47babc301f87ba8ffa5c7493c2e618a7" => :catalina sha256 "69135cd3114f1ea57d34be778a992c0e56e9d01253d8f48966e6f5cd51ccf6d3" => :mojave sha256 "47ccc49dab77f9844283f1edd05a82a4ae64b8f86fd8943b6580ee9fe4abf915" => :high_sierra end depends_on "autoconf" => :build depends_on "automake" => :build depends_on "cmake" => :build depends_on "libtool" => :build depends_on "abseil" depends_on "c-ares" depends_on "gflags" depends_on "[email protected]" depends_on "protobuf" depends_on "re2" def install mkdir "cmake/build" do args = %w[ ../.. -DBUILD_SHARED_LIBS=ON -DgRPC_BUILD_TESTS=OFF -DgRPC_INSTALL=ON -DgRPC_ABSL_PROVIDER=package -DgRPC_CARES_PROVIDER=package -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_SSL_PROVIDER=package -DgRPC_ZLIB_PROVIDER=package -DgRPC_RE2_PROVIDER=package ] + std_cmake_args system "cmake", *args system "make", "install" args = %w[ ../.. -DCMAKE_EXE_LINKER_FLAGS=-lgflags -DCMAKE_SHARED_LINKER_FLAGS=-lgflags -DBUILD_SHARED_LIBS=ON -DgRPC_BUILD_TESTS=ON -DgRPC_GFLAGS_PROVIDER=package ] + std_cmake_args system "cmake", *args system "make", "grpc_cli" bin.install "grpc_cli" lib.install Dir["libgrpc++_test_config*.dylib"] end end test do (testpath/"test.cpp").write <<~EOS #include <grpc/grpc.h> int main() { grpc_init(); grpc_shutdown(); return GRPC_STATUS_OK; } EOS system ENV.cc, "test.cpp", "-I#{include}", "-L#{lib}", "-lgrpc", "-o", "test" system "./test" end end ``` |