conky: 1.19.6 -> 1.22.1, fix cross and docs, and modernize (#400497)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
pkg-config,
|
||||
cmake,
|
||||
|
||||
@@ -10,6 +11,7 @@
|
||||
glib,
|
||||
libXinerama,
|
||||
catch2,
|
||||
gperf,
|
||||
|
||||
# lib.optional features without extra dependencies
|
||||
mpdSupport ? true,
|
||||
@@ -17,14 +19,10 @@
|
||||
|
||||
# lib.optional features with extra dependencies
|
||||
|
||||
# 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,
|
||||
buildPackages,
|
||||
pandoc,
|
||||
python3,
|
||||
|
||||
ncursesSupport ? true,
|
||||
ncurses ? null,
|
||||
@@ -59,22 +57,16 @@
|
||||
curlSupport ? true,
|
||||
curl ? null,
|
||||
rssSupport ? curlSupport,
|
||||
weatherMetarSupport ? curlSupport,
|
||||
weatherXoapSupport ? curlSupport,
|
||||
journalSupport ? true,
|
||||
systemd ? null,
|
||||
libxml2 ? null,
|
||||
|
||||
extrasSupport ? true,
|
||||
|
||||
versionCheckHook,
|
||||
}:
|
||||
|
||||
assert
|
||||
docsSupport
|
||||
->
|
||||
docbook2x != null
|
||||
&& libxslt != null
|
||||
&& man != null
|
||||
&& less != null
|
||||
&& docbook_xsl != null
|
||||
&& docbook_xml_dtd_44 != null;
|
||||
assert docsSupport -> pandoc != null && python3 != null;
|
||||
|
||||
assert ncursesSupport -> ncurses != null;
|
||||
|
||||
@@ -91,54 +83,55 @@ assert pulseSupport -> libpulseaudio != null;
|
||||
|
||||
assert curlSupport -> curl != null;
|
||||
assert rssSupport -> curlSupport && libxml2 != null;
|
||||
assert weatherMetarSupport -> curlSupport;
|
||||
assert weatherXoapSupport -> curlSupport && libxml2 != null;
|
||||
assert journalSupport -> systemd != null;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
assert extrasSupport -> python3 != null;
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "conky";
|
||||
version = "1.19.6";
|
||||
version = "1.22.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "brndnmtthws";
|
||||
repo = "conky";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-L8YSbdk+qQl17L4IRajFD/AEWRXb2w7xH9sM9qPGrQo=";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-tEJQWZBaiX/bONPZEuGcvbGidktcvxUZtLvcGjz71Lk=";
|
||||
};
|
||||
|
||||
postPatch =
|
||||
lib.optionalString docsSupport ''
|
||||
substituteInPlace cmake/Conky.cmake --replace "# set(RELEASE true)" "set(RELEASE true)"
|
||||
patches = [
|
||||
# Upstream patch to install extra syntax files, remove after next release
|
||||
(fetchpatch {
|
||||
name = "install-extra-syntax-files";
|
||||
url = "https://github.com/brndnmtthws/conky/commit/c67d8c27d1d091968a98ee49b313935eb7ea67fd.patch";
|
||||
hash = "sha256-NaQlQm+7iJWtdKYErTak5CPLNUBlsWb7sECNg0i3fWY=";
|
||||
})
|
||||
];
|
||||
|
||||
cp ${catch2}/include/catch2/catch.hpp tests/catch2/catch.hpp
|
||||
''
|
||||
+ lib.optionalString waylandSupport ''
|
||||
substituteInPlace src/CMakeLists.txt \
|
||||
--replace 'COMMAND ''${Wayland_SCANNER}' 'COMMAND wayland-scanner'
|
||||
'';
|
||||
# pkg-config doesn't detect wayland-scanner in cross-compilation for some reason
|
||||
postPatch = ''
|
||||
substituteInPlace cmake/ConkyPlatformChecks.cmake \
|
||||
--replace-fail "pkg_get_variable(Wayland_SCANNER wayland-scanner wayland_scanner)" "set(Wayland_SCANNER ${lib.getExe buildPackages.wayland-scanner})"
|
||||
'';
|
||||
|
||||
env = {
|
||||
# For some reason -Werror is on by default, causing the project to fail compilation.
|
||||
NIX_CFLAGS_COMPILE = "-Wno-error";
|
||||
NIX_LDFLAGS = "-lgcc_s";
|
||||
};
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs =
|
||||
[
|
||||
cmake
|
||||
pkg-config
|
||||
gperf
|
||||
]
|
||||
++ lib.optionals docsSupport [
|
||||
docbook2x
|
||||
docbook_xsl
|
||||
docbook_xml_dtd_44
|
||||
libxslt
|
||||
man
|
||||
less
|
||||
]
|
||||
++ lib.optional waylandSupport wayland-scanner
|
||||
++ lib.optional docsSupport pandoc
|
||||
++ lib.optional (docsSupport || extrasSupport) (
|
||||
# Use buildPackages to work around https://github.com/NixOS/nixpkgs/issues/305858
|
||||
buildPackages.python3.withPackages (ps: [
|
||||
ps.jinja2
|
||||
ps.pyyaml
|
||||
])
|
||||
)
|
||||
++ lib.optional luaImlib2Support toluapp
|
||||
++ lib.optional luaCairoSupport toluapp;
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
glib
|
||||
@@ -166,46 +159,48 @@ stdenv.mkDerivation rec {
|
||||
++ lib.optional wirelessSupport wirelesstools
|
||||
++ lib.optional curlSupport curl
|
||||
++ lib.optional rssSupport libxml2
|
||||
++ lib.optional weatherXoapSupport libxml2
|
||||
++ lib.optional nvidiaSupport libXNVCtrl
|
||||
++ lib.optional pulseSupport libpulseaudio
|
||||
++ lib.optional journalSupport systemd;
|
||||
|
||||
cmakeFlags =
|
||||
[ ]
|
||||
++ lib.optional docsSupport "-DMAINTAINER_MODE=ON"
|
||||
++ lib.optional curlSupport "-DBUILD_CURL=ON"
|
||||
++ lib.optional (!ibmSupport) "-DBUILD_IBM=OFF"
|
||||
++ lib.optional imlib2Support "-DBUILD_IMLIB2=ON"
|
||||
++ lib.optional luaCairoSupport "-DBUILD_LUA_CAIRO=ON"
|
||||
++ lib.optional luaImlib2Support "-DBUILD_LUA_IMLIB2=ON"
|
||||
++ lib.optional (!mpdSupport) "-DBUILD_MPD=OFF"
|
||||
++ lib.optional (!ncursesSupport) "-DBUILD_NCURSES=OFF"
|
||||
++ lib.optional rssSupport "-DBUILD_RSS=ON"
|
||||
++ lib.optional (!x11Support) "-DBUILD_X11=OFF"
|
||||
++ lib.optional waylandSupport "-DBUILD_WAYLAND=ON"
|
||||
++ lib.optional xdamageSupport "-DBUILD_XDAMAGE=ON"
|
||||
++ lib.optional doubleBufferSupport "-DBUILD_XDBE=ON"
|
||||
++ lib.optional weatherMetarSupport "-DBUILD_WEATHER_METAR=ON"
|
||||
++ lib.optional weatherXoapSupport "-DBUILD_WEATHER_XOAP=ON"
|
||||
++ lib.optional wirelessSupport "-DBUILD_WLAN=ON"
|
||||
++ lib.optional nvidiaSupport "-DBUILD_NVIDIA=ON"
|
||||
++ lib.optional pulseSupport "-DBUILD_PULSEAUDIO=ON"
|
||||
++ lib.optional journalSupport "-DBUILD_JOURNAL=ON";
|
||||
|
||||
# `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;
|
||||
cmakeFlags = [
|
||||
(lib.cmakeBool "REPRODUCIBLE_BUILD" true)
|
||||
(lib.cmakeBool "RELEASE" true)
|
||||
(lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doCheck)
|
||||
(lib.cmakeBool "BUILD_EXTRAS" extrasSupport)
|
||||
(lib.cmakeBool "BUILD_DOCS" docsSupport)
|
||||
(lib.cmakeBool "BUILD_CURL" curlSupport)
|
||||
(lib.cmakeBool "BUILD_IBM" ibmSupport)
|
||||
(lib.cmakeBool "BUILD_IMLIB2" imlib2Support)
|
||||
(lib.cmakeBool "BUILD_LUA_CAIRO" luaCairoSupport)
|
||||
(lib.cmakeBool "BUILD_LUA_IMLIB2" luaImlib2Support)
|
||||
(lib.cmakeBool "BUILD_MPD" mpdSupport)
|
||||
(lib.cmakeBool "BUILD_NCURSES" ncursesSupport)
|
||||
(lib.cmakeBool "BUILD_RSS" rssSupport)
|
||||
(lib.cmakeBool "BUILD_X11" x11Support)
|
||||
(lib.cmakeBool "BUILD_WAYLAND" waylandSupport)
|
||||
(lib.cmakeBool "BUILD_XDAMAGE" xdamageSupport)
|
||||
(lib.cmakeBool "BUILD_XDBE" doubleBufferSupport)
|
||||
(lib.cmakeBool "BUILD_WLAN" wirelessSupport)
|
||||
(lib.cmakeBool "BUILD_NVIDIA" nvidiaSupport)
|
||||
(lib.cmakeBool "BUILD_PULSEAUDIO" pulseSupport)
|
||||
(lib.cmakeBool "BUILD_JOURNAL" journalSupport)
|
||||
(lib.cmakeFeature "CMAKE_INSTALL_DATAROOTDIR" "${placeholder "out"}/share")
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
meta = with lib; {
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
versionCheckProgramArg = "--version";
|
||||
doInstallCheck = true;
|
||||
|
||||
meta = {
|
||||
homepage = "https://conky.cc";
|
||||
changelog = "https://github.com/brndnmtthws/conky/releases/tag/v${version}";
|
||||
changelog = "https://github.com/brndnmtthws/conky/releases/tag/${finalAttrs.src.tag}";
|
||||
description = "Advanced, highly configurable system monitor based on torsmo";
|
||||
mainProgram = "conky";
|
||||
maintainers = [ maintainers.guibert ];
|
||||
license = licenses.gpl3Plus;
|
||||
platforms = platforms.linux;
|
||||
maintainers = [ lib.maintainers.guibert ];
|
||||
license = lib.licenses.gpl3Plus;
|
||||
platforms = lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user