aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorCharlie Sharpsteen2012-05-23 17:21:56 -0700
committerCharlie Sharpsteen2012-05-23 17:24:12 -0700
commit8fcfdeef149c8c93eb1e55eac012f650becc124b (patch)
treef4c5fa90a98018ea3d7084771626ba05313e59e0 /Library/Formula
parentaeef837348f5ebb1631722190c6ad61dd715b2da (diff)
downloadhomebrew-8fcfdeef149c8c93eb1e55eac012f650becc124b.tar.bz2
ncview: Patch rpath settings out of configure
The configure script tries to be clever with figuring out rpath flags for the compilers. It fails epically. Also, use `ENV.x11` which removes the need for a couple of configure arguments and allows libpng to be found.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/ncview.rb49
1 files changed, 47 insertions, 2 deletions
diff --git a/Library/Formula/ncview.rb b/Library/Formula/ncview.rb
index fb2425f01..1e4dd9af9 100644
--- a/Library/Formula/ncview.rb
+++ b/Library/Formula/ncview.rb
@@ -7,10 +7,55 @@ class Ncview < Formula
depends_on "netcdf"
+ # Disable a block in configure that tries to pass an RPATH to the compiler.
+ # The code guesses wrong which causes the linking step to fail.
+ def patches
+ DATA
+ end
+
def install
+ ENV.x11 # For GUI and libpng.
+
system "./configure", "--prefix=#{prefix}",
- "--x-libraries=/usr/X11/lib",
- "--x-includes=/usr/X11/include"
+ "--disable-dependency-tracking"
system "make install"
end
end
+
+__END__
+Don't try to mess with the compiler rpath. Just not a good idea.
+
+diff --git a/configure b/configure
+index b80ae96..a650f6f 100755
+--- a/configure
++++ b/configure
+@@ -8672,29 +8672,6 @@ if test x$CC_TEST_SAME != x$NETCDF_CC_TEST_SAME; then
+ exit -1
+ fi
+
+-#----------------------------------------------------------------------------------
+-# Construct our RPATH flags. Idea here is that we have LDFLAGS that might look,
+-# for example, something like this:
+-# LIBS="-L/usr/local/lib -lnetcdf -L/home/pierce/lib -ludunits"
+-# We want to convert this to -rpath flags suitable for the compiler, which would
+-# have this format:
+-# "-Wl,-rpath,/usr/local/lib -Wl,-rpath,/home/pierce/lib"
+-#
+-# As a safety check, I only do this for the GNU compiler, as I don't know if this
+-# is anything like correct syntax for other compilers. Note that this *does* work
+-# for the Intel icc compiler, but also that the icc compiler sets $ac_compiler_gnu
+-# to "yes". Go figure.
+-#----------------------------------------------------------------------------------
+-if test x$ac_compiler_gnu = xyes; then
+- RPATH_FLAGS=""
+- for word in $UDUNITS2_LDFLAGS $NETCDF_LDFLAGS; do
+- if test `expr $word : -L/` -eq 3; then
+- RPDIR=`expr substr $word 3 999`;
+- RPATH_FLAGS="$RPATH_FLAGS -Wl,-rpath,$RPDIR"
+- fi
+- done
+-
+-fi
+
+
+ ac_config_files="$ac_config_files Makefile src/Makefile"