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-02-10 20:34:41 +00:00
|
|
|
version = "0.6.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ddccontrol";
|
|
|
|
repo = "ddccontrol";
|
2022-02-10 20:34:41 +00:00
|
|
|
rev = version;
|
|
|
|
sha256 = "00pmnzvd4l3w6chzw41mrf1pd7lrcwi1n7320bnq20rn8hsnbnxk";
|
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"
|
|
|
|
'' + lib.optionalString (lib.versionAtLeast "0.6.0" version) ''
|
|
|
|
# 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
|
|
|
};
|
|
|
|
}
|