diff options
author | Christoph Hrdinka <c.github@hrdinka.at> | 2014-03-14 23:39:56 +0100 |
---|---|---|
committer | Christoph Hrdinka <c.github@hrdinka.at> | 2014-03-16 12:30:15 +0100 |
commit | 26d5d506c968e4a06c5b37bdd154aa8525f2d77e (patch) | |
tree | 8ff82e0bd524a837fae0049726f7f16012b66405 /pkgs/os-specific/linux/conky | |
parent | b57ee8c33104523cd64426dd77770f0adc9731b3 (diff) | |
download | nixlib-26d5d506c968e4a06c5b37bdd154aa8525f2d77e.tar nixlib-26d5d506c968e4a06c5b37bdd154aa8525f2d77e.tar.gz nixlib-26d5d506c968e4a06c5b37bdd154aa8525f2d77e.tar.bz2 nixlib-26d5d506c968e4a06c5b37bdd154aa8525f2d77e.tar.lz nixlib-26d5d506c968e4a06c5b37bdd154aa8525f2d77e.tar.xz nixlib-26d5d506c968e4a06c5b37bdd154aa8525f2d77e.tar.zst nixlib-26d5d506c968e4a06c5b37bdd154aa8525f2d77e.zip |
conky: add config options
Diffstat (limited to 'pkgs/os-specific/linux/conky')
-rw-r--r-- | pkgs/os-specific/linux/conky/default.nix | 62 | ||||
-rw-r--r-- | pkgs/os-specific/linux/conky/stdbool.patch | 12 |
2 files changed, 54 insertions, 20 deletions
diff --git a/pkgs/os-specific/linux/conky/default.nix b/pkgs/os-specific/linux/conky/default.nix index 086b792b4cd4..3e95daba29e3 100644 --- a/pkgs/os-specific/linux/conky/default.nix +++ b/pkgs/os-specific/linux/conky/default.nix @@ -1,5 +1,33 @@ -{ stdenv, fetchurl, pkgconfig, libxml2, curl, wirelesstools, glib, openssl -, ncurses }: +{ stdenv, fetchurl, pkgconfig + +# dependencies +, glib, ncurses + +# optional features without extra dependencies +, mpdSupport ? true + +# optional features with extra dependencies +, x11Support ? false, x11 ? null +, xdamage ? false, libXdamage ? null +, wireless ? false, wirelesstools ? null +, luaSupport ? false, lua5 ? null + +, rss ? false +, weatherMetar ? false +, weatherXoap ? false +, curl ? null, libxml2 ? null +}: + +assert luaSupport -> lua5 != null; +assert wireless -> wirelesstools != null; +assert x11Support -> x11 != null; +assert xdamage -> x11Support && libXdamage != null; + +assert rss -> curl != null && libxml2 != null; +assert weatherMetar -> curl != null; +assert weatherXoap -> curl != null && libxml2 != null; + +with stdenv.lib; stdenv.mkDerivation rec { name = "conky-1.9.0"; @@ -9,17 +37,35 @@ stdenv.mkDerivation rec { sha256 = "0vxvjmi3cdvnp994sv5zcdyncfn0mlxa71p2wm9zpyrmy58bbwds"; }; - patches = [ ./stdbool.patch ]; + buildInputs = [ pkgconfig glib ncurses ] + ++ optional luaSupport lua5 + ++ optional wireless wirelesstools + ++ optional x11Support x11 + ++ optional xdamage libXdamage + + ++ optionals rss [ curl libxml2 ] + ++ optional weatherMetar curl + ++ optionals weatherXoap [ curl libxml2 ] + ; - buildInputs = [ pkgconfig libxml2 curl wirelesstools glib openssl ncurses ]; configureFlags = - (map (x: "--disable-${x}") [ "x11" "xdamage" "own-window" "xft" "lua" ]) - ++ (map (x: "--enable-${x}") [ "mpd" "double-buffer" "wlan" "rss" - "weather-metar" "weather-xoap" ]); + let flag = state: flags: if state then map (x: "--enable-${x}") flags + else map (x: "--disable-${x}") flags; + in flag mpdSupport [ "mpd" ] + + ++ flag luaSupport [ "lua" ] + ++ flag wireless [ "wlan" ] + ++ flag x11Support [ "x11" "xft" "argb" "double-buffer" "own-window" ] # conky won't compile without --enable-own-window + ++ flag xdamage [ "xdamage" ] + + ++ flag rss [ "rss" ] + ++ flag weatherMetar [ "weather-metar" ] + ++ flag weatherXoap [ "weather-xoap" ] + ; meta = { homepage = http://conky.sourceforge.net/; - description = "Conky is an advanced, highly configurable system monitor complied without X based on torsmo"; + description = "Conky is an advanced, highly configurable system monitor based on torsmo"; maintainers = [ stdenv.lib.maintainers.guibert ]; license = stdenv.lib.licenses.gpl3Plus; }; diff --git a/pkgs/os-specific/linux/conky/stdbool.patch b/pkgs/os-specific/linux/conky/stdbool.patch deleted file mode 100644 index 3f0b714a1f0c..000000000000 --- a/pkgs/os-specific/linux/conky/stdbool.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/conky.c b/src/conky.c -index 5848b61..69a3d45 100644 ---- a/src/conky.c -+++ b/src/conky.c -@@ -34,6 +34,7 @@ - #include "common.h" - #include "timed_thread.h" - #include <stdarg.h> -+#include <stdbool.h> - #include <math.h> - #include <time.h> - #include <locale.h> |