nixpkgs/pkgs/os-specific/linux/conky/default.nix
aszlig 880eba6481
conky: Fix building with CMake 3.4.0.
Regression introduced by 050bebb8c4.

It's essentially an upgrade to CMake 3.4.0, which breaks the build
because it seems that in CMake 3.3.x, the check_include_files() command
was implicitly included (haven't found out about why exactly).

So we're now just adding an import for CheckIncludeFiles in addition to
CheckIncludeFile, so that we have both commands (the plural and the
singular variant) available.

My original goal was to use brndnmtthws/conky@3a574ba, but this breaks
the build as well, because check_include_files doesn't accept additional
compile flags.

However, this is needed if building with wireless support, because
including iwlib.h needs -D_GNU_SOURCE set and check_include_files
doesn't do that.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-11-17 05:51:27 +01:00

107 lines
3.7 KiB
Nix

{ stdenv, fetchFromGitHub, pkgconfig, cmake
# dependencies
, glib
# optional features without extra dependencies
, mpdSupport ? true
, ibmSupport ? true # IBM/Lenovo notebooks
# optional features with extra dependencies
, ncursesSupport ? true , ncurses ? null
, x11Support ? true , xlibsWrapper ? null
, xdamageSupport ? x11Support, libXdamage ? null
, imlib2Support ? x11Support, imlib2 ? null
, luaSupport ? true , lua ? null
, luaImlib2Support ? luaSupport && imlib2Support
, luaCairoSupport ? luaSupport && x11Support, cairo ? null
, toluapp ? null
, wirelessSupport ? true , wirelesstools ? null
, curlSupport ? true , curl ? null
, rssSupport ? curlSupport
, weatherMetarSupport ? curlSupport
, weatherXoapSupport ? curlSupport
, libxml2 ? null
}:
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";
assert wirelessSupport -> wirelesstools != null;
assert curlSupport -> curl != null;
assert rssSupport -> curlSupport && libxml2 != null;
assert weatherMetarSupport -> curlSupport;
assert weatherXoapSupport -> curlSupport && libxml2 != null;
with stdenv.lib;
stdenv.mkDerivation rec {
name = "conky-${version}";
version = "1.10.0";
src = fetchFromGitHub {
owner = "brndnmtthws";
repo = "conky";
rev = "v${version}";
sha256 = "00vyrf72l54j3majqmn6vykqvvb15vygsaby644nsb5vpma6b1cn";
};
postPatch = ''
sed -i -e '/include.*CheckIncludeFile)/i include(CheckIncludeFiles)' \
cmake/ConkyPlatformChecks.cmake
'';
NIX_LDFLAGS = "-lgcc_s";
buildInputs = [ pkgconfig glib cmake ]
++ 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
;
cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ]
++ 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 weatherMetarSupport "-DBUILD_WEATHER_METAR=ON"
++ optional weatherXoapSupport "-DBUILD_WEATHER_XOAP=ON"
++ optional wirelessSupport "-DBUILD_WLAN=ON"
;
meta = with stdenv.lib; {
homepage = http://conky.sourceforge.net/;
description = "Advanced, highly configurable system monitor based on torsmo";
maintainers = [ maintainers.guibert ];
license = licenses.gpl3Plus;
};
}