btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / pi / picat / package.nix
blob04c80884670dd87104b707cb24378e99453774b0
1 { lib, stdenv, fetchurl, zlib }:
3 let
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}");
12 stdenv.mkDerivation {
13   pname = "picat";
14   version = "3.6#8";
16   src = fetchurl {
17     url = "http://picat-lang.org/download/picat368_src.tar.gz";
18     hash = "sha256-eJxF5atvJq3fhFltcQCGTP/sgUmfsfCohUgm3x2U1n0=";
19   };
21   buildInputs = [ zlib ];
23   inherit ARCH;
25   hardeningDisable = [ "format" ];
26   enableParallelBuilding = true;
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   '';
39   meta = with lib; {
40     description = "Logic-based programming language";
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   };