1{ lib, stdenv, fetchurl, zlib }:
2
3let
4 ARCH = {
5 x86_64-linux = "linux64";
6 aarch64-linux = "linux64";
7 x86_64-cygwin = "cygwin64";
8 x86_64-darwin = "mac64";
9 aarch64-darwin = "mac64";
10 }."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
11in
12stdenv.mkDerivation {
13 pname = "picat";
14 version = "3.6";
15
16 src = fetchurl {
17 url = "http://picat-lang.org/download/picat36_src.tar.gz";
18 hash = "sha256-DjP1cjKxRLxMjiHmYX42+kaG5//09IrPIc1O75gLA6k=";
19 };
20
21 buildInputs = [ zlib ];
22
23 inherit ARCH;
24
25 hardeningDisable = [ "format" ];
26 enableParallelBuilding = true;
27
28 buildPhase = ''
29 cd emu
30 make -j $NIX_BUILD_CORES -f Makefile.$ARCH
31 '';
32 installPhase = ''
33 mkdir -p $out/bin $out/share
34 cp picat $out/bin/
35 cp -r ../doc $out/share/doc
36 cp -r ../exs $out/share/examples
37 '';
38
39 meta = with lib; {
40 description = "Logic-based programming langage";
41 mainProgram = "picat";
42 homepage = "http://picat-lang.org/";
43 license = licenses.mpl20;
44 platforms = [
45 "x86_64-linux"
46 "aarch64-linux"
47 "x86_64-cygwin"
48 "x86_64-darwin"
49 "aarch64-darwin"
50 ];
51 maintainers = with maintainers; [ earldouglas thoughtpolice ];
52 };
53}
54