2021-05-20 23:08:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, libpng, bison, flex, ffmpeg, icu }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "cfdg";
|
2023-08-22 20:05:09 +00:00
|
|
|
version = "3.4.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "MtnViewJohn";
|
|
|
|
repo = "context-free";
|
|
|
|
rev = "Version${version}";
|
2023-08-22 20:05:09 +00:00
|
|
|
sha256 = "sha256-f2VMb0TM50afKf/lGdZBP2z13UrCVgG4/IYi5gnD+ow=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
nativeBuildInputs = [ bison flex ];
|
|
|
|
buildInputs = [ libpng ffmpeg icu ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -e "/YY_NO_UNISTD/a#include <stdio.h>" -i src-common/cfdg.l
|
|
|
|
sed -e '1i#include <algorithm>' -i src-common/{cfdg,builder,ast}.cpp
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2022-10-06 18:32:54 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/bin
|
|
|
|
cp cfdg $out/bin/
|
|
|
|
|
|
|
|
mkdir -p $out/share/doc/${pname}-${version}
|
|
|
|
cp *.txt $out/share/doc/${pname}-${version}
|
2022-10-06 18:32:54 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Context-free design grammar - a tool for graphics generation";
|
|
|
|
maintainers = with maintainers; [ raskin ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
homepage = "https://contextfreeart.org/";
|
2022-10-06 18:32:54 +00:00
|
|
|
license = licenses.gpl2Only;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "cfdg";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|