2016-08-24 22:06:43 +01:00
|
|
|
{ stdenv, fetchurl, autoreconfHook, intltool, perl, perlPackages, libxml2
|
2016-09-11 22:24:51 +01:00
|
|
|
, pciutils, pkgconfig, gtk2, ddccontrol-db
|
2017-07-29 10:35:49 +01:00
|
|
|
, makeDesktopItem
|
2015-02-20 13:26:29 +00:00
|
|
|
}:
|
|
|
|
|
2015-02-19 21:49:31 +00:00
|
|
|
let version = "0.4.2"; in
|
2017-07-29 10:35:49 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2015-03-16 20:27:37 +00:00
|
|
|
name = "ddccontrol-${version}";
|
2016-02-09 01:32:47 +00:00
|
|
|
|
2015-02-20 13:26:29 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/ddccontrol/ddccontrol-${version}.tar.bz2";
|
|
|
|
sha1 = "fd5c53286315a61a18697a950e63ed0c8d5acff1";
|
|
|
|
};
|
2016-02-09 01:32:47 +00:00
|
|
|
|
2016-08-24 22:06:43 +01:00
|
|
|
nativeBuildInputs = [ autoreconfHook intltool pkgconfig ];
|
|
|
|
|
|
|
|
buildInputs = [
|
2016-09-11 22:24:51 +01:00
|
|
|
perl perlPackages.libxml_perl libxml2 pciutils gtk2 ddccontrol-db
|
2016-08-24 22:06:43 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
patches = [ ./automake.patch ];
|
2015-03-16 20:27:37 +00:00
|
|
|
|
2017-07-25 21:57:37 +01:00
|
|
|
hardeningDisable = [ "format" "bindnow" ];
|
2016-02-09 01:32:47 +00:00
|
|
|
|
2015-02-20 13:26:29 +00:00
|
|
|
prePatch = ''
|
|
|
|
newPath=$(echo "${ddccontrol-db}/share/ddccontrol-db" | sed "s/\\//\\\\\\//g")
|
2015-02-19 21:49:31 +00:00
|
|
|
mv configure.ac configure.ac.old
|
2015-02-20 13:26:29 +00:00
|
|
|
oldPath="\$"
|
|
|
|
oldPath+="{datadir}\/ddccontrol-db"
|
|
|
|
sed "s/$oldPath/$newPath/" <configure.ac.old >configure.ac
|
2015-03-16 20:27:37 +00:00
|
|
|
rm configure.ac.old
|
2017-06-28 20:41:32 +01:00
|
|
|
|
|
|
|
sed -e "s/chmod 4711/chmod 0711/" -i src/ddcpci/Makefile*
|
2015-02-20 13:26:29 +00:00
|
|
|
'';
|
2015-03-16 20:27:37 +00:00
|
|
|
|
2017-07-29 10:35:49 +01: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 13:26:29 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A program used to control monitor parameters by software";
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://ddccontrol.sourceforge.net/;
|
2015-02-20 13:26:29 +00:00
|
|
|
license = licenses.gpl2;
|
2018-01-22 12:57:49 +00:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2015-02-20 13:53:16 +00:00
|
|
|
maintainers = [ stdenv.lib.maintainers.pakhfn ];
|
2015-02-20 13:26:29 +00:00
|
|
|
};
|
2015-02-19 21:49:31 +00:00
|
|
|
}
|
2015-03-16 20:27:37 +00:00
|
|
|
|