2011-06-19 21:53:37 +00:00
|
|
|
class GnuIndent < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "C code prettifier"
|
2014-11-13 04:07:34 +00:00
|
|
|
homepage "https://www.gnu.org/software/indent/"
|
|
|
|
url "http://ftpmirror.gnu.org/indent/indent-2.2.10.tar.gz"
|
|
|
|
mirror "https://ftp.gnu.org/gnu/indent/indent-2.2.10.tar.gz"
|
2015-08-03 12:55:31 +00:00
|
|
|
sha256 "8a9b41be5bfcab5d8c1be74204b10ae78789fc3deabea0775fdced8677292639"
|
2011-03-09 02:32:58 +00:00
|
|
|
|
2014-11-13 04:07:34 +00:00
|
|
|
depends_on "gettext"
|
2011-03-09 02:32:58 +00:00
|
|
|
|
2014-11-13 04:07:34 +00:00
|
|
|
deprecated_option "default-names" => "with-default-names"
|
|
|
|
|
|
|
|
option "with-default-names", "Do not prepend 'g' to the binary"
|
2011-03-09 02:32:58 +00:00
|
|
|
|
2012-09-06 22:49:56 +00:00
|
|
|
# Fix broken include and missing build dependency
|
2014-03-19 17:07:51 +00:00
|
|
|
patch :DATA
|
2012-09-06 22:49:56 +00:00
|
|
|
|
2011-03-09 02:32:58 +00:00
|
|
|
def install
|
2012-09-06 22:49:56 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-debug
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--mandir=#{man}
|
2015-08-03 12:55:31 +00:00
|
|
|
]
|
2011-03-09 02:32:58 +00:00
|
|
|
|
2014-11-13 04:07:34 +00:00
|
|
|
args << "--program-prefix=g" if build.without? "default-names"
|
2011-03-09 02:32:58 +00:00
|
|
|
|
|
|
|
system "./configure", *args
|
2014-11-13 04:07:34 +00:00
|
|
|
system "make", "install"
|
2011-03-09 02:32:58 +00:00
|
|
|
end
|
2014-12-28 14:06:35 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
(testpath/"test.c").write("int main(){ return 0; }")
|
|
|
|
system "#{bin}/gindent", "test.c"
|
|
|
|
assert_equal File.read("test.c"), <<-EOS.undent
|
|
|
|
int
|
|
|
|
main ()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
end
|
2011-03-09 02:32:58 +00:00
|
|
|
end
|
2012-09-06 22:49:56 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/man/Makefile.in b/man/Makefile.in
|
|
|
|
index 76839bc..8a5fc6e 100644
|
|
|
|
--- a/man/Makefile.in
|
|
|
|
+++ b/man/Makefile.in
|
|
|
|
@@ -507,7 +507,7 @@ uninstall-man: uninstall-man1
|
|
|
|
uninstall-man uninstall-man1
|
|
|
|
|
|
|
|
|
|
|
|
-@PACKAGE@.1: ${srcdir}/@PACKAGE@.1.in ${srcdir}/../doc/@PACKAGE@.texinfo texinfo2man.c Makefile.am
|
|
|
|
+@PACKAGE@.1: ${srcdir}/@PACKAGE@.1.in ${srcdir}/../doc/@PACKAGE@.texinfo texinfo2man.c Makefile.am texinfo2man
|
|
|
|
./texinfo2man ${srcdir}/@PACKAGE@.1.in ${srcdir}/../doc/@PACKAGE@.texinfo > $@
|
|
|
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
|
|
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
|
|
|
diff --git a/man/texinfo2man.c b/man/texinfo2man.c
|
|
|
|
index e7d82e1..c95266f 100644
|
|
|
|
--- a/man/texinfo2man.c
|
|
|
|
+++ b/man/texinfo2man.c
|
|
|
|
@@ -1,6 +1,5 @@
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
-#include <malloc.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
|