Skip to content

Commit 394a704

Browse files
abelchadaeho-ro
authored andcommitted
ada-url: add adaparse
1 parent d707cdd commit 394a704

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

Formula/a/ada-url.rb

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class AdaUrl < Formula
1515
end
1616

1717
depends_on "cmake" => :build
18+
depends_on "cxxopts" => :build
19+
depends_on "fmt"
1820

1921
uses_from_macos "python" => :build
2022

@@ -33,9 +35,24 @@ class AdaUrl < Formula
3335
end
3436

3537
def install
36-
ENV.llvm_clang if OS.mac? && DevelopmentTools.clang_build_version <= 1500
38+
if OS.mac? && DevelopmentTools.clang_build_version <= 1500
39+
ENV.llvm_clang
3740

38-
system "cmake", "-S", ".", "-B", "build", "-DBUILD_SHARED_LIBS=ON", *std_cmake_args
41+
# ld: unknown options: --gc-sections
42+
inreplace "tools/cli/CMakeLists.txt",
43+
"target_link_options(adaparse PRIVATE \"-Wl,--gc-sections\")",
44+
""
45+
end
46+
47+
args = %W[
48+
-DCMAKE_INSTALL_RPATH=#{rpath}
49+
-DBUILD_SHARED_LIBS=ON
50+
-DADA_TOOLS=ON
51+
-DCPM_USE_LOCAL_PACKAGES=ON
52+
-DFETCHCONTENT_FULLY_DISCONNECTED=ON
53+
]
54+
55+
system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
3956
system "cmake", "--build", "build"
4057
system "cmake", "--install", "build"
4158
end
@@ -61,5 +78,7 @@ def install
6178
system ENV.cxx, "test.cpp", "-std=c++20",
6279
"-I#{include}", "-L#{lib}", "-lada", "-o", "test"
6380
assert_equal "http:", shell_output("./test").chomp
81+
82+
assert_match "search_start 25", shell_output("#{bin}/adaparse -d http://www.google.com/bal?a==11#fddfds")
6483
end
6584
end

0 commit comments

Comments
 (0)