1{ stdenv, fetchurl, bison, flex, boost, gputils ? null }:
2
3stdenv.mkDerivation rec {
4 version = "3.5.0";
5 name = "sdcc-${version}";
6
7 src = fetchurl {
8 url = "mirror://sourceforge/sdcc/sdcc-src-${version}.tar.bz2";
9 sha256 = "1aazz0yynr694q0rich7r03qls0zvsjc00il14pb4i22c78phagq";
10 };
11
12 # TODO: remove this comment when gputils != null is tested
13 buildInputs = [ bison flex boost gputils ];
14
15 configureFlags = ''
16 ${if gputils == null then "--disable-pic14-port --disable-pic16-port" else ""}
17 '';
18
19 NIX_CFLAGS_COMPILE = "--std=c99"; # http://sourceforge.net/p/sdcc/code/9106/
20
21 meta = with stdenv.lib; {
22 description = "Small Device C Compiler";
23 longDescription = ''
24 SDCC is a retargettable, optimizing ANSI - C compiler suite that targets
25 the Intel MCS51 based microprocessors (8031, 8032, 8051, 8052, etc.), Maxim
26 (formerly Dallas) DS80C390 variants, Freescale (formerly Motorola) HC08 based
27 (hc08, s08) and Zilog Z80 based MCUs (z80, z180, gbz80, Rabbit 2000/3000,
28 Rabbit 3000A). Work is in progress on supporting the Microchip PIC16 and
29 PIC18 targets. It can be retargeted for other microprocessors.
30 '';
31 homepage = http://sdcc.sourceforge.net/;
32 license = licenses.gpl2;
33 platforms = platforms.linux;
34 maintainers = [ maintainers.bjornfor ];
35 };
36}