icon-lang: rework to support darwin and building without graphics

This commit is contained in:
Eric Bailey 2019-01-09 23:50:35 -06:00
parent 2ea8d578e0
commit 31d1ce7e64

View File

@ -1,19 +1,24 @@
{ stdenv, fetchFromGitHub, libX11, libXt }:
{ stdenv, fetchFromGitHub, libX11, libXt , withGraphics ? true }:
stdenv.mkDerivation rec {
name = "icon-lang-${version}";
version = "9.5.1";
src = fetchFromGitHub {
rev = "39d7438e8d23ccfe20c0af8bbbf61e34d9c715e9";
owner = "gtownsend";
repo = "icon";
rev = "rel${builtins.replaceStrings ["."] [""] version}";
sha256 = "1gkvj678ldlr1m5kjhx6zpmq11nls8kxa7pyy64whgakfzrypynw";
};
buildInputs = [ libX11 libXt ];
configurePhase = ''
make X-Configure name=linux
'';
buildInputs = stdenv.lib.optionals withGraphics [ libX11 libXt ];
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
@ -21,8 +26,8 @@ stdenv.mkDerivation rec {
meta = with stdenv.lib; {
description = ''A very high level general-purpose programming language'';
maintainers = with maintainers; [ vrthra ];
platforms = platforms.linux;
maintainers = with maintainers; [ vrthra yurrriq ];
platforms = with platforms; linux ++ darwin;
license = licenses.publicDomain;
homepage = https://www.cs.arizona.edu/icon/;
};