Merge pull request #207012 from Homebrew/bump-tailwindcss-4.0.5
[Homebrew/homebrew-core.git] / Formula / e / exempi.rb
blob7dcdd5f9fbd546df2230f4366e7dda43e00de535
1 class Exempi < Formula
2   desc "Library to parse XMP metadata"
3   homepage "https://wiki.freedesktop.org/libopenraw/Exempi/"
4   url "https://libopenraw.freedesktop.org/download/exempi-2.6.5.tar.bz2"
5   sha256 "e9f9a3d42bff73b5eb0f77ec22cd0163c3e21949cc414ad1f19a0465dde41ffe"
6   license "BSD-3-Clause"
8   livecheck do
9     url "https://libopenraw.freedesktop.org/exempi/"
10     regex(/href=.*?exempi[._-]v?(\d+(?:\.\d+)+)\.t/i)
11   end
13   bottle do
14     sha256 cellar: :any,                 arm64_sequoia:  "e4a036c99bc1e87333deaecbd4d7fbaf08558b462acca4b295ed922505f31367"
15     sha256 cellar: :any,                 arm64_sonoma:   "fffe2e2da9ff2117ed01b3055811aa6b3c0348f33ca7da88bed84bbab3345767"
16     sha256 cellar: :any,                 arm64_ventura:  "f97b4edaedaf3346999176b2f790bee721e9684c4faba1fd6d8b4f95df5a512d"
17     sha256 cellar: :any,                 arm64_monterey: "3ea8dc1aaca7c2c12bd2673bdcb73dcb4c6f8fb6a928c9369e4cfcad5841e302"
18     sha256 cellar: :any,                 sonoma:         "d4a92c827d8e702c9de91c44749c4448b611fea06b2a0cb444b505366e80f3f7"
19     sha256 cellar: :any,                 ventura:        "ca6ef07fd6862b9148a8cabe608c0937f9da287638eec78d7402b29ba76c7fe2"
20     sha256 cellar: :any,                 monterey:       "9595f29483fb85b894f482fd86221d791a02878bf5395638b63d90313abbf890"
21     sha256 cellar: :any_skip_relocation, x86_64_linux:   "30ae54f527539c8f605086923bb33cb44560cb84bca42c06ec052d74a894f14c"
22   end
24   uses_from_macos "expat"
25   uses_from_macos "zlib"
27   def install
28     system "./configure", "--disable-silent-rules",
29                           "--disable-unittest",
30                           *std_configure_args
31     system "make", "install"
32   end
34   test do
35     cp test_fixtures("test.jpg"), testpath
37     (testpath/"test.cpp").write <<~CPP
38       #include <cassert>
39       #include <exempi/xmp.h>
40       #include <exempi/xmpconsts.h>
42       int main() {
43         const char *filename = "test.jpg";
44         assert(xmp_init());
45         assert(xmp_files_check_file_format(filename) == XMP_FT_JPEG);
47         XmpFilePtr f = xmp_files_open_new(filename, XMP_OPEN_FORUPDATE);
48         assert(f != NULL);
49         XmpPtr xmp = xmp_files_get_new_xmp(f);
50         assert(xmp != NULL);
51         assert(xmp_files_can_put_xmp(f, xmp));
53         assert(xmp_register_namespace(NS_CC, "cc", NULL));
54         assert(xmp_set_property(xmp, NS_CC, "license", "Foo", 0));
55         assert(xmp_files_put_xmp(f, xmp));
57         assert(xmp_free(xmp));
58         assert(xmp_files_close(f, XMP_CLOSE_SAFEUPDATE));
59         xmp_terminate();
60         return 0;
61       }
62     CPP
64     system ENV.cxx, "test.cpp", "-o", "test", "-I#{include}/exempi-2.0", "-L#{lib}", "-lexempi"
65     system "./test"
66   end
67 end