diff --git a/Formula/glib.rb b/Formula/glib.rb index 9d8adec007..ade76d0667 100644 --- a/Formula/glib.rb +++ b/Formula/glib.rb @@ -65,6 +65,16 @@ class Glib < Formula system "ulimit -n 1024; make check" if build.include? 'test' system "make install" + # `pkg-config --libs glib-2.0` includes -lintl, and gettext itself does not + # have a pkgconfig file, so we add gettext lib and include paths here. + gettext = Formula.factory('gettext').opt_prefix + inreplace lib+'pkgconfig/glib-2.0.pc' do |s| + s.gsub! 'Libs: -L${libdir} -lglib-2.0 -lintl', + "Libs: -L${libdir} -lglib-2.0 -L#{gettext}/lib -lintl" + s.gsub! 'Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include', + "Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include -I#{gettext}/include" + end + (share+'gtk-doc').rmtree end