2023-11-05 20:59:31 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, autoconf
|
|
|
|
, bison
|
|
|
|
, boost
|
|
|
|
, flex
|
|
|
|
, gputils
|
|
|
|
, texinfo
|
|
|
|
, zlib
|
|
|
|
, withGputils ? false
|
|
|
|
, excludePorts ? []
|
|
|
|
}:
|
2018-07-17 16:16:24 +00:00
|
|
|
|
2023-11-05 20:59:31 +00:00
|
|
|
assert lib.subtractLists [
|
|
|
|
"ds390" "ds400" "gbz80" "hc08" "mcs51" "pic14" "pic16" "r2k" "r3ka" "s08"
|
|
|
|
"stm8" "tlcs90" "z80" "z180"
|
|
|
|
] excludePorts == [];
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "sdcc";
|
2024-01-26 21:22:02 +00:00
|
|
|
version = "4.4.0";
|
sdcc: new nixpkg (SDCC -> Small Device C Compiler)
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.
2013-03-10 20:23:56 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-11-05 20:59:31 +00:00
|
|
|
url = "mirror://sourceforge/sdcc/sdcc-src-${finalAttrs.version}.tar.bz2";
|
2024-01-26 21:22:02 +00:00
|
|
|
hash = "sha256-rowSFl6xdoDf9EsyjYh5mWMGtyQe+jqDsuOy0veQanU=";
|
sdcc: new nixpkg (SDCC -> Small Device C Compiler)
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.
2013-03-10 20:23:56 +00:00
|
|
|
};
|
|
|
|
|
2023-11-05 20:59:31 +00:00
|
|
|
outputs = [ "out" "doc" "man" ];
|
|
|
|
|
2023-04-21 20:51:46 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2023-11-05 20:59:31 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoconf
|
|
|
|
bison
|
|
|
|
flex
|
|
|
|
];
|
2021-04-18 07:50:47 +00:00
|
|
|
|
2023-11-05 20:59:31 +00:00
|
|
|
buildInputs = [
|
|
|
|
boost
|
|
|
|
texinfo
|
|
|
|
zlib
|
|
|
|
] ++ lib.optionals withGputils [
|
|
|
|
gputils
|
|
|
|
];
|
sdcc: new nixpkg (SDCC -> Small Device C Compiler)
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.
2013-03-10 20:23:56 +00:00
|
|
|
|
2023-11-05 20:59:31 +00:00
|
|
|
configureFlags = let
|
|
|
|
excludedPorts = excludePorts
|
|
|
|
++ (lib.optionals (!withGputils) [ "pic14" "pic16" ]);
|
|
|
|
in
|
|
|
|
map (f: "--disable-${f}-port") excludedPorts;
|
sdcc: new nixpkg (SDCC -> Small Device C Compiler)
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.
2013-03-10 20:23:56 +00:00
|
|
|
|
2021-08-09 20:10:14 +00:00
|
|
|
preConfigure = ''
|
|
|
|
if test -n "''${dontStrip-}"; then
|
|
|
|
export STRIP=none
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2023-11-05 20:59:31 +00:00
|
|
|
meta = {
|
|
|
|
homepage = "https://sdcc.sourceforge.net/";
|
sdcc: new nixpkg (SDCC -> Small Device C Compiler)
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.
2013-03-10 20:23:56 +00:00
|
|
|
description = "Small Device C Compiler";
|
|
|
|
longDescription = ''
|
|
|
|
SDCC is a retargettable, optimizing ANSI - C compiler suite that targets
|
2023-11-05 20:59:31 +00:00
|
|
|
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.
|
sdcc: new nixpkg (SDCC -> Small Device C Compiler)
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.
2013-03-10 20:23:56 +00:00
|
|
|
'';
|
2023-11-05 20:59:31 +00:00
|
|
|
license = if withGputils
|
|
|
|
then lib.licenses.unfreeRedistributable
|
|
|
|
else lib.licenses.gpl2Plus;
|
|
|
|
mainProgram = "sdcc";
|
|
|
|
maintainers = with lib.maintainers; [ bjornfor yorickvp ];
|
|
|
|
platforms = lib.platforms.all;
|
sdcc: new nixpkg (SDCC -> Small Device C Compiler)
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.
2013-03-10 20:23:56 +00:00
|
|
|
};
|
2023-11-05 20:59:31 +00:00
|
|
|
})
|