xlockmore: clean configure flags and add Xinerama and DPMS support

Close #9391.
This commit is contained in:
Nikolay Amiantov 2015-08-18 02:51:27 +03:00 committed by Vladimír Čunát
parent 77f18a152b
commit 4ce182c736

View file

@ -1,4 +1,5 @@
{ stdenv, fetchurl, pam ? null, x11 }:
{ stdenv, lib, fetchurl, pam ? null, autoreconfHook
, libX11, libXext, libXinerama, libXdmcp, libXt }:
stdenv.mkDerivation rec {
@ -9,37 +10,26 @@ stdenv.mkDerivation rec {
};
# Optionally, it can use GTK+.
buildInputs = [ pam x11 ];
buildInputs = [ pam libX11 libXext libXinerama libXdmcp libXt ];
nativeBuildInputs = [ autoreconfHook ];
# Don't try to install `xlock' setuid. Password authentication works
# fine via PAM without super user privileges.
configureFlags =
" --with-crypt"
+ " --enable-appdefaultdir=$out/share/X11/app-defaults"
+ " --disable-setuid"
+ " --without-editres"
+ " --without-xpm"
+ " --without-gltt"
+ " --without-ttf"
+ " --without-ftgl"
+ " --without-freetype"
+ " --without-opengl"
+ " --without-mesa"
+ " --without-dtsaver"
+ " --without-ext"
+ " --without-dpms"
+ " --without-xinerama"
+ " --without-rplay"
+ " --without-nas"
+ " --without-gtk2"
+ " --without-gtk"
+ (if pam != null then " --enable-pam --enable-bad-pam" else " --disable-pam");
[ "--disable-setuid"
] ++ (lib.optional (pam != null) "--enable-pam");
preConfigure = ''
configureFlags+=" --enable-appdefaultdir=$out/share/X11/app-defaults"
'';
postPatch =
let makePath = p: lib.concatMapStringsSep " " (x: x + "/" + p) buildInputs;
inputs = "${makePath "lib"} ${makePath "include"}";
in ''
sed -i 's,\(for ac_dir in\),\1 ${inputs},' configure.ac
sed -i 's,/usr/,/no-such-dir/,g' configure.ac
configureFlags+=" --enable-appdefaultdir=$out/share/X11/app-defaults"
'';
meta = with stdenv.lib; {
meta = with lib; {
description = "Screen locker for the X Window System";
homepage = http://www.tux.org/~bagleyd/xlockmore.html;
license = licenses.gpl2;