131 lines
3.7 KiB
Ruby
131 lines
3.7 KiB
Ruby
class Gwyddion < Formula
|
|
desc "Scanning Probe Microscopy visualization and analysis tool"
|
|
homepage "http://gwyddion.net/"
|
|
url "http://gwyddion.net/download/2.59/gwyddion-2.59.tar.gz"
|
|
sha256 "b777eaa9a53a971c55a5ae2f7cd6695d1dbde78ffb84b9cf8885361400f051c7"
|
|
license "GPL-2.0-or-later"
|
|
|
|
livecheck do
|
|
url "http://gwyddion.net/download.php"
|
|
regex(/stable version Gwyddion v?(\d+(?:\.\d+)+):/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 arm64_big_sur: "84daa1965a976e10f7fc3c86181060ab41de374e60e40f4c583d1708c62f4e2d"
|
|
sha256 big_sur: "0843f910f945f7ccfa32b172e499733f03f5bd1ffb5651cd09dd9e4908bfa098"
|
|
sha256 catalina: "ff6670705c707245cc11ae74a4b7c3ae973e6a5fdda03a4edf2cd1a114da0c13"
|
|
sha256 mojave: "78eb5e116ce465537772408846a45680195b1184f616fc3663fe60fa3db6a02b"
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "fftw"
|
|
depends_on "gtk+"
|
|
depends_on "gtkglext"
|
|
depends_on "gtksourceview"
|
|
depends_on "libxml2"
|
|
depends_on "minizip"
|
|
|
|
on_macos do
|
|
depends_on "gtk-mac-integration"
|
|
end
|
|
|
|
def install
|
|
system "./configure", "--disable-dependency-tracking",
|
|
"--disable-desktop-file-update",
|
|
"--prefix=#{prefix}",
|
|
"--with-html-dir=#{doc}",
|
|
"--disable-pygwy"
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/gwyddion", "--version"
|
|
(testpath/"test.c").write <<~EOS
|
|
#include <libgwyddion/gwyddion.h>
|
|
|
|
int main(int argc, char *argv[]) {
|
|
const gchar *string = gwy_version_string();
|
|
return 0;
|
|
}
|
|
EOS
|
|
atk = Formula["atk"]
|
|
cairo = Formula["cairo"]
|
|
fftw = Formula["fftw"]
|
|
fontconfig = Formula["fontconfig"]
|
|
freetype = Formula["freetype"]
|
|
gdk_pixbuf = Formula["gdk-pixbuf"]
|
|
gettext = Formula["gettext"]
|
|
glib = Formula["glib"]
|
|
gtkx = Formula["gtk+"]
|
|
gtkglext = Formula["gtkglext"]
|
|
harfbuzz = Formula["harfbuzz"]
|
|
libpng = Formula["libpng"]
|
|
pango = Formula["pango"]
|
|
pixman = Formula["pixman"]
|
|
flags = %W[
|
|
-I#{atk.opt_include}/atk-1.0
|
|
-I#{cairo.opt_include}/cairo
|
|
-I#{fftw.opt_include}
|
|
-I#{fontconfig.opt_include}
|
|
-I#{freetype.opt_include}/freetype2
|
|
-I#{gdk_pixbuf.opt_include}/gdk-pixbuf-2.0
|
|
-I#{gettext.opt_include}
|
|
-I#{glib.opt_include}/glib-2.0
|
|
-I#{glib.opt_lib}/glib-2.0/include
|
|
-I#{gtkglext.opt_include}/gtkglext-1.0
|
|
-I#{gtkglext.opt_lib}/gtkglext-1.0/include
|
|
-I#{gtkx.opt_include}/gtk-2.0
|
|
-I#{gtkx.opt_lib}/gtk-2.0/include
|
|
-I#{harfbuzz.opt_include}/harfbuzz
|
|
-I#{include}/gwyddion
|
|
-I#{libpng.opt_include}/libpng16
|
|
-I#{lib}/gwyddion/include
|
|
-I#{pango.opt_include}/pango-1.0
|
|
-I#{pixman.opt_include}/pixman-1
|
|
-D_REENTRANT
|
|
-L#{atk.opt_lib}
|
|
-L#{cairo.opt_lib}
|
|
-L#{fftw.opt_lib}
|
|
-L#{fontconfig.opt_lib}
|
|
-L#{freetype.opt_lib}
|
|
-L#{gdk_pixbuf.opt_lib}
|
|
-L#{gettext.opt_lib}
|
|
-L#{glib.opt_lib}
|
|
-L#{gtkglext.opt_lib}
|
|
-L#{gtkx.opt_lib}
|
|
-L#{lib}
|
|
-L#{pango.opt_lib}
|
|
-latk-1.0
|
|
-lcairo
|
|
-lfftw3
|
|
-lfontconfig
|
|
-lfreetype
|
|
-lgdk-quartz-2.0
|
|
-lgdk_pixbuf-2.0
|
|
-lgdkglext-quartz-1.0
|
|
-lgio-2.0
|
|
-lglib-2.0
|
|
-lgmodule-2.0
|
|
-lgobject-2.0
|
|
-lgtk-quartz-2.0
|
|
-lgtkglext-quartz-1.0
|
|
-lgwyapp2
|
|
-lgwyddion2
|
|
-lgwydgets2
|
|
-lgwydraw2
|
|
-lgwymodule2
|
|
-lgwyprocess2
|
|
-lpango-1.0
|
|
-lpangocairo-1.0
|
|
-lpangoft2-1.0
|
|
-framework AppKit
|
|
-framework OpenGL
|
|
]
|
|
on_macos do
|
|
flags << "-lintl"
|
|
end
|
|
system ENV.cc, "test.c", "-o", "test", *flags
|
|
system "./test"
|
|
end
|
|
end
|