nixpkgs/pkgs/misc/screensavers/xlockmore/default.nix
Roman Joost ce0e3eae66
xlockmore: add preConfigure to compile with DPMS support (#127051)
The build of xlockmore produced only the minimum set of features. DPMS
support, Xinerama etc was disabled because the changes in the postPatch
step were never applied by re-running autoconf.

Furthermore, DPMS was not supported because it couldn't find the
`dpms.h` header file in order to compile the support for DPMS features.

This patch uses the `autoreconfHook` in which we run
`autoconf` to apply the changes of `configure.ac` to the `configure`
script. The patch also uses the `libXext.dev` `buildInput` in order to
allow access to the right header files.
2021-06-18 10:30:13 +02:00

42 lines
1.4 KiB
Nix

{ stdenv, lib, fetchurl, pam ? null, libX11, libXext, libXinerama
, libXdmcp, libXt, autoreconfHook }:
stdenv.mkDerivation rec {
name = "xlockmore-5.66";
src = fetchurl {
url = "http://sillycycle.com/xlock/${name}.tar.xz";
sha256 = "sha256-WXalw2YoKNFFIskOBvKN3PyOV3iP3gjri3pw6e87q3E=";
curlOpts = "--user-agent 'Mozilla/5.0'";
};
# Optionally, it can use GTK.
buildInputs = [ pam libX11 libXext.dev libXinerama libXdmcp libXt ];
nativeBuildInputs = [ autoreconfHook ];
# Don't try to install `xlock' setuid. Password authentication works
# fine via PAM without super user privileges.
configureFlags =
[ "--disable-setuid"
] ++ (lib.optional (pam != null) "--enable-pam");
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"
'';
hardeningDisable = [ "format" ]; # no build output otherwise
meta = with lib; {
description = "Screen locker for the X Window System";
homepage = "http://sillycycle.com/xlockmore.html";
license = licenses.gpl2;
maintainers = with maintainers; [ pSub ];
platforms = platforms.linux;
};
}