Merge pull request #206954 from Homebrew/bump-gollama-1.28.13
[homebrew-core.git] / Formula / d / dillo.rb
blob288d8373bbd7e33635973af56dae69361f939433
1 class Dillo < Formula
2   desc "Fast and small graphical web browser"
3   homepage "https://dillo-browser.github.io/"
4   url "https://github.com/dillo-browser/dillo/releases/download/v3.2.0/dillo-3.2.0.tar.bz2"
5   sha256 "1066ed42ea7fe0ce19e79becd029c651c15689922de8408e13e70bb5701931bf"
6   license "GPL-3.0-or-later"
8   bottle do
9     sha256 arm64_sequoia: "0207d59785da8978150221c348a04269db1e6af49b16cea243aeaeb2d874592d"
10     sha256 arm64_sonoma:  "28b93f6b93b643299e98f8f9b543b55784ce83e16e624d460453b2741b4faa61"
11     sha256 arm64_ventura: "91e47bdc6957706b451ad79446f0807b46f7ad3bd52ed9e4b3e7fbf7f68e7656"
12     sha256 sonoma:        "eb64b7f51d5fd459bf3dc5ceffebc8f44a8cccf2e5288fd8bd2bc00e076c7d7a"
13     sha256 ventura:       "d67a1834f6bdb695b18602e11411bf5e6e723df7a2fe4cb513c392da4ec52561"
14     sha256 x86_64_linux:  "b38cf02dc15d8362d04a62438d62eb0f6b7be342d83fd349f414b0c24f5f4989"
15   end
17   head do
18     url "https://github.com/dillo-browser/dillo.git", branch: "master"
20     depends_on "autoconf" => :build
21     depends_on "automake" => :build
22   end
24   # TODO: Switch to unversioned `fltk` when possible.
25   # https://github.com/dillo-browser/dillo/issues/246
26   depends_on "fltk@1.3"
27   depends_on "jpeg-turbo"
28   depends_on "libpng"
29   depends_on "openssl@3"
31   uses_from_macos "zlib"
33   on_linux do
34     depends_on "libx11"
35   end
37   def install
38     if build.head?
39       ENV["NOCONFIGURE"] = "1"
40       system "./autogen.sh"
41     end
43     system "./configure", "--disable-silent-rules", *std_configure_args
44     system "make", "install"
45   end
47   test do
48     test_file = testpath/"test.html"
49     (testpath/"test.html").write <<~HTML
50       <!DOCTYPE html>
51       <html>
52         <head>
53             <title>BrewTest</title>
54         </head>
55         <body>
56             <h1>test</h1>
57         </body>
58       </html>
59     HTML
61     # create bunch of dillo resource files
62     (testpath/".dillo").mkpath
63     (testpath/".dillo/dillorc").write ""
64     (testpath/".dillo/keysrc").write ""
65     (testpath/".dillo/domainrc").write ""
66     (testpath/".dillo/hsts_preload").write ""
68     begin
69       PTY.spawn(bin/"dillo", test_file) do |_r, _w, pid|
70         sleep 15
71         Process.kill("TERM", pid)
72       end
73     rescue Errno::EIO
74       # GNU/Linux raises EIO when read is done on closed pty
75     end
77     assert_match "DEFAULT DENY", (testpath/".dillo/cookiesrc").read
79     assert_match version.to_s, shell_output("#{bin}/dillo --version")
80   end
81 end