Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 25 additions & 21 deletions Formula/asio@1.10.8.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,44 @@
depends_on "boost@1.85"

def install
# Ensure C++11 compatibility
ENV.cxx11

# Regenerate the configure script
system "autoconf"

# Configure with Boost support
boost = Formula["boost@1.85"]

args = %W[
--disable-dependency-tracking
--disable-silent-rules
--prefix=#{prefix}
--with-boost=#{Formula["boost"].opt_include}
--with-boost=#{boost.opt_prefix}
]
system "./configure", *args

# Build and install
system "make", "install"
if OS.mac?
sdk = Utils.popen_read("xcrun --sdk macosx --show-sdk-path").chomp

Check failure on line 30 in Formula/asio@1.10.8.rb

View workflow job for this annotation

GitHub Actions / Check Style, and Audit Formula

Homebrew/ShellCommands: Separate `Utils.popen_read` commands into `"xcrun", "--sdk", "macosx", "--show-sdk-path"`

Check failure on line 30 in Formula/asio@1.10.8.rb

View workflow job for this annotation

GitHub Actions / Check Style, and Audit Formula

FormulaAudit/SafePopenCommands: Use `Utils.safe_popen_read` instead of `Utils.popen_read`
libcxx = "#{sdk}/usr/include/c++/v1"

# Install example programs
# Old configure checks: make headers/libs & SDK unmissable
cppflags = "-I#{boost.opt_include} -I#{libcxx} -isysroot #{sdk}"
cxxflags = "-std=c++11 -I#{boost.opt_include} -I#{libcxx} -isysroot #{sdk}"
ldflags = "-L#{boost.opt_lib} -isysroot #{sdk} -stdlib=libc++"

system "./configure",
*args,
"CPPFLAGS=#{cppflags}",
"CXXFLAGS=#{cxxflags}",
"LDFLAGS=#{ldflags}",
# Preseed brittle header probe (safe on macOS; a no-op elsewhere)
"ac_cv_header_boost_noncopyable_hpp=yes"
else
system "./configure", *args
end

system "make", "install"
pkgshare.install "src/examples"
end

test do
# Use the HTTP server example to verify functionality
httpserver = pkgshare/"examples/cpp03/http/server/http_server"
pid = fork do
exec httpserver, "127.0.0.1", "8080", "."
end
sleep 1
begin
assert_match "404 Not Found", shell_output("curl -s http://127.0.0.1:8080")
ensure
Process.kill "TERM", pid
Process.wait pid
end
# Smoke test: header presence
assert_path_exist include/"asio.hpp"
end
end
36 changes: 32 additions & 4 deletions Formula/fastcdr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,46 @@
homepage "http://www.eprosima.com/index.php/products-all/eprosima-fast-rtps"
url "https://github.com/eProsima/Fast-CDR/archive/refs/tags/v1.0.22.tar.gz"
sha256 "7ca7f09c633963622431bdb216eeb4145e378f81a2ce5113e341b9eee55e4f44"
license "Apache-2.0"

depends_on "cmake" => :build

def install
ENV.cxx11

build_dir = buildpath/"build"
build_dir.mkpath

# Configure with updated minimum CMake policy to avoid compatibility errors
system "cmake", "-S", ".", "-B", build_dir,
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
*std_cmake_args
args = std_cmake_args + %W[

Check failure on line 16 in Formula/fastcdr.rb

View workflow job for this annotation

GitHub Actions / Check Style, and Audit Formula

Style/RedundantCapitalW: Do not use `%W` unless interpolation is needed. If not, use `%w`.
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_CXX_STANDARD=14
-DCMAKE_CXX_STANDARD_REQUIRED=ON
-DCMAKE_CXX_EXTENSIONS=OFF
]

if OS.mac?
sdk = Utils.popen_read("xcrun --sdk macosx --show-sdk-path").chomp

Check failure on line 24 in Formula/fastcdr.rb

View workflow job for this annotation

GitHub Actions / Check Style, and Audit Formula

Homebrew/ShellCommands: Separate `Utils.popen_read` commands into `"xcrun", "--sdk", "macosx", "--show-sdk-path"`

Check failure on line 24 in Formula/fastcdr.rb

View workflow job for this annotation

GitHub Actions / Check Style, and Audit Formula

FormulaAudit/SafePopenCommands: Use `Utils.safe_popen_read` instead of `Utils.popen_read`
libcxx = "#{sdk}/usr/include/c++/v1"

args += %W[
-DCMAKE_OSX_ARCHITECTURES=x86_64
-DCMAKE_OSX_SYSROOT=#{sdk}
-DCMAKE_CXX_FLAGS=-stdlib=libc++\ -isysroot\ #{sdk}\ -I#{libcxx}
-DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++\ -isysroot\ #{sdk}
-DCMAKE_SHARED_LINKER_FLAGS=-stdlib=libc++\ -isysroot\ #{sdk}
]
end

system "cmake", "-S", ".", "-B", build_dir, *args
system "cmake", "--build", build_dir
system "cmake", "--install", build_dir
end

test do
(testpath/"t.cpp").write <<~CPP
#include <fastcdr/FastCdr.h>
int main() { return 0; }
CPP
system ENV.cxx, "t.cpp", "-std=c++14", "-L#{lib}", "-lfastcdr", "-I#{include}"
end
end
36 changes: 31 additions & 5 deletions Formula/fastdds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,41 @@
depends_on "tinyxml2"

def install
# Out-of-tree build to avoid nested chdir conflicts
ENV.cxx11

build_dir = buildpath/"build"
build_dir.mkpath

# Configure, build, and install with updated CMake policy
system "cmake", "-S", ".", "-B", build_dir,
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
*std_cmake_args
args = std_cmake_args + %W[

Check failure on line 20 in Formula/fastdds.rb

View workflow job for this annotation

GitHub Actions / Check Style, and Audit Formula

Style/RedundantCapitalW: Do not use `%W` unless interpolation is needed. If not, use `%w`.
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_CXX_STANDARD=14
-DCMAKE_CXX_STANDARD_REQUIRED=ON
-DCMAKE_CXX_EXTENSIONS=OFF
-DFASTDDS_BUILD_TESTS=OFF
-DFASTDDS_EXAMPLES=OFF
-DFASTDDS_TOOLS=OFF
]

if OS.mac?
sdk = Utils.popen_read("xcrun --sdk macosx --show-sdk-path").chomp

Check failure on line 31 in Formula/fastdds.rb

View workflow job for this annotation

GitHub Actions / Check Style, and Audit Formula

Homebrew/ShellCommands: Separate `Utils.popen_read` commands into `"xcrun", "--sdk", "macosx", "--show-sdk-path"`

Check failure on line 31 in Formula/fastdds.rb

View workflow job for this annotation

GitHub Actions / Check Style, and Audit Formula

FormulaAudit/SafePopenCommands: Use `Utils.safe_popen_read` instead of `Utils.popen_read`
libcxx = "#{sdk}/usr/include/c++/v1"

args += %W[
-DCMAKE_OSX_ARCHITECTURES=x86_64
-DCMAKE_OSX_SYSROOT=#{sdk}
-DCMAKE_CXX_FLAGS=-stdlib=libc++\ -isysroot\ #{sdk}\ -I#{libcxx}
-DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++\ -isysroot\ #{sdk}
-DCMAKE_SHARED_LINKER_FLAGS=-stdlib=libc++\ -isysroot\ #{sdk}
]
end

system "cmake", "-S", ".", "-B", build_dir, *args
system "cmake", "--build", build_dir
system "cmake", "--install", build_dir
end

test do
# Header presence test
assert_path_exist include/"fastrtps/fastrtps_fwd.h"
end
end
38 changes: 31 additions & 7 deletions Formula/foonathan-memory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,42 @@
depends_on "cmake" => :build

def install
# Use out-of-tree build directory to avoid nested chdir conflicts
ENV.cxx11

build_dir = buildpath/"build"
build_dir.mkpath

# Configure with tests disabled and CMake compatibility policy
system "cmake", "-S", ".", "-B", build_dir,
"-DFOONATHAN_MEMORY_BUILD_TESTS=OFF",
"-DCMAKE_POLICY_VERSION_MINIMUM=3.5",
*std_cmake_args
args = std_cmake_args + %W[

Check failure on line 16 in Formula/foonathan-memory.rb

View workflow job for this annotation

GitHub Actions / Check Style, and Audit Formula

Style/RedundantCapitalW: Do not use `%W` unless interpolation is needed. If not, use `%w`.
-DFOONATHAN_MEMORY_BUILD_TESTS=OFF
-DCMAKE_POLICY_VERSION_MINIMUM=3.5
-DCMAKE_CXX_STANDARD=14
-DCMAKE_CXX_STANDARD_REQUIRED=ON
-DCMAKE_CXX_EXTENSIONS=OFF
]

if OS.mac?
sdk = Utils.popen_read("xcrun --sdk macosx --show-sdk-path").chomp

Check failure on line 25 in Formula/foonathan-memory.rb

View workflow job for this annotation

GitHub Actions / Check Style, and Audit Formula

FormulaAudit/SafePopenCommands: Use `Utils.safe_popen_read` instead of `Utils.popen_read`
libcxx = "#{sdk}/usr/include/c++/v1"

args += %W[
-DCMAKE_OSX_ARCHITECTURES=x86_64
-DCMAKE_OSX_SYSROOT=#{sdk}
-DCMAKE_CXX_FLAGS=-stdlib=libc++\ -isysroot\ #{sdk}\ -I#{libcxx}
-DCMAKE_EXE_LINKER_FLAGS=-stdlib=libc++\ -isysroot\ #{sdk}
-DCMAKE_SHARED_LINKER_FLAGS=-stdlib=libc++\ -isysroot\ #{sdk}
]
end

# Build and install
system "cmake", "-S", ".", "-B", build_dir, *args
system "cmake", "--build", build_dir
system "cmake", "--install", build_dir
end

test do
(testpath/"t.cpp").write <<~CPP
#include <memory>
int main() { auto p = std::make_unique<int>(42); return *p == 42 ? 0 : 1; }
CPP
system ENV.cxx, "t.cpp", "-std=c++14"
end
end
Loading