conky: add lua-imlib2 and lua-cairo support, add more options, rename old ones so that they would conform to a common standard, make the defaults for a "normal desktop user"

This commit is contained in:
Jan Malakhovski 2015-03-24 18:59:51 +00:00
parent eb22e54243
commit 8591b7b48c
2 changed files with 81 additions and 34 deletions

View File

@ -1,31 +1,59 @@
{ stdenv, fetchurl, pkgconfig { stdenv, fetchurl, pkgconfig
# dependencies # dependencies
, glib, ncurses , glib
# optional features without extra dependencies # optional features without extra dependencies
, mpdSupport ? true , 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
# optional features with extra dependencies # optional features with extra dependencies
, x11Support ? false, x11 ? null , x11Support ? true , x11 ? null
, xdamage ? false, libXdamage ? null , xdamageSupport ? x11Support, libXdamage ? null
, wireless ? false, wirelesstools ? null , imlib2Support ? x11Support, imlib2 ? null
, luaSupport ? false, lua5 ? null , luaSupport ? true , lua ? null
, rss ? false , luaImlib2Support ? luaSupport && imlib2Support
, weatherMetar ? false , luaCairoSupport ? luaSupport && x11Support, cairo ? null
, weatherXoap ? false , toluapp ? null
, curl ? null, libxml2 ? null
, alsaSupport ? true , alsaLib ? null
, wirelessSupport ? true , wirelesstools ? null
, curlSupport ? true , curl ? null
, rssSupport ? curlSupport
, weatherMetarSupport ? curlSupport
, weatherXoapSupport ? curlSupport
, libxml2 ? null
}: }:
assert luaSupport -> lua5 != null; #assert ncursesSupport -> ncurses != null;
assert wireless -> wirelesstools != null;
assert x11Support -> x11 != null;
assert xdamage -> x11Support && libXdamage != null;
assert rss -> curl != null && libxml2 != null; assert x11Support -> x11 != null;
assert weatherMetar -> curl != null; assert xdamageSupport -> x11Support && libXdamage != null;
assert weatherXoap -> curl != null && libxml2 != 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";
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;
with stdenv.lib; with stdenv.lib;
@ -39,30 +67,47 @@ stdenv.mkDerivation rec {
NIX_LDFLAGS = "-lgcc_s"; NIX_LDFLAGS = "-lgcc_s";
buildInputs = [ pkgconfig glib ncurses ] buildInputs = [ pkgconfig glib ]
++ optional luaSupport lua5 ++ [ ncurses ]
++ optional wireless wirelesstools #++ optional ncursesSupport ncurses
++ optional x11Support x11 ++ optional x11Support x11
++ optional xdamage libXdamage ++ optional xdamageSupport libXdamage
++ optional imlib2Support imlib2
++ optional luaSupport lua
++ optionals luaImlib2Support [ toluapp imlib2 ]
++ optionals luaCairoSupport [ toluapp cairo ]
++ optionals rss [ curl libxml2 ] ++ optional alsaSupport alsaLib
++ optional weatherMetar curl
++ optionals weatherXoap [ curl libxml2 ] ++ optional wirelessSupport wirelesstools
++ optional curlSupport curl
++ optional rssSupport libxml2
++ optional weatherXoapSupport libxml2
; ;
configureFlags = configureFlags =
let flag = state: flags: if state then map (x: "--enable-${x}") flags let flag = state: flags: if state then map (x: "--enable-${x}") flags
else map (x: "--disable-${x}") flags; else map (x: "--disable-${x}") flags;
in flag mpdSupport [ "mpd" ] in flag mpdSupport [ "mpd" ]
++ flag ibmSupport [ "ibm" ]
++ flag luaSupport [ "lua" ] #++ flag ncursesSupport [ "ncurses" ]
++ flag wireless [ "wlan" ] ++ flag x11Support [ "x11" "xft" "argb" "double-buffer" "own-window" ] # conky won't compile without --enable-own-window
++ flag x11Support [ "x11" "xft" "argb" "double-buffer" "own-window" ] # conky won't compile without --enable-own-window ++ flag xdamageSupport [ "xdamage" ]
++ flag xdamage [ "xdamage" ] ++ flag imlib2Support [ "imlib2" ]
++ flag luaSupport [ "lua" ]
++ flag luaImlib2Support [ "lua-imlib2" ]
++ flag luaCairoSupport [ "lua-cairo" ]
++ flag rss [ "rss" ] ++ flag alsaSupport [ "alsa" ]
++ flag weatherMetar [ "weather-metar" ]
++ flag weatherXoap [ "weather-xoap" ] ++ flag wirelessSupport [ "wlan" ]
++ flag curlSupport [ "curl" ]
++ flag rssSupport [ "rss" ]
++ flag weatherMetarSupport [ "weather-metar" ]
++ flag weatherXoapSupport [ "weather-xoap" ]
; ;
meta = { meta = {

View File

@ -8702,7 +8702,9 @@ let
cifs_utils = callPackage ../os-specific/linux/cifs-utils { }; cifs_utils = callPackage ../os-specific/linux/cifs-utils { };
conky = callPackage ../os-specific/linux/conky (config.conky or {}); conky = callPackage ../os-specific/linux/conky ({
lua = lua5_1; # conky can use 5.2, but toluapp can not
} // config.conky or {});
conntrack_tools = callPackage ../os-specific/linux/conntrack-tools { }; conntrack_tools = callPackage ../os-specific/linux/conntrack-tools { };