2014-03-02 19:04:09 +00:00
|
|
|
class Deheader < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Analyze C/C++ files for unnecessary headers"
|
2015-01-13 09:11:42 +00:00
|
|
|
homepage "http://www.catb.org/~esr/deheader"
|
2015-04-29 10:24:17 +00:00
|
|
|
url "http://www.catb.org/~esr/deheader/deheader-1.1.tar.gz"
|
|
|
|
sha256 "69f69e9c7d9398221cb49f7de91df0d122e4b0ec942bede2d7c592401e4b913c"
|
|
|
|
head "git://thyrsus.com/repositories/deheader.git"
|
2014-03-02 19:04:09 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
bin.install "deheader"
|
2015-04-29 10:24:17 +00:00
|
|
|
# Man page is defined in a DocBook XML file, the DTD for which is MIA,
|
|
|
|
# thus there's no way to build it from HEAD...
|
|
|
|
man1.install "deheader.1" unless build.head?
|
2014-03-02 19:04:09 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.c").write <<-EOS.undent
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
int main(void) {
|
|
|
|
printf("%s", "foo");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
2015-01-13 09:11:42 +00:00
|
|
|
assert_equal "121", shell_output("deheader test.c | tr -cd 0-9")
|
2014-03-02 19:04:09 +00:00
|
|
|
end
|
|
|
|
end
|