@@ -0,0 +1,51 @@
1+{ stdenv, fetchFromGitHub, readline }:
2+
3+let version = "2015-05-04"; in
4+stdenv.mkDerivation rec {
5+ name = "picoc-${version}";
6+
7+ src = fetchFromGitHub {
8+ sha256 = "01w3jwl0vn9fsmh7p20ad4nl9ljzgfn576yvncd9pk9frx3pd8y4";
9+ rev = "4555e8456f020554bcac50751fbb9b36c7d8c13b";
10+ repo = "picoc";
11+ owner = "zsaleeba";
12+ };
13+
14+ meta = with stdenv.lib; {
15+ inherit version;
16+ description = "Very small C interpreter for scripting";
17+ longDescription = ''
18+ PicoC is a very small C interpreter for scripting. It was originally
19+ written as a script language for a UAV's on-board flight system. It's
20+ also very suitable for other robotic, embedded and non-embedded
21+ applications. The core C source code is around 3500 lines of code. It's
22+ not intended to be a complete implementation of ISO C but it has all the
23+ essentials. When compiled it only takes a few k of code space and is also
24+ very sparing of data space. This means it can work well in small embedded
25+ devices.
26+ '';
27+ homepage = https://github.com/zsaleeba/picoc;
28+ downloadPage = https://code.google.com/p/picoc/downloads/list;
29+ license = with licenses; bsd3;
30+ platforms = with platforms; linux;
31+ maintainers = with maintainers; [ nckx ];
32+ };
33+
34+ buildInputs = [ readline ];
35+
36+ postPatch = ''
37+ substituteInPlace Makefile --replace '`svnversion -n`' "${version}"
38+ '';
39+
40+ enableParallelBuilding = true;
41+
42+ doCheck = true;
43+ checkTarget = "test";
44+
45+ installPhase = ''
46+ install -Dm755 picoc $out/bin/picoc
47+
48+ mkdir -p $out/include
49+ install -m644 *.h $out/include
50+ '';
51+}