aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/interpreters/icon-lang/default.nix
blob: d85448a9677c0e08d1b22a8bb107968ad99e66e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ stdenv, fetchFromGitHub, fetchpatch, libX11, libXt, withGraphics ? true }:

stdenv.mkDerivation rec {
  pname = "icon-lang";
  version = "9.5.1";
  src = fetchFromGitHub {
    owner = "gtownsend";
    repo = "icon";
    rev = "rel${builtins.replaceStrings ["."] [""] version}";
    sha256 = "1gkvj678ldlr1m5kjhx6zpmq11nls8kxa7pyy64whgakfzrypynw";
  };

  buildInputs = stdenv.lib.optionals withGraphics [ libX11 libXt ];

  patches = [
    # Patch on git master, likely won't be necessary in future release
    (fetchpatch {
      url = "https://github.com/gtownsend/icon/commit/bfc4a6004d0d3984c8066289b8d8e563640c4ddd.patch";
      sha256 = "1pqapjghk10rb73a1mfflki2wipjy4kvnravhmrilkqzb9hd6v8m";
      excludes = [
        "doc/relnotes.htm"
        "src/h/version.h"
      ];
    })
  ];

  configurePhase =
    let
      _name = if stdenv.isDarwin then "macintosh" else "linux";
    in
    ''
      make ${stdenv.lib.optionalString withGraphics "X-"}Configure name=${_name}
    '';

  installPhase = ''
    make Install dest=$out
  '';

  meta = with stdenv.lib; {
    description = ''A very high level general-purpose programming language'';
    maintainers = with maintainers; [ vrthra yurrriq ];
    platforms = with platforms; linux ++ darwin;
    license = licenses.publicDomain;
    homepage = "https://www.cs.arizona.edu/icon/";
  };
}