Merge pull request #207012 from Homebrew/bump-tailwindcss-4.0.5
[Homebrew/homebrew-core.git] / Formula / t / traildb.rb
blobd2f2786a316edb2a80a87a6ddcfc0e385d811243
1 class Traildb < Formula
2   desc "Blazingly-fast database for log-structured data"
3   homepage "https://traildb.io/"
4   url "https://github.com/traildb/traildb/archive/refs/tags/0.6.tar.gz"
5   sha256 "f73515fe56c547f861296cf8eecc98b8e8bf00d175ad9fb7f4b981ad7cf8b67c"
6   license "MIT"
8   livecheck do
9     url :stable
10     regex(/^v?(\d+(?:\.\d+)+)$/i)
11   end
13   bottle do
14     rebuild 1
15     sha256 arm64_sequoia:  "6855e108a52b0df9a4f13492f09ccf0d8ae7efcb2b25441f88a9d1e214137c4c"
16     sha256 arm64_sonoma:   "54903d470c8c610d59b4122f43e3c0292781c8949d5ba8e141f59362e1beb16e"
17     sha256 arm64_ventura:  "fc31267f2145da6af9f4cf19609bebd1e4e5f7e468549bb2adbdfd40bd3b50ad"
18     sha256 arm64_monterey: "f34fd4ae7821c7f82a44e374e4c07603a63ec224c5ddb441c38e0defcaaeb4a7"
19     sha256 arm64_big_sur:  "1889bda4c138dbcf3d7a7229a47705631f2c5880f20a23e3612685c8a1ad7208"
20     sha256 sonoma:         "b3d15cca75203e35bc56037c0ec9e1139c54ab909c81ec36a02d7b7ed9daa117"
21     sha256 ventura:        "0534a5fd56705faf95c68bd3a4e0ab4b401baaef55d4e8fc37f88126643e5f16"
22     sha256 monterey:       "f973d38d9cfe84c422bf98fc4c91265b2d3865efde148fe9b32a2a3af75d44e9"
23     sha256 big_sur:        "c86da6038d5ffb50fac4db5af5e0e4cb91c93814fcd712fc4e2697747db2a0a8"
24     sha256 x86_64_linux:   "eacba47e211b4e29a1a44507087e2fc1cb501f00c853ee406a0c954c8ba4c47e"
25   end
27   depends_on "pkgconf" => :build
28   depends_on "judy"
29   depends_on "libarchive"
31   uses_from_macos "python" => :build
33   # Update waf script for Python 3
34   # Use resource instead of patch since applying corrupts waf
35   resource "waf" do
36     on_macos do
37       url "https://raw.githubusercontent.com/traildb/traildb/053ed8e5d0301c792f3ee703cd9936c49ecf41a1/waf"
38       sha256 "2e0cf83a63843da127610420cef1d3126f1187d8e572b6b3a28052fc2250d4bf"
39     end
40     on_linux do
41       # Update `waf` further for Python 3.12+ support. We don't use this on macOS as newer versions
42       # fail to find `libarchive` on non-/usr/local prefix due to wscript PKG_CONFIG_PATH override
43       url "https://waf.io/waf-2.1.4"
44       sha256 "7803d63e698ada49a74ab6979a0fd708a5f9a3456206cba3a3e07387fdcf946d"
45     end
46   end
48   def install
49     ENV["PREFIX"] = prefix
50     resource("waf").stage { buildpath.install Dir["*"].first => "waf" }
51     system "python3", "./waf", "configure", "install"
52   end
54   test do
55     # Check that the library has been installed correctly
56     (testpath/"test.c").write <<~C
57       #include <traildb.h>
58       #include <assert.h>
59       int main() {
60         const char *path = "test.tdb";
61         const char *fields[] = {};
62         tdb_cons* c1 = tdb_cons_init();
63         assert(tdb_cons_open(c1, path, fields, 0) == 0);
64         assert(tdb_cons_finalize(c1) == 0);
65         tdb* t1 = tdb_init();
66         assert(tdb_open(t1, path) == 0);
67       }
68     C
69     system ENV.cc, "test.c", "-L#{lib}", "-ltraildb", "-o", "test"
70     system "./test"
72     # Check that the provided tdb binary works correctly
73     (testpath/"in.csv").write("1234 1234\n")
74     system bin/"tdb", "make", "-c", "-i", "in.csv", "--tdb-format", "pkg"
75   end
76 end