Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
glib 2.36.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jacknagel committed Mar 29, 2013
1 parent 6bd35a5 commit aecbf5c
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions Library/Formula/glib.rb
Expand Up @@ -2,8 +2,8 @@

class Glib < Formula
homepage 'http://developer.gnome.org/glib/'
url 'http://ftp.gnome.org/pub/gnome/sources/glib/2.34/glib-2.34.3.tar.xz'
sha256 '855fcbf87cb93065b488358e351774d8a39177281023bae58c286f41612658a7'
url 'http://ftp.gnome.org/pub/gnome/sources/glib/2.36/glib-2.36.0.tar.xz'
sha256 '455a8abe8692c5174bcc7ffa15b96a7521a2f2f9fb47594405927c35cb9bb227'

option :universal
option 'test', 'Build a debug build and run tests. NOTE: Not all tests succeed yet'
Expand All @@ -19,13 +19,10 @@ class Glib < Formula
end

def patches
p = {}
# https://bugzilla.gnome.org/show_bug.cgi?id=673135 Resolved as wontfix.
p = { :p1 => %W[
https://raw.github.com/gist/3924879/f86903e0aea1458448507305d01b06a7d878c041/glib-configurable-paths.patch
]}
p[:p0] = %W[
https://trac.macports.org/export/95596/trunk/dports/devel/glib2/files/patch-configure.diff
] if build.universal?
p[:p1] = "https://raw.github.com/gist/3924879/f86903e0aea1458448507305d01b06a7d878c041/glib-configurable-paths.patch"
p[:p0] = "https://trac.macports.org/export/95596/trunk/dports/devel/glib2/files/patch-configure.diff" if build.universal?
p
end

Expand Down Expand Up @@ -61,13 +58,12 @@ def install
# system, but pkg-config or glib is not smart enough to have determined
# that libintl.dylib isn't in the DYLIB_PATH so we have to add it
# manually.
gettext = Formula.factory('gettext')
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"

"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}"
"Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include -I#{gettext}/include"
end

(share+'gtk-doc').rmtree
Expand All @@ -89,8 +85,7 @@ def install
return (strcmp(str, result_2) == 0) ? 0 : 1;
}
EOS
flags = *`pkg-config --cflags --libs glib-2.0`.split
flags += ENV.cflags.split
flags = `pkg-config --cflags --libs glib-2.0`.split + ENV.cflags.split
system ENV.cc, "-o", "test", "test.c", *flags
system "./test"
end
Expand Down

0 comments on commit aecbf5c

Please sign in to comment.