diff options
author | Joel Taylor <me@joelt.io> | 2014-05-17 13:21:17 -0700 |
---|---|---|
committer | Joel Taylor <me@joelt.io> | 2014-05-18 20:00:28 -0700 |
commit | dc6c1423cdef7c1b66422f46257f7c43f30fb551 (patch) | |
tree | e3d8dbca53944a09d1a6c948774a1f4ddeb5ead8 /pkgs/development/tools/cdecl | |
parent | 3d32e49058f4830baa9ddb0b1cba46f02ed048b0 (diff) |
build cdecl on darwin
Diffstat (limited to 'pkgs/development/tools/cdecl')
-rw-r--r-- | pkgs/development/tools/cdecl/cdecl-2.5-lex.patch | 13 | ||||
-rw-r--r-- | pkgs/development/tools/cdecl/default.nix | 19 |
2 files changed, 24 insertions, 8 deletions
diff --git a/pkgs/development/tools/cdecl/cdecl-2.5-lex.patch b/pkgs/development/tools/cdecl/cdecl-2.5-lex.patch new file mode 100644 index 000000000000..ecdee5d544f6 --- /dev/null +++ b/pkgs/development/tools/cdecl/cdecl-2.5-lex.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index 1643b74..8f1ae11 100644 +--- a/Makefile ++++ b/Makefile +@@ -33,7 +33,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 diff --git a/pkgs/development/tools/cdecl/default.nix b/pkgs/development/tools/cdecl/default.nix index a9eb323f9a83..68fa64a01650 100644 --- a/pkgs/development/tools/cdecl/default.nix +++ b/pkgs/development/tools/cdecl/default.nix @@ -1,22 +1,25 @@ -{stdenv, fetchurl, yacc, flex, readline, ncurses}: +{stdenv, fetchurl, yacc, flex, readline, ncurses, gnused}: 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"; + url = "http://cdecl.org/files/cdecl-blocks-2.5.tar.gz"; + md5 = "c1927e146975b1c7524cbaf07a7c10f8"; }; - patches = [ ./cdecl-2.5-implicit-pointer.patch ./cdecl-2.5.patch ./cdecl-2.5-gentoo.patch ]; - preBuild = " - makeFlags=\"PREFIX=$out\" - "; + patches = [ ./cdecl-2.5-lex.patch ]; + preBuild = '' + ${gnused}/bin/sed 's/getline/cdecl_getline/g' -i cdecl.c; + makeFlagsArray=(CFLAGS="-DBSD -DUSE_READLINE -std=gnu89" LIBS=-lreadline); + makeFlags="$makeFlags PREFIX=$out BINDIR=$out/bin MANDIR=$out/man1 CATDIR=$out/cat1"; + mkdir -p $out/bin; + ''; buildInputs = [yacc flex readline ncurses]; meta = { description = "Translator English -- C/C++ declarations"; license = "Public Domain"; maintainers = with stdenv.lib.maintainers; [viric]; - platforms = with stdenv.lib.platforms; linux; + # platforms = with stdenv.lib.platforms; linux; }; } |