2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, zlib }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
let
|
|
|
|
ARCH = {
|
2024-04-21 15:54:59 +00:00
|
|
|
x86_64-linux = "linux64";
|
2020-11-21 19:51:51 +00:00
|
|
|
aarch64-linux = "linux64";
|
2024-04-21 15:54:59 +00:00
|
|
|
x86_64-cygwin = "cygwin64";
|
|
|
|
x86_64-darwin = "mac64";
|
|
|
|
aarch64-darwin = "mac64";
|
2020-11-21 19:51:51 +00:00
|
|
|
}."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
|
|
|
in
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "picat";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "3.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-04-21 15:54:59 +00:00
|
|
|
url = "http://picat-lang.org/download/picat36_src.tar.gz";
|
|
|
|
hash = "sha256-DjP1cjKxRLxMjiHmYX42+kaG5//09IrPIc1O75gLA6k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ zlib ];
|
|
|
|
|
2020-11-21 19:51:51 +00:00
|
|
|
inherit ARCH;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
2020-10-07 09:15:18 +00:00
|
|
|
enableParallelBuilding = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
buildPhase = ''
|
|
|
|
cd emu
|
|
|
|
make -j $NIX_BUILD_CORES -f Makefile.$ARCH
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/share
|
|
|
|
cp picat $out/bin/
|
|
|
|
cp -r ../doc $out/share/doc
|
|
|
|
cp -r ../exs $out/share/examples
|
|
|
|
'';
|
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 = "Logic-based programming langage";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "picat";
|
2020-11-21 19:51:51 +00:00
|
|
|
homepage = "http://picat-lang.org/";
|
|
|
|
license = licenses.mpl20;
|
2024-04-21 15:54:59 +00:00
|
|
|
platforms = [
|
|
|
|
"x86_64-linux"
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-cygwin"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"aarch64-darwin"
|
|
|
|
];
|
2020-11-21 19:51:51 +00:00
|
|
|
maintainers = with maintainers; [ earldouglas thoughtpolice ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|
2024-04-21 15:54:59 +00:00
|
|
|
|