nixpkgs/pkgs/os-specific/linux/conky/default.nix

120 lines
4.0 KiB
Nix
Raw Normal View History

2014-03-14 22:39:56 +00:00
{ stdenv, fetchurl, pkgconfig
# dependencies
, glib
2014-03-14 22:39:56 +00:00
# optional features without extra dependencies
, mpdSupport ? true
, ibmSupport ? true # IBM/Lenovo notebooks
# This should be optional, but it is not due to a bug in conky
# Please, try to make it optional again on update
, ncurses
#, ncursesSupport ? true , ncurses ? null
2014-03-14 22:39:56 +00:00
# optional features with extra dependencies
, x11Support ? true , x11 ? null
, xdamageSupport ? x11Support, libXdamage ? null
, imlib2Support ? x11Support, imlib2 ? null
, luaSupport ? true , lua ? null
, luaImlib2Support ? luaSupport && imlib2Support
, luaCairoSupport ? luaSupport && x11Support, cairo ? null
, toluapp ? null
, alsaSupport ? true , alsaLib ? null
, wirelessSupport ? true , wirelesstools ? null
, curlSupport ? true , curl ? null
, rssSupport ? curlSupport
, weatherMetarSupport ? curlSupport
, weatherXoapSupport ? curlSupport
, libxml2 ? null
2014-03-14 22:39:56 +00:00
}:
#assert ncursesSupport -> ncurses != null;
assert x11Support -> x11 != null;
assert xdamageSupport -> x11Support && libXdamage != null;
assert imlib2Support -> x11Support && imlib2 != null;
assert luaSupport -> lua != null;
assert luaImlib2Support -> luaSupport && imlib2Support
&& toluapp != null;
assert luaCairoSupport -> luaSupport && toluapp != null
&& cairo != null;
assert luaCairoSupport || luaImlib2Support
-> lua.luaversion == "5.1";
2014-03-14 22:39:56 +00:00
assert alsaSupport -> alsaLib != null;
assert wirelessSupport -> wirelesstools != null;
assert curlSupport -> curl != null;
assert rssSupport -> curlSupport && libxml2 != null;
assert weatherMetarSupport -> curlSupport;
assert weatherXoapSupport -> curlSupport && libxml2 != null;
2014-03-14 22:39:56 +00:00
with stdenv.lib;
stdenv.mkDerivation rec {
name = "conky-1.9.0";
src = fetchurl {
url = "mirror://sourceforge/conky/${name}.tar.bz2";
sha256 = "0vxvjmi3cdvnp994sv5zcdyncfn0mlxa71p2wm9zpyrmy58bbwds";
};
NIX_LDFLAGS = "-lgcc_s";
buildInputs = [ pkgconfig glib ]
++ [ ncurses ]
#++ optional ncursesSupport ncurses
++ optional x11Support x11
++ optional xdamageSupport libXdamage
++ optional imlib2Support imlib2
++ optional luaSupport lua
++ optionals luaImlib2Support [ toluapp imlib2 ]
++ optionals luaCairoSupport [ toluapp cairo ]
++ optional alsaSupport alsaLib
2014-03-14 22:39:56 +00:00
++ optional wirelessSupport wirelesstools
++ optional curlSupport curl
++ optional rssSupport libxml2
++ optional weatherXoapSupport libxml2
2014-03-14 22:39:56 +00:00
;
configureFlags =
2014-03-14 22:39:56 +00:00
let flag = state: flags: if state then map (x: "--enable-${x}") flags
else map (x: "--disable-${x}") flags;
in flag mpdSupport [ "mpd" ]
++ flag ibmSupport [ "ibm" ]
#++ flag ncursesSupport [ "ncurses" ]
++ flag x11Support [ "x11" "xft" "argb" "double-buffer" "own-window" ] # conky won't compile without --enable-own-window
++ flag xdamageSupport [ "xdamage" ]
++ flag imlib2Support [ "imlib2" ]
++ flag luaSupport [ "lua" ]
++ flag luaImlib2Support [ "lua-imlib2" ]
++ flag luaCairoSupport [ "lua-cairo" ]
++ flag alsaSupport [ "alsa" ]
2014-03-14 22:39:56 +00:00
++ flag wirelessSupport [ "wlan" ]
2014-03-14 22:39:56 +00:00
++ flag curlSupport [ "curl" ]
++ flag rssSupport [ "rss" ]
++ flag weatherMetarSupport [ "weather-metar" ]
++ flag weatherXoapSupport [ "weather-xoap" ]
2014-03-14 22:39:56 +00:00
;
meta = {
homepage = http://conky.sourceforge.net/;
description = "Advanced, highly configurable system monitor based on torsmo";
maintainers = [ stdenv.lib.maintainers.guibert ];
license = stdenv.lib.licenses.gpl3Plus;
};
}