2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, autoconf, bison, boost, flex, texinfo, zlib, gputils ? null
|
2020-04-24 23:36:52 +00:00
|
|
|
, excludePorts ? [] }:
|
|
|
|
|
|
|
|
let
|
|
|
|
# choices: mcs51 z80 z180 r2k r3ka gbz80 tlcs90 ds390 ds400 pic14 pic16 hc08 s08 stm8
|
2023-02-02 18:25:31 +00:00
|
|
|
excludedPorts = excludePorts ++ (lib.optionals (gputils == null) [ "pic14" "pic16" ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "sdcc";
|
2022-03-30 09:31:56 +00:00
|
|
|
version = "4.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/sdcc/sdcc-src-${version}.tar.bz2";
|
2022-03-30 09:31:56 +00:00
|
|
|
sha256 = "sha256-tJuuHSO81gV6gsT/5WE/nNDLz9HpQOnYTEv+nfCowFM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-04-19 03:05:28 +00:00
|
|
|
buildInputs = [ boost gputils texinfo zlib ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoconf bison flex ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = map (f: "--disable-${f}-port") excludedPorts;
|
|
|
|
|
2021-08-10 14:31:46 +00:00
|
|
|
preConfigure = ''
|
|
|
|
if test -n "''${dontStrip-}"; then
|
|
|
|
export STRIP=none
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Small Device C Compiler";
|
|
|
|
longDescription = ''
|
|
|
|
SDCC is a retargettable, optimizing ANSI - C compiler suite that targets
|
|
|
|
the Intel MCS51 based microprocessors (8031, 8032, 8051, 8052, etc.), Maxim
|
|
|
|
(formerly Dallas) DS80C390 variants, Freescale (formerly Motorola) HC08 based
|
|
|
|
(hc08, s08) and Zilog Z80 based MCUs (z80, z180, gbz80, Rabbit 2000/3000,
|
|
|
|
Rabbit 3000A). Work is in progress on supporting the Microchip PIC16 and
|
|
|
|
PIC18 targets. It can be retargeted for other microprocessors.
|
|
|
|
'';
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://sdcc.sourceforge.net/";
|
2021-04-19 03:05:28 +00:00
|
|
|
license = with licenses; if (gputils == null) then gpl2Plus else unfreeRedistributable;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ bjornfor yorickvp ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|