2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-06-06 22:54:52 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Gettext < Formula
|
2012-02-26 05:00:28 +00:00
|
|
|
homepage 'http://www.gnu.org/software/gettext/'
|
2011-09-12 16:31:30 +00:00
|
|
|
url 'http://ftpmirror.gnu.org/gettext/gettext-0.18.1.1.tar.gz'
|
2011-11-30 18:56:07 +00:00
|
|
|
mirror 'http://ftp.gnu.org/gnu/gettext/gettext-0.18.1.1.tar.gz'
|
2012-09-04 03:25:35 +00:00
|
|
|
sha1 '5009deb02f67fc3c59c8ce6b82408d1d35d4e38f'
|
2009-09-17 20:10:39 +00:00
|
|
|
|
2010-08-10 20:05:20 +00:00
|
|
|
keg_only "OS X provides the BSD gettext library and some software gets confused if both are in the library path."
|
|
|
|
|
2012-02-27 09:49:20 +00:00
|
|
|
bottle do
|
2012-08-11 14:14:43 +00:00
|
|
|
sha1 'd1ad5ad15bfe8fe813ee37e5d6b514fc79924b9a' => :mountainlion
|
2012-04-10 16:06:57 +00:00
|
|
|
sha1 'c75fdb192f1b49c9e7e2039c66e24f60f26bc027' => :lion
|
2012-08-11 14:14:43 +00:00
|
|
|
sha1 'b8958544542fc160b4c74db5d83cb441d12741c7' => :snowleopard
|
2012-02-27 09:49:20 +00:00
|
|
|
end
|
|
|
|
|
2012-08-10 04:58:02 +00:00
|
|
|
option :universal
|
|
|
|
option 'with-examples', 'Keep example files'
|
2009-09-17 20:10:39 +00:00
|
|
|
|
2011-06-05 02:51:00 +00:00
|
|
|
def patches
|
2011-06-20 21:07:08 +00:00
|
|
|
# Patch to allow building with Xcode 4; safe for any compiler.
|
|
|
|
p = {:p0 => ['https://trac.macports.org/export/79617/trunk/dports/devel/gettext/files/stpncpy.patch']}
|
|
|
|
|
2012-08-10 04:58:02 +00:00
|
|
|
unless build.include? 'with-examples'
|
2011-06-20 21:07:08 +00:00
|
|
|
# Use a MacPorts patch to disable building examples at all,
|
2011-06-05 02:51:00 +00:00
|
|
|
# rather than build them and remove them afterwards.
|
2011-06-20 21:07:08 +00:00
|
|
|
p[:p0] << 'https://trac.macports.org/export/79183/trunk/dports/devel/gettext/files/patch-gettext-tools-Makefile.in'
|
2011-06-05 02:51:00 +00:00
|
|
|
end
|
2011-06-20 21:07:08 +00:00
|
|
|
|
|
|
|
return p
|
2011-06-05 02:51:00 +00:00
|
|
|
end
|
|
|
|
|
2009-06-06 22:54:52 +00:00
|
|
|
def install
|
2009-08-07 14:41:43 +00:00
|
|
|
ENV.libxml2
|
2012-08-10 04:58:02 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
2011-06-05 02:51:51 +00:00
|
|
|
|
gettext: always use bundled libraries
We have been explicitly passing "--without-included-glib", etc. to the
but this doesn't make sense: the flag does not mean "don't use glib at
all", it means "don't use the bundled glib", which means "use an
external copy of glib if one exists, but otherwise fall back to the
included version anyway".
This can lead to subtle breakage: if a user has installed glib, and then
gettext is built from source, gettext will link to the external glib.
When the user goes to upgrade glib the next time around, the build will
fail when it tries to use the now broken gettext binaries.
So in most cases, our gettext formula has been using these bundled
libraries anyway. The most obvious case is the bottles, which do not
have external linkage to glib, libunistring, etc.
In order to cover all cases, _always_ build with the included libraries.
There is no need to rebuild the bottles for these changes, as they are
correct already.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-20 21:53:17 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--disable-debug",
|
2009-08-07 14:41:43 +00:00
|
|
|
"--prefix=#{prefix}",
|
gettext: always use bundled libraries
We have been explicitly passing "--without-included-glib", etc. to the
but this doesn't make sense: the flag does not mean "don't use glib at
all", it means "don't use the bundled glib", which means "use an
external copy of glib if one exists, but otherwise fall back to the
included version anyway".
This can lead to subtle breakage: if a user has installed glib, and then
gettext is built from source, gettext will link to the external glib.
When the user goes to upgrade glib the next time around, the build will
fail when it tries to use the now broken gettext binaries.
So in most cases, our gettext formula has been using these bundled
libraries anyway. The most obvious case is the bottles, which do not
have external linkage to glib, libunistring, etc.
In order to cover all cases, _always_ build with the included libraries.
There is no need to rebuild the bottles for these changes, as they are
correct already.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-20 21:53:17 +00:00
|
|
|
"--with-included-gettext",
|
|
|
|
"--with-included-glib",
|
|
|
|
"--with-included-libcroco",
|
|
|
|
"--with-included-libunistring",
|
2011-06-05 02:51:00 +00:00
|
|
|
"--without-emacs",
|
|
|
|
# Don't use VCS systems to create these archives
|
|
|
|
"--without-git",
|
|
|
|
"--without-cvs"
|
2009-06-06 22:54:52 +00:00
|
|
|
system "make"
|
2009-08-07 14:41:43 +00:00
|
|
|
ENV.deparallelize # install doesn't support multiple make jobs
|
2009-06-06 22:54:52 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|