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

146 lines
5.5 KiB
Nix
Raw Normal View History

2017-11-25 14:53:30 +00:00
{ stdenv, fetchFromGitHub, fetchpatch, pkgconfig, cmake
2014-03-14 22:39:56 +00:00
# dependencies
2016-07-12 00:12:32 +01:00
, glib, libXinerama
2014-03-14 22:39:56 +00:00
# optional features without extra dependencies
, mpdSupport ? true
, ibmSupport ? true # IBM/Lenovo notebooks
2014-03-14 22:39:56 +00:00
# optional features with extra dependencies
2015-12-04 16:15:44 +00:00
# ouch, this is ugly, but this gives the man page
, docsSupport ? true, docbook2x, libxslt ? null
, man ? null, less ? null
, docbook_xsl ? null , docbook_xml_dtd_44 ? null
2015-08-30 15:18:47 +01:00
, ncursesSupport ? true , ncurses ? null
, x11Support ? true , xlibsWrapper ? null
, xdamageSupport ? x11Support, libXdamage ? null
, doubleBufferSupport ? x11Support
, imlib2Support ? x11Support, imlib2 ? null
2015-08-30 15:18:47 +01:00
, luaSupport ? true , lua ? null
, luaImlib2Support ? luaSupport && imlib2Support
, luaCairoSupport ? luaSupport && x11Support, cairo ? null
, toluapp ? null
, wirelessSupport ? true , wirelesstools ? null
, nvidiaSupport ? false , libXNVCtrl ? null
, curlSupport ? true , curl ? null
, rssSupport ? curlSupport
, weatherMetarSupport ? curlSupport
, weatherXoapSupport ? curlSupport
, libxml2 ? null
2014-03-14 22:39:56 +00:00
}:
2015-12-04 16:15:44 +00:00
assert docsSupport -> docbook2x != null && libxslt != null
&& man != null && less != null
&& docbook_xsl != null && docbook_xml_dtd_44 != null;
2015-08-30 15:18:47 +01:00
assert ncursesSupport -> ncurses != null;
assert x11Support -> xlibsWrapper != 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 wirelessSupport -> wirelesstools != null;
2017-08-30 05:29:57 +01:00
assert nvidiaSupport -> libXNVCtrl != 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 {
2015-08-30 15:18:47 +01:00
name = "conky-${version}";
2017-03-13 17:18:42 +00:00
version = "1.10.6";
2015-08-30 15:18:47 +01:00
src = fetchFromGitHub {
owner = "brndnmtthws";
repo = "conky";
rev = "v${version}";
2017-03-13 17:18:42 +00:00
sha256 = "15j8h251v9jpdg6h6wn1vb45pkk806pf9s5n3rdrps9r185w8hn8";
};
2017-11-25 14:53:30 +00:00
patches = [
# Patch to fix compilation on gcc-7 from conky PR
# https://github.com/brndnmtthws/conky/pull/402
(fetchpatch {
name = "gcc7.patch";
url = "https://github.com/brndnmtthws/conky/commit/6140122b82d50acc333e5d2a813cc1933ecc6d21.patch";
sha256 = "1fblfj1w2kc0gshc2pq9lc1pxxsgmgh8byb1xs2v6amx15kj11k7";
})
];
postPatch = ''
sed -i -e '/include.*CheckIncludeFile)/i include(CheckIncludeFiles)' \
cmake/ConkyPlatformChecks.cmake
2015-12-04 16:15:44 +00:00
'' + optionalString docsSupport ''
# Drop examples, since they contain non-ASCII characters that break docbook2x :(
sed -i 's/ Example: .*$//' doc/config_settings.xml
2016-01-17 10:22:10 +00:00
substituteInPlace cmake/Conky.cmake --replace "#set(RELEASE true)" "set(RELEASE true)"
'';
NIX_LDFLAGS = "-lgcc_s";
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ glib cmake libXinerama ]
++ optionals docsSupport [ docbook2x docbook_xsl docbook_xml_dtd_44 libxslt man less ]
2015-08-30 15:18:47 +01:00
++ optional ncursesSupport ncurses
++ optional x11Support xlibsWrapper
++ optional xdamageSupport libXdamage
++ optional imlib2Support imlib2
++ optional luaSupport lua
++ optionals luaImlib2Support [ toluapp imlib2 ]
++ optionals luaCairoSupport [ toluapp cairo ]
++ optional wirelessSupport wirelesstools
++ optional curlSupport curl
++ optional rssSupport libxml2
++ optional weatherXoapSupport libxml2
2017-08-30 05:29:57 +01:00
++ optional nvidiaSupport libXNVCtrl
2014-03-14 22:39:56 +00:00
;
cmakeFlags = []
2015-12-04 16:15:44 +00:00
++ optional docsSupport "-DMAINTAINER_MODE=ON"
2015-08-30 15:18:47 +01:00
++ optional curlSupport "-DBUILD_CURL=ON"
++ optional (!ibmSupport) "-DBUILD_IBM=OFF"
++ optional imlib2Support "-DBUILD_IMLIB2=ON"
++ optional luaCairoSupport "-DBUILD_LUA_CAIRO=ON"
++ optional luaImlib2Support "-DBUILD_LUA_IMLIB2=ON"
++ optional (!mpdSupport) "-DBUILD_MPD=OFF"
++ optional (!ncursesSupport) "-DBUILD_NCURSES=OFF"
++ optional rssSupport "-DBUILD_RSS=ON"
++ optional (!x11Support) "-DBUILD_X11=OFF"
++ optional xdamageSupport "-DBUILD_XDAMAGE=ON"
++ optional doubleBufferSupport "-DBUILD_XDBE=ON"
2015-08-30 15:18:47 +01:00
++ optional weatherMetarSupport "-DBUILD_WEATHER_METAR=ON"
++ optional weatherXoapSupport "-DBUILD_WEATHER_XOAP=ON"
++ optional wirelessSupport "-DBUILD_WLAN=ON"
2017-08-30 05:29:57 +01:00
++ optional nvidiaSupport "-DBUILD_NVIDIA=ON"
2015-08-30 15:18:47 +01:00
;
2017-12-05 11:03:31 +00:00
# `make -f src/CMakeFiles/conky.dir/build.make src/CMakeFiles/conky.dir/conky.cc.o`:
# src/conky.cc:137:23: fatal error: defconfig.h: No such file or directory
enableParallelBuilding = false;
2015-08-30 15:18:47 +01:00
meta = with stdenv.lib; {
homepage = http://conky.sourceforge.net/;
description = "Advanced, highly configurable system monitor based on torsmo";
2015-08-30 15:18:47 +01:00
maintainers = [ maintainers.guibert ];
license = licenses.gpl3Plus;
2015-12-29 12:15:34 +00:00
platforms = platforms.linux;
};
}