summary refs log tree commit diff
path: root/pkgs/development/tools/cdecl
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2009-01-24 21:01:27 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2009-01-24 21:01:27 +0000
commitaad3e77b448a07946e504c776c0494276325f1e9 (patch)
tree21653d9b4e609d2855ab24d260ad0c9941570f44 /pkgs/development/tools/cdecl
parent00756b63b0bbdea9bc18987bcb3b685a816cf18d (diff)
downloadnixpkgs-aad3e77b448a07946e504c776c0494276325f1e9.tar
nixpkgs-aad3e77b448a07946e504c776c0494276325f1e9.tar.gz
nixpkgs-aad3e77b448a07946e504c776c0494276325f1e9.tar.bz2
nixpkgs-aad3e77b448a07946e504c776c0494276325f1e9.tar.lz
nixpkgs-aad3e77b448a07946e504c776c0494276325f1e9.tar.xz
nixpkgs-aad3e77b448a07946e504c776c0494276325f1e9.tar.zst
nixpkgs-aad3e77b448a07946e504c776c0494276325f1e9.zip
Adding cdecl-2.5
svn path=/nixpkgs/trunk/; revision=13833
Diffstat (limited to 'pkgs/development/tools/cdecl')
-rw-r--r--pkgs/development/tools/cdecl/cdecl-2.5.patch64
-rw-r--r--pkgs/development/tools/cdecl/default.nix19
2 files changed, 83 insertions, 0 deletions
diff --git a/pkgs/development/tools/cdecl/cdecl-2.5.patch b/pkgs/development/tools/cdecl/cdecl-2.5.patch
new file mode 100644
index 00000000000..b66ee1a2c4e
--- /dev/null
+++ b/pkgs/development/tools/cdecl/cdecl-2.5.patch
@@ -0,0 +1,64 @@
+diff --git a/Makefile b/Makefile
+index 9e85686..b8e6e02 100644
+--- a/Makefile
++++ b/Makefile
+@@ -15,13 +15,14 @@
+ #
+ # add -DUSE_READLINE	To compile in support for the GNU readline library.
+ 
+-CFLAGS= -s -O2 -DUSE_READLINE
++
+ CC= gcc
+-LIBS= -lreadline -ltermcap
++
+ ALLFILES= makefile cdgram.y cdlex.l cdecl.c cdecl.1 testset testset++
+-BINDIR= /usr/bin
+-MANDIR= /usr/man/man1
+-CATDIR= /usr/man/cat1
++PREFIX?= /usr
++BINDIR= $(PREFIX)/bin
++MANDIR= $(PREFIX)/man/man1
++CATDIR= $(PREFIX)/man/cat1
+ INSTALL= install -c
+ INSTALL_DATA= install -c -m 644
+ 
+@@ -33,7 +34,7 @@ c++decl: cdgram.c cdlex.c cdecl.c
+ 	rm -f cdecl
+ 
+ cdlex.c: cdlex.l
+-	lex cdlex.l && mv lex.yy.c cdlex.c
++	flex cdlex.l && mv lex.yy.c cdlex.c
+ 
+ cdgram.c: cdgram.y
+ 	yacc cdgram.y && mv y.tab.c cdgram.c
+@@ -43,8 +44,10 @@ test:
+ 	./c++decl < testset++
+ 
+ install: cdecl
++	$(INSTALL) -d $(BINDIR)
+ 	$(INSTALL) cdecl $(BINDIR)
+ 	ln $(BINDIR)/cdecl $(BINDIR)/c++decl
++	$(INSTALL) -d $(MANDIR)
+ 	$(INSTALL_DATA) cdecl.1 $(MANDIR)
+ 	$(INSTALL_DATA) c++decl.1 $(MANDIR)
+ 
+diff --git a/cdecl.c b/cdecl.c
+index f03f01e..1fdde9f 100644
+--- a/cdecl.c
++++ b/cdecl.c
+@@ -67,6 +67,7 @@ char cdeclsccsid[] = "@(#)cdecl.c	2.5 1/15/96";
+ # include <stddef.h>
+ # include <string.h>
+ # include <stdarg.h>
++# include <errno.h>
+ #else
+ # ifndef NOVARARGS
+ #  include <varargs.h>
+@@ -124,7 +125,6 @@ char real_prompt[MAX_NAME+3];
+ 
+ #if __STDC__
+   char *ds(char *), *cat(char *, ...), *visible(int);
+-  int getopt(int,char **,char *);
+   int main(int, char **);
+   int yywrap(void);
+   int dostdin(void);
diff --git a/pkgs/development/tools/cdecl/default.nix b/pkgs/development/tools/cdecl/default.nix
new file mode 100644
index 00000000000..65377508d9f
--- /dev/null
+++ b/pkgs/development/tools/cdecl/default.nix
@@ -0,0 +1,19 @@
+{stdenv, fetchurl, yacc, flex, readline}:
+
+stdenv.mkDerivation {
+  name = "cdecl-2.5";
+  src = fetchurl {
+    url = ftp://metalab.unc.edu/pub/linux/devel/lang/c/cdecl-2.5.tar.gz;
+    md5 = "29895dab52e85b2474a59449e07b7996";
+  };
+
+  patches = [ ./cdecl-2.5.patch ];
+  preBuild = "
+    makeFlags=\"PREFIX=$out\"
+  ";
+  buildInputs = [yacc flex readline];
+
+  meta = {
+    description = "Translator English -- C/C++ declarations";
+  };
+}