aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorilovezfs2014-05-11 09:39:53 -0700
committerMike McQuaid2014-06-02 11:46:55 +0100
commit9766ecd6858ab87536dee317c638bc79d0a7bf9f (patch)
treef1a7621e148f1ff91e5d01e644df865595fb2ca2 /Library/Formula
parent2a5855c525c8f5a5b0b847fe9e455f8ef9d1a6ef (diff)
downloadhomebrew-9766ecd6858ab87536dee317c638bc79d0a7bf9f.tar.bz2
dar: fix build, add new options, disable static.
The Mavericks build is fixed by using ENV.libstdcxx with clang. The Mavericks build also can succeed without using ENV.libstdcxx if the compiler is gcc-4.8 (or perhaps others, as well). New options are provided for docs, lzo, gcrypt, gettext, and upx. Accordingly, gettext is no longer a required dependency. The build uses the sed -r option, which is not available in the system sed, but is, in Homebrew's gnu-sed. Specifically, this resolves the error: /usr/bin/sed: illegal option -- r Similarly, when --docs is enabled, the build uses the cp -d option, which is not available in the system cp, but is, in gnu cp, which is part of the coreutils Homebrew formula. In particular, this avoids the error: ./portable_cp html /usr/local/Cellar/dar/2.4.13/share/dar cp: illegal option -- d The configure option --disable-dar-static is now always passed in order to decrease the time it takes for configure to run. This is suggested by the output from configure when configure finds that static is not possible.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/dar.rb34
1 files changed, 29 insertions, 5 deletions
diff --git a/Library/Formula/dar.rb b/Library/Formula/dar.rb
index 15927e10a..1f42acae7 100644
--- a/Library/Formula/dar.rb
+++ b/Library/Formula/dar.rb
@@ -5,13 +5,37 @@ class Dar < Formula
url 'https://downloads.sourceforge.net/project/dar/dar/2.4.13/dar-2.4.13.tar.gz'
sha1 'b20471ada21cd0cbe4687e7bdd3c2e6f70f5c0d1'
- depends_on 'gettext'
+ option 'with-docs', 'build programming documentation (in particular libdar API documentation) and html man page'
+ option 'with-libgcrypt', 'enable strong encryption support'
+ option 'with-lzo', 'enable lzo compression support'
+ option 'with-upx', 'make executables compressed at installation time'
+
+ depends_on 'coreutils' => :build if build.with? 'docs'
+ depends_on 'doxygen' => :build if build.with? 'docs'
+ depends_on 'gettext' => :optional
+ depends_on 'gnu-sed' => :build
+ depends_on 'libgcrypt' => :optional
+ depends_on 'lzo' => :optional
+ depends_on 'upx' => :build if build.with? 'upx'
def install
- system "./configure", "--disable-debug",
- "--disable-dependency-tracking",
- "--prefix=#{prefix}",
- "--disable-build-html"
+ ENV.prepend_path 'PATH', "#{Formula['gnu-sed'].opt_prefix}/libexec/gnubin"
+ ENV.prepend_path 'PATH', "#{Formula['coreutils'].libexec}/gnubin" if build.with? 'docs'
+ ENV.libstdcxx if ENV.compiler == :clang && MacOS.version >= :mavericks
+
+ args = %W[
+ --disable-debug
+ --disable-dependency-tracking
+ --disable-dar-static
+ --prefix=#{prefix}
+ ]
+
+ args << "--disable-build-html" if build.without? 'docs'
+ args << "--disable-libgcrypt-linking" if build.without? 'libgcrypt'
+ args << "--disable-liblzo2-linking" if build.without? 'lzo'
+ args << "--disable-upx" if build.without? 'upx'
+
+ system "./configure", *args
system "make install"
end
end