about summary refs log tree commit diff
path: root/nixpkgs/pkgs/os-specific/linux/conky/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/os-specific/linux/conky/default.nix')
-rw-r--r--nixpkgs/pkgs/os-specific/linux/conky/default.nix26
1 files changed, 17 insertions, 9 deletions
diff --git a/nixpkgs/pkgs/os-specific/linux/conky/default.nix b/nixpkgs/pkgs/os-specific/linux/conky/default.nix
index ab55839c3408..0818850f7549 100644
--- a/nixpkgs/pkgs/os-specific/linux/conky/default.nix
+++ b/nixpkgs/pkgs/os-specific/linux/conky/default.nix
@@ -16,13 +16,14 @@
 
 , ncursesSupport      ? true      , ncurses       ? null
 , x11Support          ? true      , freetype, xorg
+, waylandSupport      ? true      , pango, wayland, wayland-protocols, wayland-scanner
 , xdamageSupport      ? x11Support, libXdamage    ? null
 , doubleBufferSupport ? x11Support
 , imlib2Support       ? x11Support, imlib2        ? null
 
 , luaSupport          ? true      , lua           ? null
 , luaImlib2Support    ? luaSupport && imlib2Support
-, luaCairoSupport     ? luaSupport && x11Support, cairo ? null
+, luaCairoSupport     ? luaSupport && (x11Support || waylandSupport), cairo ? null
 , toluapp ? null
 
 , wirelessSupport     ? true      , wirelesstools ? null
@@ -76,13 +77,13 @@ stdenv.mkDerivation rec {
     hash = "sha256-L8YSbdk+qQl17L4IRajFD/AEWRXb2w7xH9sM9qPGrQo=";
   };
 
-  postPatch = ''
-    sed -i -e '/include.*CheckIncludeFile)/i include(CheckIncludeFiles)' \
-      cmake/ConkyPlatformChecks.cmake
-  '' + optionalString docsSupport ''
+  postPatch = optionalString docsSupport ''
     substituteInPlace cmake/Conky.cmake --replace "# set(RELEASE true)" "set(RELEASE true)"
 
     cp ${catch2}/include/catch2/catch.hpp tests/catch2/catch.hpp
+  '' + optionalString waylandSupport ''
+    substituteInPlace src/CMakeLists.txt \
+      --replace 'COMMAND ''${Wayland_SCANNER}' 'COMMAND wayland-scanner'
   '';
 
   env = {
@@ -91,16 +92,21 @@ stdenv.mkDerivation rec {
     NIX_LDFLAGS = "-lgcc_s";
   };
 
-  nativeBuildInputs = [ cmake pkg-config ];
-  buildInputs = [ glib libXinerama ]
+  nativeBuildInputs = [ cmake pkg-config ]
     ++ optionals docsSupport        [ docbook2x docbook_xsl docbook_xml_dtd_44 libxslt man less ]
+    ++ optional  waylandSupport     wayland-scanner
+    ++ optional  luaImlib2Support   toluapp
+    ++ optional  luaCairoSupport    toluapp
+    ;
+  buildInputs = [ glib libXinerama ]
     ++ optional  ncursesSupport     ncurses
     ++ optionals x11Support         [ freetype xorg.libICE xorg.libX11 xorg.libXext xorg.libXft xorg.libSM ]
+    ++ optionals waylandSupport     [ pango wayland wayland-protocols ]
     ++ optional  xdamageSupport     libXdamage
     ++ optional  imlib2Support      imlib2
     ++ optional  luaSupport         lua
-    ++ optionals luaImlib2Support   [ toluapp imlib2 ]
-    ++ optionals luaCairoSupport    [ toluapp cairo ]
+    ++ optional  luaImlib2Support   imlib2
+    ++ optional  luaCairoSupport    cairo
     ++ optional  wirelessSupport    wirelesstools
     ++ optional  curlSupport        curl
     ++ optional  rssSupport         libxml2
@@ -121,6 +127,7 @@ stdenv.mkDerivation rec {
     ++ optional (!ncursesSupport)   "-DBUILD_NCURSES=OFF"
     ++ optional rssSupport          "-DBUILD_RSS=ON"
     ++ optional (!x11Support)       "-DBUILD_X11=OFF"
+    ++ optional waylandSupport      "-DBUILD_WAYLAND=ON"
     ++ optional xdamageSupport      "-DBUILD_XDAMAGE=ON"
     ++ optional doubleBufferSupport "-DBUILD_XDBE=ON"
     ++ optional weatherMetarSupport "-DBUILD_WEATHER_METAR=ON"
@@ -141,6 +148,7 @@ stdenv.mkDerivation rec {
     homepage = "https://conky.cc";
     changelog = "https://github.com/brndnmtthws/conky/releases/tag/v${version}";
     description = "Advanced, highly configurable system monitor based on torsmo";
+    mainProgram = "conky";
     maintainers = [ maintainers.guibert ];
     license = licenses.gpl3Plus;
     platforms = platforms.linux;