Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv
2, fetchFromGitHub
3, libX11
4, libXt
5, withGraphics ? true
6}:
7
8stdenv.mkDerivation rec {
9 pname = "icon-lang";
10 version = "unstable-2020-02-05";
11 src = fetchFromGitHub {
12 owner = "gtownsend";
13 repo = "icon";
14 rev = "829cff33de4a21546fb269de3ef5acd7b4f0c0c7";
15 sha256 = "1lj2f13pbaajcy4v3744bz46rghhw5sv4dwwfnzhsllbj5gnjsv2";
16 };
17
18 buildInputs = lib.optionals withGraphics [ libX11 libXt ];
19
20 configurePhase =
21 let
22 target = if withGraphics then "X-Configure" else "Configure";
23 platform =
24 if stdenv.isLinux then "linux"
25 else if stdenv.isDarwin then "macintosh"
26 else if stdenv.isBSD then "bsd"
27 else if stdenv.isCygwin then "cygwin"
28 else if stdenv.isSunOS then "solaris"
29 else throw "unsupported system";
30 in
31 "make ${target} name=${platform}";
32
33 installPhase = ''
34 make Install dest=$out
35 rm $out/README
36 mkdir -p $out/share/doc
37 mv $out/doc $out/share/doc/icon
38 '';
39
40 meta = with lib; {
41 description = "A very high level general-purpose programming language";
42 maintainers = with maintainers; [ vrthra yurrriq ];
43 platforms = with platforms; linux ++ darwin ++ freebsd ++ netbsd ++ openbsd ++ cygwin ++ illumos;
44 license = licenses.publicDomain;
45 homepage = "https://www.cs.arizona.edu/icon/";
46 };
47}