Skip to content

Commit

Permalink
Statically building our own iconv into formula deemed unnecessary
Browse files Browse the repository at this point in the history
Now we have our libiconv formula.

Sadly Lion still lacks the iconv_open symbol in 64 bit flavour. Sucks.

Fixes Homebrew#6066. Indirectly.
  • Loading branch information
mxcl authored and martinploeger committed Oct 8, 2011
1 parent 005b2a8 commit 86ff3e5
Showing 1 changed file with 5 additions and 28 deletions.
33 changes: 5 additions & 28 deletions Library/Formula/glib.rb
@@ -1,11 +1,5 @@
require 'formula'

class Libiconv < Formula
homepage 'http://www.gnu.org/software/libiconv/'
url 'http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz'
md5 '7ab33ebd26687c744a37264a330bbe9a'
end

def build_tests?; ARGV.include? '--test'; end

class Glib < Formula
Expand All @@ -17,6 +11,11 @@ class Glib < Formula
depends_on 'gettext'

fails_with_llvm "Undefined symbol errors while linking"
# Lion and Snow Leopard don't have a 64 bit version of the iconv_open
# function. The fact that Lion still doesn't is ridiculous. But we're as
# much to blame. Nobody reported the bug FFS. And I'm still not going to
# because I'm in a hurry here.
depends_on 'libiconv'

def patches
mp = "https://svn.macports.org/repository/macports/trunk/dports/devel/glib2/files/"
Expand All @@ -42,31 +41,9 @@ def options
def install
ENV.universal_binary if ARGV.build_universal?

# Snow Leopard libiconv doesn't have a 64bit version of the libiconv_open
# function, which breaks things for us, so we build our own
# http://www.mail-archive.com/gtk-list@gnome.org/msg28747.html

iconvd = Pathname.getwd+'iconv'
iconvd.mkpath

Libiconv.new.brew do
# Help out universal builds
# TODO - do these lines need to be here?
# ENV["ac_cv_func_malloc_0_nonnull"]='yes'
# ENV["gl_cv_func_malloc_0_nonnull"]='1'

system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{iconvd}",
"--enable-static", "--disable-shared"
system "make install"
end

# indeed, amazingly, -w causes gcc to emit spurious errors for this package!
ENV.enable_warnings

# Statically link to libiconv so glib doesn't use the bugged version in 10.6
ENV['LDFLAGS'] += " #{iconvd}/lib/libiconv.a"

args = ["--disable-dependency-tracking", "--disable-rebuilds",
"--prefix=#{prefix}",
"--with-libiconv=gnu"]
Expand Down

0 comments on commit 86ff3e5

Please sign in to comment.