2024-05-15 15:35:15 +00:00
|
|
|
{ lib, stdenv, fetchFromGitLab, readline }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
stdenv.mkDerivation {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "picoc";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "2.1-unstable-2018-06-05";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
src = fetchFromGitLab {
|
2020-04-24 23:36:52 +00:00
|
|
|
owner = "zsaleeba";
|
2024-05-15 15:35:15 +00:00
|
|
|
repo = "picoc";
|
|
|
|
rev = "dc85a51e9211cfb644f0a85ea9546e15dc1141c3";
|
|
|
|
hash = "sha256-yWPRbJLT09E7pqqs9E2k48ECoRR2nhcgTgK5pumkrxo=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ readline ];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.isDarwin [
|
|
|
|
"-Wno-error=implicit-function-declaration"
|
|
|
|
]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
# Tests are currently broken on i686 see
|
2020-05-15 21:57:56 +00:00
|
|
|
# https://hydra.nixos.org/build/24003763/nixlog/1
|
2024-05-15 15:35:15 +00:00
|
|
|
doCheck = !stdenv.isi686 && !stdenv.isAarch64;
|
2020-04-24 23:36:52 +00:00
|
|
|
checkTarget = "test";
|
|
|
|
|
|
|
|
installPhase = ''
|
2024-05-15 15:35:15 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
install -Dm755 picoc $out/bin/picoc
|
|
|
|
|
|
|
|
mkdir -p $out/include
|
|
|
|
install -m644 *.h $out/include
|
2024-05-15 15:35:15 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Very small C interpreter for scripting";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "picoc";
|
2020-04-24 23:36:52 +00:00
|
|
|
longDescription = ''
|
|
|
|
PicoC is a very small C interpreter for scripting. It was originally
|
|
|
|
written as a script language for a UAV's on-board flight system. It's
|
|
|
|
also very suitable for other robotic, embedded and non-embedded
|
|
|
|
applications. The core C source code is around 3500 lines of code. It's
|
|
|
|
not intended to be a complete implementation of ISO C but it has all the
|
|
|
|
essentials. When compiled it only takes a few k of code space and is also
|
|
|
|
very sparing of data space. This means it can work well in small embedded
|
|
|
|
devices.
|
|
|
|
'';
|
2024-05-15 15:35:15 +00:00
|
|
|
homepage = "https://gitlab.com/zsaleeba/picoc";
|
2020-04-24 23:36:52 +00:00
|
|
|
downloadPage = "https://code.google.com/p/picoc/downloads/list";
|
|
|
|
license = licenses.bsd3;
|
2022-03-30 09:31:56 +00:00
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|