Skip to content

Commit

Permalink
arangodb: fix MacOS references.
Browse files Browse the repository at this point in the history
Needed after Homebrew/brew#16306.
  • Loading branch information
MikeMcQuaid committed Dec 13, 2023
1 parent 80d4c15 commit ad9eeb5
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions Formula/a/arangodb.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,6 @@ class Arangodb < Formula
end

def install
if OS.mac?
ENV.llvm_clang
ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version
# Fix building bundled boost with newer LLVM by avoiding removed `std::unary_function`.
# .../boost/1.78.0/boost/container_hash/hash.hpp:132:33: error: no template named
# 'unary_function' in namespace 'std'; did you mean '__unary_function'?
ENV.append "CXXFLAGS", "-DBOOST_NO_CXX98_FUNCTION_BASE=1"
end

resource("starter").stage do
ldflags = %W[
-s -w
-X main.projectVersion=#{resource("starter").version}
-X main.projectBuild=#{Utils.git_head}
]
system "go", "build", *std_go_args(ldflags: ldflags)
end

arch = if Hardware::CPU.arm?
"neon"
elsif !build.bottle?
Expand All @@ -96,20 +78,40 @@ def install
Hardware.oldest_cpu
end

args = std_cmake_args + %W[
cmake_args = std_cmake_args + %W[
-DHOMEBREW=ON
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_INSTALL_LOCALSTATEDIR=#{var}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DCMAKE_OSX_DEPLOYMENT_TARGET=#{MacOS.version}
-DOPENSSL_ROOT_DIR=#{Formula["[email protected]"].opt_prefix}
-DTARGET_ARCHITECTURE=#{arch}
-DUSE_GOOGLE_TESTS=OFF
-DUSE_JEMALLOC=OFF
-DUSE_MAINTAINER_MODE=OFF
]

system "cmake", "-S", ".", "-B", "build", *args
if OS.mac?
ENV.llvm_clang

ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version
cmake_args << "-DCMAKE_OSX_DEPLOYMENT_TARGET=#{MacOS.version}"

# Fix building bundled boost with newer LLVM by avoiding removed `std::unary_function`.
# .../boost/1.78.0/boost/container_hash/hash.hpp:132:33: error: no template named
# 'unary_function' in namespace 'std'; did you mean '__unary_function'?
ENV.append "CXXFLAGS", "-DBOOST_NO_CXX98_FUNCTION_BASE=1"
end

resource("starter").stage do
ldflags = %W[
-s -w
-X main.projectVersion=#{resource("starter").version}
-X main.projectBuild=#{Utils.git_head}
]
system "go", "build", *std_go_args(ldflags: ldflags)
end

system "cmake", "-S", ".", "-B", "build", *cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end
Expand Down

0 comments on commit ad9eeb5

Please sign in to comment.