2021-02-13 14:23:35 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
|
|
|
, intltool
|
|
|
|
, libxml2
|
|
|
|
, pciutils
|
|
|
|
, pkg-config
|
|
|
|
, gtk2
|
|
|
|
, ddccontrol-db
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ddccontrol";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "0.6.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ddccontrol";
|
|
|
|
repo = "ddccontrol";
|
2022-02-10 20:34:41 +00:00
|
|
|
rev = version;
|
2022-11-21 17:40:18 +00:00
|
|
|
sha256 = "sha256-En2e0FDKLpMjuxa2aXuvI6h7d+D1D5x1dDg96924/qM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
intltool
|
|
|
|
pkg-config
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libxml2
|
|
|
|
pciutils
|
|
|
|
gtk2
|
|
|
|
ddccontrol-db
|
|
|
|
];
|
|
|
|
|
2021-07-14 22:03:04 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
prePatch = ''
|
2022-02-10 20:34:41 +00:00
|
|
|
substituteInPlace configure.ac \
|
|
|
|
--replace \
|
|
|
|
"\$""{datadir}/ddccontrol-db" \
|
|
|
|
"${ddccontrol-db}/share/ddccontrol-db"
|
|
|
|
|
|
|
|
substituteInPlace src/ddcpci/Makefile.am \
|
|
|
|
--replace "chmod 4711" "chmod 0711"
|
2022-11-21 17:40:18 +00:00
|
|
|
'' + lib.optionalString (lib.versionAtLeast "0.6.1" version) ''
|
2022-02-10 20:34:41 +00:00
|
|
|
# Upstream PR: https://github.com/ddccontrol/ddccontrol/pull/115
|
|
|
|
substituteInPlace src/lib/Makefile.am \
|
|
|
|
--replace "/etc/" "\$""{sysconfdir}/"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
intltoolize --force
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A program used to control monitor parameters by software";
|
|
|
|
homepage = "https://github.com/ddccontrol/ddccontrol";
|
2021-02-13 14:23:35 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with lib.maintainers; [ pakhfn ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|