2018-09-18 23:49:11 +02:00
|
|
|
{ stdenv, fetchFromGitHub, autoreconfHook, intltool, libxml2
|
2016-09-11 23:24:51 +02:00
|
|
|
, pciutils, pkgconfig, gtk2, ddccontrol-db
|
2017-07-29 11:35:49 +02:00
|
|
|
, makeDesktopItem
|
2015-02-20 14:26:29 +01:00
|
|
|
}:
|
|
|
|
|
2018-09-18 23:49:11 +02:00
|
|
|
let version = "0.4.4"; in
|
2017-07-29 11:35:49 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-13 23:52:01 +02:00
|
|
|
pname = "ddccontrol";
|
|
|
|
inherit version;
|
2016-02-09 02:32:47 +01:00
|
|
|
|
2018-09-18 23:49:11 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ddccontrol";
|
|
|
|
repo = "ddccontrol";
|
|
|
|
rev = "0.4.4";
|
|
|
|
sha256 = "09npy6z2j3jrvpvlr46vih31y2mbrh7wsqlbrjprxjv1j0kkz5q2";
|
2015-02-20 14:26:29 +01:00
|
|
|
};
|
2016-02-09 02:32:47 +01:00
|
|
|
|
2016-08-24 23:06:43 +02:00
|
|
|
nativeBuildInputs = [ autoreconfHook intltool pkgconfig ];
|
|
|
|
|
|
|
|
buildInputs = [
|
2018-09-18 23:49:11 +02:00
|
|
|
libxml2
|
|
|
|
pciutils
|
|
|
|
gtk2
|
|
|
|
ddccontrol-db
|
2016-08-24 23:06:43 +02:00
|
|
|
];
|
|
|
|
|
2017-07-25 22:57:37 +02:00
|
|
|
hardeningDisable = [ "format" "bindnow" ];
|
2016-02-09 02:32:47 +01:00
|
|
|
|
2015-02-20 14:26:29 +01:00
|
|
|
prePatch = ''
|
2018-09-18 23:49:11 +02:00
|
|
|
oldPath="\$""{datadir}/ddccontrol-db"
|
|
|
|
newPath="${ddccontrol-db}/share/ddccontrol-db"
|
|
|
|
sed -i -e "s|$oldPath|$newPath|" configure.ac
|
|
|
|
sed -i -e "s/chmod 4711/chmod 0711/" src/ddcpci/Makefile*
|
|
|
|
'';
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
intltoolize --force
|
2015-02-20 14:26:29 +01:00
|
|
|
'';
|
2015-03-16 21:27:37 +01:00
|
|
|
|
2017-07-29 11:35:49 +02:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/applications/
|
|
|
|
cp $desktopItem/share/applications/* $out/share/applications/
|
|
|
|
for entry in $out/share/applications/*.desktop; do
|
|
|
|
substituteAllInPlace $entry
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "gddccontrol";
|
|
|
|
desktopName = "gddccontrol";
|
|
|
|
genericName = "DDC/CI control";
|
|
|
|
comment = meta.description;
|
|
|
|
exec = "@out@/bin/gddccontrol";
|
|
|
|
icon = "gddccontrol";
|
|
|
|
categories = "Settings;HardwareSettings;";
|
|
|
|
};
|
|
|
|
|
2015-02-20 14:26:29 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A program used to control monitor parameters by software";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/ddccontrol/ddccontrol";
|
2015-02-20 14:26:29 +01:00
|
|
|
license = licenses.gpl2;
|
2018-01-22 13:57:49 +01:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2015-02-20 14:53:16 +01:00
|
|
|
maintainers = [ stdenv.lib.maintainers.pakhfn ];
|
2015-02-20 14:26:29 +01:00
|
|
|
};
|
2015-02-19 22:49:31 +01:00
|
|
|
}
|