aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMyles Borins2013-01-09 01:16:07 -0800
committerAdam Vandenberg2013-01-13 18:17:56 -0800
commita6e4ca1469af81d711c6656cb1dd016f36cfef77 (patch)
tree16525facb332f60a09269f73563c03bb1dd5fd12
parentead06fb5ba4d4f69c6cd9a7f7834346de1f3651b (diff)
downloadhomebrew-a6e4ca1469af81d711c6656cb1dd016f36cfef77.tar.bz2
stk: added --enable-debug flag
Closes #16966. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
-rw-r--r--Library/Formula/stk.rb36
1 files changed, 33 insertions, 3 deletions
diff --git a/Library/Formula/stk.rb b/Library/Formula/stk.rb
index 1083bb81e..c5440d027 100644
--- a/Library/Formula/stk.rb
+++ b/Library/Formula/stk.rb
@@ -5,9 +5,29 @@ class Stk < Formula
url 'http://ccrma.stanford.edu/software/stk/release/stk-4.4.4.tar.gz'
sha1 '2a94f02ed054d3b991352cc68a85a0a8063e3a4b'
+ depends_on :automake
+
+ option "enable-debug", "Compile with debug flags and modified CFLAGS for easier debugging"
+
+ fails_with :clang do
+ build 421
+ cause 'due to configure file this application will not properly compile with clang'
+ end
+
def install
- system "./configure", "--disable-debug", "--disable-dependency-tracking",
- "--prefix=#{prefix}"
+
+ if build.include? "enable-debug"
+ inreplace 'configure', 'CFLAGS="-g -O2"', 'CFLAGS="-g -O0"'
+ inreplace 'configure', 'CXXFLAGS="-g -O2"', 'CXXFLAGS="-g -O0"'
+ inreplace 'configure', 'CPPFLAGS="$CPPFLAGS $cppflag"',' CPPFLAGS="$CPPFLAGS $cppflag -g -O0"'
+ debug_status = "--enable-debug"
+ else
+ debug_status = "--disable-debug"
+ end
+
+ system "./configure", "--prefix=#{prefix}",
+ debug_status,
+ "--disable-dependency-tracking"
system "make"
@@ -16,6 +36,16 @@ class Stk < Formula
(include/'stk').install Dir['include/*']
doc.install Dir['doc/*']
- (share/'stk').install 'projects', 'rawwaves'
+ (share/'stk').install 'src', 'projects', 'rawwaves'
+ end
+
+ def caveats; <<-EOS.undent
+ The header files have been put in a standard search path, it is possible to use an include statement in programs as follows:
+
+ #include \"stk/FileLoop.h\"
+ #include \"stk/FileWvOut.h\"
+
+ src/ projects/ and rawwaves/ have all been copied to /usr/local/share/stk
+ EOS
end
end