2021-01-19 06:50:56 +00:00
|
|
|
{ config, lib, stdenv, fetchFromGitHub, pkg-config, cmake
|
2014-03-14 22:39:56 +00:00
|
|
|
|
|
|
|
# dependencies
|
2021-10-14 14:16:18 +01:00
|
|
|
, glib, libXinerama, catch2
|
2014-03-14 22:39:56 +00:00
|
|
|
|
|
|
|
# optional features without extra dependencies
|
2015-03-24 18:59:51 +00:00
|
|
|
, 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
|
2022-10-09 10:04:52 +01:00
|
|
|
, x11Support ? true , freetype, xorg
|
2015-03-24 18:59:51 +00:00
|
|
|
, xdamageSupport ? x11Support, libXdamage ? null
|
2016-06-26 13:35:34 +01:00
|
|
|
, doubleBufferSupport ? x11Support
|
2015-03-24 18:59:51 +00:00
|
|
|
, imlib2Support ? x11Support, imlib2 ? null
|
|
|
|
|
2015-08-30 15:18:47 +01:00
|
|
|
, luaSupport ? true , lua ? null
|
2015-03-24 18:59:51 +00:00
|
|
|
, luaImlib2Support ? luaSupport && imlib2Support
|
|
|
|
, luaCairoSupport ? luaSupport && x11Support, cairo ? null
|
|
|
|
, toluapp ? null
|
|
|
|
|
|
|
|
, wirelessSupport ? true , wirelesstools ? null
|
2017-09-01 16:35:17 +01:00
|
|
|
, nvidiaSupport ? false , libXNVCtrl ? null
|
2019-02-03 15:33:12 +00:00
|
|
|
, pulseSupport ? config.pulseaudio or false, libpulseaudio ? null
|
2015-03-24 18:59:51 +00:00
|
|
|
|
|
|
|
, curlSupport ? true , curl ? null
|
|
|
|
, rssSupport ? curlSupport
|
|
|
|
, weatherMetarSupport ? curlSupport
|
|
|
|
, weatherXoapSupport ? curlSupport
|
2019-01-27 03:12:41 +00:00
|
|
|
, journalSupport ? true, systemd ? null
|
2015-03-24 18:59:51 +00:00
|
|
|
, 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;
|
2015-03-24 18:59:51 +00:00
|
|
|
|
|
|
|
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
|
2019-01-26 03:57:53 +00:00
|
|
|
-> lua.luaversion == "5.3";
|
2014-03-14 22:39:56 +00:00
|
|
|
|
2015-03-24 18:59:51 +00:00
|
|
|
assert wirelessSupport -> wirelesstools != null;
|
2017-08-30 05:29:57 +01:00
|
|
|
assert nvidiaSupport -> libXNVCtrl != null;
|
2018-03-05 20:21:33 +00:00
|
|
|
assert pulseSupport -> libpulseaudio != null;
|
2015-03-24 18:59:51 +00:00
|
|
|
|
|
|
|
assert curlSupport -> curl != null;
|
|
|
|
assert rssSupport -> curlSupport && libxml2 != null;
|
|
|
|
assert weatherMetarSupport -> curlSupport;
|
|
|
|
assert weatherXoapSupport -> curlSupport && libxml2 != null;
|
2019-01-27 03:12:41 +00:00
|
|
|
assert journalSupport -> systemd != null;
|
2014-03-14 22:39:56 +00:00
|
|
|
|
2021-01-15 14:45:37 +00:00
|
|
|
with lib;
|
2010-05-27 20:33:58 +01:00
|
|
|
|
2012-01-09 23:44:44 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "conky";
|
2022-09-20 07:36:05 +01:00
|
|
|
version = "1.13.1";
|
2015-08-30 15:18:47 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "brndnmtthws";
|
|
|
|
repo = "conky";
|
|
|
|
rev = "v${version}";
|
2022-09-20 07:36:05 +01:00
|
|
|
sha256 = "sha256-3eCRzjfHGFiKuxmRHvnzqAg/+ApUKnHhsumWnio/Qxg=";
|
2010-05-27 20:33:58 +01:00
|
|
|
};
|
|
|
|
|
2015-11-17 04:28:26 +00:00
|
|
|
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
|
|
|
|
|
2019-01-26 03:57:53 +00:00
|
|
|
substituteInPlace cmake/Conky.cmake --replace "# set(RELEASE true)" "set(RELEASE true)"
|
2021-10-14 14:16:18 +01:00
|
|
|
|
|
|
|
cp ${catch2}/include/catch2/catch.hpp tests/catch2/catch.hpp
|
2015-11-17 04:28:26 +00:00
|
|
|
'';
|
|
|
|
|
2014-07-14 08:33:06 +01:00
|
|
|
NIX_LDFLAGS = "-lgcc_s";
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2018-01-28 01:35:19 +00:00
|
|
|
buildInputs = [ glib libXinerama ]
|
2017-10-07 12:07:52 +01:00
|
|
|
++ optionals docsSupport [ docbook2x docbook_xsl docbook_xml_dtd_44 libxslt man less ]
|
2015-08-30 15:18:47 +01:00
|
|
|
++ optional ncursesSupport ncurses
|
2022-10-09 10:04:52 +01:00
|
|
|
++ optionals x11Support [ freetype xorg.libICE xorg.libX11 xorg.libXext xorg.libXft xorg.libSM ]
|
2015-03-24 18:59:51 +00:00
|
|
|
++ 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
|
2018-03-05 20:21:33 +00:00
|
|
|
++ optional pulseSupport libpulseaudio
|
2019-01-27 03:12:41 +00:00
|
|
|
++ optional journalSupport systemd
|
2014-03-14 22:39:56 +00:00
|
|
|
;
|
2012-09-10 22:34:44 +01:00
|
|
|
|
2016-08-25 22:11:27 +01: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"
|
2016-06-26 13:35:34 +01:00
|
|
|
++ 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"
|
2018-03-05 20:21:33 +00:00
|
|
|
++ optional pulseSupport "-DBUILD_PULSEAUDIO=ON"
|
2019-01-27 03:12:41 +00:00
|
|
|
++ optional journalSupport "-DBUILD_JOURNAL=ON"
|
2015-08-30 15:18:47 +01:00
|
|
|
;
|
2012-01-09 23:44:44 +00: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;
|
|
|
|
|
2021-10-14 14:16:18 +01:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://conky.sourceforge.net/";
|
2014-08-24 15:21:08 +01:00
|
|
|
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;
|
2010-05-27 20:33:58 +01:00
|
|
|
};
|
|
|
|
}
|