homebrew-core/Formula/gdk-pixbuf.rb

61 lines
2.1 KiB
Ruby

require 'formula'
class GdkPixbuf < Formula
homepage 'http://gtk.org'
url 'http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.30/gdk-pixbuf-2.30.8.tar.xz'
sha256 '4853830616113db4435837992c0aebd94cbb993c44dc55063cee7f72a7bef8be'
bottle do
sha1 "c8a9dee31d549da7b398622076b5facea56f8e20" => :mavericks
sha1 "0e4a38ab5a7641cd7ba9c203838712e3366f4cab" => :mountain_lion
sha1 "c0404c515e96feecde1fa3a9c20a44035d315813" => :lion
end
option :universal
depends_on "pkg-config" => :build
depends_on "glib"
depends_on "jpeg"
depends_on "libtiff"
depends_on "libpng"
depends_on "gobject-introspection"
# 'loaders.cache' must be writable by other packages
skip_clean 'lib/gdk-pixbuf-2.0'
def install
ENV.universal_binary if build.universal?
system "./configure", "--disable-dependency-tracking",
"--disable-maintainer-mode",
"--enable-debug=no",
"--prefix=#{prefix}",
"--enable-introspection=yes",
"--disable-Bsymbolic",
"--without-gdiplus"
system "make"
system "make", "install"
# Other packages should use the top-level modules directory
# rather than dumping their files into the gdk-pixbuf keg.
inreplace lib/'pkgconfig/gdk-pixbuf-2.0.pc' do |s|
libv = s.get_make_var 'gdk_pixbuf_binary_version'
s.change_make_var! 'gdk_pixbuf_binarydir',
HOMEBREW_PREFIX/'lib/gdk-pixbuf-2.0'/libv
end
end
def post_install
# Change the version directory below with any future update
ENV["GDK_PIXBUF_MODULEDIR"]="#{HOMEBREW_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders"
system "#{bin}/gdk-pixbuf-query-loaders", "--update-cache"
end
def caveats; <<-EOS.undent
Programs that require this module need to set the environment variable
export GDK_PIXBUF_MODULEDIR="#{HOMEBREW_PREFIX}/lib/gdk-pixbuf-2.0/2.10.0/loaders"
If you need to manually update the query loader cache
#{bin}/gdk-pixbuf-query-loaders --update-cache
EOS
end
end