lol

Merge pull request #2691 from joelteon/cdecl-osx

Update cdecl to block-supporting version

+26 -114
+1
lib/maintainers.nix
··· 45 45 iElectric = "Domen Kozar <domen@dev.si>"; 46 46 iyzsong = "Song Wenwu <iyzsong@gmail.com>"; 47 47 jcumming = "Jack Cummings <jack@mudshark.org>"; 48 + joelteon = "Joel Taylor <me@joelt.io>"; 48 49 jwiegley = "John Wiegley <johnw@newartisans.com>"; 49 50 kkallio = "Karn Kallio <tierpluspluslists@gmail.com>"; 50 51 ktosiek = "Tomasz Kontusz <tomasz.kontusz@gmail.com>";
-29
pkgs/development/tools/cdecl/cdecl-2.5-gentoo.patch
··· 1 - --- a/cdecl.c 2009-07-07 13:20:37.000000000 +0200 2 - +++ a/cdecl.c.new 2009-07-07 13:25:00.000000000 +0200 3 - @@ -91,7 +91,7 @@ 4 - #ifdef USE_READLINE 5 - # include <readline/readline.h> 6 - /* prototypes for functions related to readline() */ 7 - - char * getline(); 8 - + char * mygetline(); 9 - char ** attempt_completion(char *, int, int); 10 - char * keyword_completion(char *, int); 11 - char * command_completion(char *, int); 12 - @@ -375,7 +375,7 @@ 13 - static char *line_read = NULL; 14 - 15 - /* Read a string, and return a pointer to it. Returns NULL on EOF. */ 16 - -char * getline () 17 - +char * mygetline () 18 - { 19 - /* If the buffer has already been allocated, return the memory 20 - to the free pool. */ 21 - @@ -887,7 +887,7 @@ 22 - 23 - if (!quiet) (void) printf("Type `help' or `?' for help\n"); 24 - ret = 0; 25 - - while ((line = getline())) { 26 - + while ((line = mygetline())) { 27 - if (!strcmp(line, "quit") || !strcmp(line, "exit")) { 28 - free(line); 29 - return ret;
-12
pkgs/development/tools/cdecl/cdecl-2.5-implicit-pointer.patch
··· 1 - Index: cdecl-2.5/cdecl.c 2 - =================================================================== 3 - --- cdecl-2.5.orig/cdecl.c 4 - +++ cdecl-2.5/cdecl.c 5 - @@ -204,6 +204,7 @@ int DebugFlag = 0; /* -d, output debugg 6 - #define ANSI 4 /* combo not allowed anymore in ANSI compiler */ 7 - #define A ANSI 8 - 9 - +extern char **completion_matches PARAMS((char *, rl_compentry_func_t *)); 10 - /* This is an lower left triangular array. If we needed */ 11 - /* to save 9 bytes, the "long" row can be removed. */ 12 - char crosscheck[9][9] = {
+13
pkgs/development/tools/cdecl/cdecl-2.5-lex.patch
··· 1 + diff --git a/Makefile b/Makefile 2 + index 1643b74..8f1ae11 100644 3 + --- a/Makefile 4 + +++ b/Makefile 5 + @@ -33,7 +33,7 @@ c++decl: cdgram.c cdlex.c cdecl.c 6 + rm -f cdecl 7 + 8 + cdlex.c: cdlex.l 9 + - lex cdlex.l && mv lex.yy.c cdlex.c 10 + + flex cdlex.l && mv lex.yy.c cdlex.c 11 + 12 + cdgram.c: cdgram.y 13 + yacc cdgram.y && mv y.tab.c cdgram.c
-64
pkgs/development/tools/cdecl/cdecl-2.5.patch
··· 1 - diff --git a/Makefile b/Makefile 2 - index 9e85686..b8e6e02 100644 3 - --- a/Makefile 4 - +++ b/Makefile 5 - @@ -15,13 +15,14 @@ 6 - # 7 - # add -DUSE_READLINE To compile in support for the GNU readline library. 8 - 9 - -CFLAGS= -s -O2 -DUSE_READLINE 10 - +CFLAGS=-DUSE_READLINE 11 - CC= gcc 12 - -LIBS= -lreadline -ltermcap 13 - +LIBS= -lreadline -lncursesw 14 - ALLFILES= makefile cdgram.y cdlex.l cdecl.c cdecl.1 testset testset++ 15 - -BINDIR= /usr/bin 16 - -MANDIR= /usr/man/man1 17 - -CATDIR= /usr/man/cat1 18 - +PREFIX?= /usr 19 - +BINDIR= $(PREFIX)/bin 20 - +MANDIR= $(PREFIX)/man/man1 21 - +CATDIR= $(PREFIX)/man/cat1 22 - INSTALL= install -c 23 - INSTALL_DATA= install -c -m 644 24 - 25 - @@ -33,7 +34,7 @@ c++decl: cdgram.c cdlex.c cdecl.c 26 - rm -f cdecl 27 - 28 - cdlex.c: cdlex.l 29 - - lex cdlex.l && mv lex.yy.c cdlex.c 30 - + flex cdlex.l && mv lex.yy.c cdlex.c 31 - 32 - cdgram.c: cdgram.y 33 - yacc cdgram.y && mv y.tab.c cdgram.c 34 - @@ -43,8 +44,10 @@ test: 35 - ./c++decl < testset++ 36 - 37 - install: cdecl 38 - + $(INSTALL) -d $(BINDIR) 39 - $(INSTALL) cdecl $(BINDIR) 40 - ln $(BINDIR)/cdecl $(BINDIR)/c++decl 41 - + $(INSTALL) -d $(MANDIR) 42 - $(INSTALL_DATA) cdecl.1 $(MANDIR) 43 - $(INSTALL_DATA) c++decl.1 $(MANDIR) 44 - 45 - diff --git a/cdecl.c b/cdecl.c 46 - index f03f01e..1fdde9f 100644 47 - --- a/cdecl.c 48 - +++ b/cdecl.c 49 - @@ -67,6 +67,7 @@ char cdeclsccsid[] = "@(#)cdecl.c 2.5 1/15/96"; 50 - # include <stddef.h> 51 - # include <string.h> 52 - # include <stdarg.h> 53 - +# include <errno.h> 54 - #else 55 - # ifndef NOVARARGS 56 - # include <varargs.h> 57 - @@ -124,7 +125,6 @@ char real_prompt[MAX_NAME+3]; 58 - 59 - #if __STDC__ 60 - char *ds(char *), *cat(char *, ...), *visible(int); 61 - - int getopt(int,char **,char *); 62 - int main(int, char **); 63 - int yywrap(void); 64 - int dostdin(void);
+12 -9
pkgs/development/tools/cdecl/default.nix
··· 1 - {stdenv, fetchurl, yacc, flex, readline, ncurses}: 1 + {stdenv, fetchurl, yacc, flex, readline, ncurses, gnused}: 2 2 3 3 stdenv.mkDerivation { 4 4 name = "cdecl-2.5"; 5 5 src = fetchurl { 6 - url = ftp://metalab.unc.edu/pub/linux/devel/lang/c/cdecl-2.5.tar.gz; 7 - md5 = "29895dab52e85b2474a59449e07b7996"; 6 + url = "http://cdecl.org/files/cdecl-blocks-2.5.tar.gz"; 7 + md5 = "c1927e146975b1c7524cbaf07a7c10f8"; 8 8 }; 9 9 10 - patches = [ ./cdecl-2.5-implicit-pointer.patch ./cdecl-2.5.patch ./cdecl-2.5-gentoo.patch ]; 11 - preBuild = " 12 - makeFlags=\"PREFIX=$out\" 13 - "; 10 + patches = [ ./cdecl-2.5-lex.patch ]; 11 + preBuild = '' 12 + ${gnused}/bin/sed 's/getline/cdecl_getline/g' -i cdecl.c; 13 + makeFlagsArray=(CFLAGS="-DBSD -DUSE_READLINE -std=gnu89" LIBS=-lreadline); 14 + makeFlags="$makeFlags PREFIX=$out BINDIR=$out/bin MANDIR=$out/man1 CATDIR=$out/cat1"; 15 + mkdir -p $out/bin; 16 + ''; 14 17 buildInputs = [yacc flex readline ncurses]; 15 18 16 19 meta = { 17 20 description = "Translator English -- C/C++ declarations"; 18 21 license = "Public Domain"; 19 - maintainers = with stdenv.lib.maintainers; [viric]; 20 - platforms = with stdenv.lib.platforms; linux; 22 + maintainers = with stdenv.lib.maintainers; [viric joelteon]; 23 + platforms = stdenv.lib.platforms.unix; 21 24 }; 22 25 }