2021-01-23 13:15:07 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, readline }:
|
2015-05-04 15:57:36 +00:00
|
|
|
|
2016-01-24 19:31:44 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "picoc";
|
2016-01-24 19:31:44 +00:00
|
|
|
version = "2015-05-04";
|
2015-05-04 15:57:36 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
sha256 = "01w3jwl0vn9fsmh7p20ad4nl9ljzgfn576yvncd9pk9frx3pd8y4";
|
|
|
|
rev = "4555e8456f020554bcac50751fbb9b36c7d8c13b";
|
|
|
|
repo = "picoc";
|
|
|
|
owner = "zsaleeba";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ readline ];
|
|
|
|
|
2022-03-29 06:15:23 +00:00
|
|
|
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
|
|
|
|
|
2015-05-04 15:57:36 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile --replace '`svnversion -n`' "${version}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-08-05 19:49:34 +00:00
|
|
|
# Tests are currently broken on i686 see
|
2020-04-18 20:51:19 +00:00
|
|
|
# https://hydra.nixos.org/build/24003763/nixlog/1
|
2015-08-05 19:49:34 +00:00
|
|
|
doCheck = if stdenv.isi686 then false else true;
|
2015-05-04 15:57:36 +00:00
|
|
|
checkTarget = "test";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm755 picoc $out/bin/picoc
|
|
|
|
|
|
|
|
mkdir -p $out/include
|
|
|
|
install -m644 *.h $out/include
|
|
|
|
'';
|
2016-01-24 19:31:44 +00:00
|
|
|
|
2021-01-23 13:15:07 +00:00
|
|
|
meta = with lib; {
|
2022-05-29 10:10:05 +00:00
|
|
|
broken = (stdenv.isLinux && stdenv.isAarch64);
|
2016-01-24 19:31:44 +00:00
|
|
|
description = "Very small C interpreter for scripting";
|
|
|
|
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.
|
|
|
|
'';
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/zsaleeba/picoc";
|
|
|
|
downloadPage = "https://code.google.com/p/picoc/downloads/list";
|
2016-01-24 19:31:44 +00:00
|
|
|
license = licenses.bsd3;
|
2022-03-29 06:15:23 +00:00
|
|
|
platforms = platforms.unix;
|
2016-01-24 19:31:44 +00:00
|
|
|
};
|
2015-05-04 15:57:36 +00:00
|
|
|
}
|