2009-11-30 08:44:20 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Ohcount < Formula
|
2013-07-16 13:33:47 +00:00
|
|
|
homepage 'https://github.com/blackducksw/ohcount'
|
|
|
|
url 'https://github.com/blackducksw/ohcount/archive/3.0.0.tar.gz'
|
|
|
|
sha1 '7f3fce48bf2a522c5262215699c36625ca6d3d33'
|
|
|
|
|
|
|
|
head 'https://github.com/blackducksw/ohcount.git'
|
2009-11-30 08:44:20 +00:00
|
|
|
|
|
|
|
depends_on 'ragel'
|
|
|
|
depends_on 'pcre'
|
2013-07-16 13:33:47 +00:00
|
|
|
depends_on 'libmagic' if build.head?
|
2009-11-30 08:44:20 +00:00
|
|
|
|
|
|
|
def patches
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
2012-02-24 22:51:33 +00:00
|
|
|
# find Homebrew's libpcre
|
|
|
|
ENV.append 'LDFLAGS', "-L#{HOMEBREW_PREFIX}/lib"
|
|
|
|
|
2009-11-30 08:44:20 +00:00
|
|
|
system "./build", "ohcount"
|
|
|
|
bin.install 'bin/ohcount'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
__END__
|
|
|
|
--- a/build
|
|
|
|
+++ b/build
|
2009-11-30 10:37:16 +00:00
|
|
|
@@ -29,7 +29,7 @@ else
|
|
|
|
INC_DIR=/opt/local/include
|
|
|
|
LIB_DIR=/opt/local/lib
|
|
|
|
# You shouldn't have to change the following.
|
|
|
|
- CFLAGS="-fno-common -g"
|
|
|
|
+ #CFLAGS="-fno-common -g"
|
|
|
|
WARN="-Wall -Wno-parentheses"
|
|
|
|
SHARED="-dynamiclib -L$LIB_DIR -lpcre"
|
|
|
|
SHARED_NAME=libohcount.dylib
|
2009-11-30 08:44:20 +00:00
|
|
|
@@ -38,7 +38,7 @@ else
|
|
|
|
fi
|
|
|
|
|
|
|
|
# C compiler and flags
|
|
|
|
-cc="gcc -fPIC -g $CFLAGS $WARN -I$INC_DIR -L$LIB_DIR"
|
2009-11-30 10:37:16 +00:00
|
|
|
+cc="$CC $CFLAGS -O0 $WARN $CPPFLAGS $LDFLAGS"
|
2009-11-30 08:44:20 +00:00
|
|
|
|
|
|
|
# Ohcount source files
|
|
|
|
files="src/sourcefile.c \
|