Merge pull request #207020 from Homebrew/bump-qpdf-11.10.0
[Homebrew/homebrew-core.git] / Formula / g / gwyddion.rb
blob32389e04c54acc7a081ddf04cb845faacf5bdb4d
1 class Gwyddion < Formula
2   desc "Scanning Probe Microscopy visualization and analysis tool"
3   homepage "http://gwyddion.net/"
4   url "https://downloads.sourceforge.net/project/gwyddion/gwyddion/2.67/gwyddion-2.67.tar.xz"
5   sha256 "90aeaf4de00373696b0bef4a82ac45b6287ad9c7b7aca6249068d4d2a4fc8d61"
6   license "GPL-2.0-or-later"
8   livecheck do
9     url "http://gwyddion.net/download.php"
10     regex(/stable version Gwyddion v?(\d+(?:\.\d+)+):/i)
11   end
13   bottle do
14     sha256 arm64_sonoma:  "f3a7df065714d9c58d08ce3d3527fe746c16372ce5f0e040098743a9f45969f1"
15     sha256 arm64_ventura: "dd772a7ad26e9f44004dda1f022ee8ec726811405b9b2d88236271aaaae083d6"
16     sha256 sonoma:        "19960f4fc6681f9fee0fdd3b97ea90c90d764002d2dd8827923e99529e7f2dc4"
17     sha256 ventura:       "644304817377de3c31996e105a4281bddb17da1ec24e1752649772eed70e2265"
18     sha256 x86_64_linux:  "763473cb225de5e11dd37aa9af6669daab6deafb30c4cafdc6d27e8fa0a18f0c"
19   end
21   depends_on "pkgconf" => [:build, :test]
22   depends_on "cairo"
23   depends_on "fftw"
24   depends_on "gdk-pixbuf"
25   depends_on "glib"
26   depends_on "gtk+"
27   depends_on "gtkglext"
28   depends_on "libpng"
29   depends_on "libxml2"
30   depends_on "minizip"
31   depends_on "pango"
33   uses_from_macos "bzip2"
34   uses_from_macos "zlib"
36   on_macos do
37     # Regenerate autoconf files to avoid flat namespace in library
38     # (autoreconf runs gtkdocize, provided by gtk-doc)
39     depends_on "autoconf" => :build
40     depends_on "automake" => :build
41     depends_on "gtk-doc" => :build
42     depends_on "libtool" => :build
43     # TODO: depends_on "gtk-mac-integration"
44     depends_on "at-spi2-core"
45     depends_on "gettext"
46     depends_on "harfbuzz"
47   end
49   def install
50     system "autoreconf", "--force", "--install", "--verbose" if OS.mac?
51     system "./configure", "--disable-desktop-file-update",
52                           "--disable-pygwy",
53                           "--disable-silent-rules",
54                           "--with-html-dir=#{doc}",
55                           "--without-gtksourceview",
56                           *std_configure_args
57     system "make", "install"
58   end
60   test do
61     system bin/"gwyddion", "--version"
62     (testpath/"test.c").write <<~C
63       #include <libgwyddion/gwyddion.h>
65       int main(int argc, char *argv[]) {
66         const gchar *string = gwy_version_string();
67         return 0;
68       }
69     C
71     flags = shell_output("pkgconf --cflags --libs gwyddion").chomp.split
72     system ENV.cc, "test.c", "-o", "test", *flags
73     system "./test"
74   end
75 end