2020-10-23 15:41:18 +01:00
|
|
|
{ lib, stdenv, cmake, extra-cmake-modules, plasma-framework, kwindowsystem, redshift, fetchFromGitHub, fetchpatch, }:
|
2017-02-05 23:13:06 +00:00
|
|
|
|
2017-07-02 09:25:19 +01:00
|
|
|
let version = "1.0.18"; in
|
2017-02-05 23:13:06 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "redshift-plasma-applet";
|
|
|
|
inherit version;
|
2017-02-05 23:13:06 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kotelnik";
|
|
|
|
repo = "plasma-applet-redshift-control";
|
|
|
|
rev = "v${version}";
|
2017-07-02 09:25:19 +01:00
|
|
|
sha256 = "122nnbafa596rxdxlfshxk45lzch8c9342bzj7kzrsjkjg0xr9pq";
|
2017-02-05 23:13:06 +00:00
|
|
|
};
|
|
|
|
|
2020-10-23 15:41:18 +01:00
|
|
|
patches = [
|
|
|
|
# This patch fetches from out-of-source repo because the GitHub copy is frozen,
|
|
|
|
# the active fork is now on invent.kde.org. Remove this patch when a new version is released and src is updated
|
|
|
|
# Redshift version >= 1.12 requires the -P option to clear the existing effects before applying shading.
|
|
|
|
# Without it scrolling makes the screen gets darker and darker until it is impossible to see anything.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://invent.kde.org/plasma/plasma-redshift-control/-/commit/898c3a4cfc6c317915f1e664078d8606497c4049.patch";
|
|
|
|
sha256 = "0b6pa3fcj698mgqnc85jbbmcl3qpf418mh06qgsd3c4v237my0nv";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2017-02-05 23:13:06 +00:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace package/contents/ui/main.qml \
|
|
|
|
--replace "redshiftCommand: 'redshift'" \
|
|
|
|
"redshiftCommand: '${redshift}/bin/redshift'" \
|
|
|
|
--replace "redshiftOneTimeCommand: 'redshift -O " \
|
|
|
|
"redshiftOneTimeCommand: '${redshift}/bin/redshift -O "
|
|
|
|
|
|
|
|
substituteInPlace package/contents/ui/config/ConfigAdvanced.qml \
|
|
|
|
--replace "'redshift -V'" \
|
|
|
|
"'${redshift}/bin/redshift -V'"
|
|
|
|
'';
|
|
|
|
|
2017-07-02 09:25:19 +01:00
|
|
|
nativeBuildInputs = [
|
2017-02-05 23:13:06 +00:00
|
|
|
cmake
|
2017-07-02 09:25:19 +01:00
|
|
|
extra-cmake-modules
|
2017-02-05 23:13:06 +00:00
|
|
|
];
|
|
|
|
|
2017-08-29 08:30:38 +01:00
|
|
|
buildInputs = [
|
|
|
|
plasma-framework
|
|
|
|
kwindowsystem
|
|
|
|
];
|
2017-02-05 23:13:06 +00:00
|
|
|
|
2021-01-12 11:50:23 +00:00
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-02-05 23:13:06 +00:00
|
|
|
description = "KDE Plasma 5 widget for controlling Redshift";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/kotelnik/plasma-applet-redshift-control";
|
2017-02-05 23:13:06 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
2017-07-02 09:25:19 +01:00
|
|
|
maintainers = with maintainers; [ benley zraexy ];
|
2017-02-05 23:13:06 +00:00
|
|
|
};
|
|
|
|
}
|