From d30d0c783d7b403efe547a5420316d611a180135 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Sat, 6 Jun 2015 12:02:38 -0700 Subject: [PATCH] Revert "pam: Factor out dependencies" This reverts commit 7141d96bde218141ed73bd82cc806d075e0d07f4. --- pkgs/os-specific/linux/pam/default.nix | 63 +++++++++----------------- 1 file changed, 22 insertions(+), 41 deletions(-) diff --git a/pkgs/os-specific/linux/pam/default.nix b/pkgs/os-specific/linux/pam/default.nix index 96debd66e5b1..29cfa64b22d8 100644 --- a/pkgs/os-specific/linux/pam/default.nix +++ b/pkgs/os-specific/linux/pam/default.nix @@ -1,16 +1,5 @@ -{ stdenv, fetchurl, pkgconfig +{ stdenv, fetchurl, flex, cracklib }: -# Optional Depdencies -, cracklib ? null, libaudit ? null, db ? null -}: - -with stdenv; -let - optCracklib = shouldUsePkg cracklib; - optLibaudit = shouldUsePkg libaudit; - optDb = shouldUsePkg db; -in -with stdenv.lib; stdenv.mkDerivation rec { name = "linux-pam-${version}"; version = "1.2.0"; @@ -20,45 +9,37 @@ stdenv.mkDerivation rec { sha256 = "192y2fgf24a5qsg7rl1mzgw5axs5lg8kqamkfff2x50yjv2ym2yd"; }; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ optCracklib optLibaudit optDb ]; + nativeBuildInputs = [ flex ]; - configureFlags = [ - (mkOther "sysconfdir" "/etc") - (mkOther "localstatedir" "/var") - (mkOther "includedir" "\${out}/include/security") - (mkEnable false "static-modules" null) - (mkEnable true "pie" null) - (mkEnable false "prelude" null) - (mkEnable false "debug" null) - (mkEnable false "pamlocking" null) - (mkEnable true "read-both-confs" null) - (mkEnable true "lckpwdf" null) - (mkWith true "xauth" "/run/current-system/sw/bin/xauth") - (mkEnable (optCracklib != null) "cracklib" null) - (mkEnable (optLibaudit != null) "audit" null) - (mkEnable (optDb != null) "db" "db") - (mkEnable true "nis" null) # TODO: Consider tirpc support here - (mkEnable false "selinux" null) - (mkEnable false "regenerate-docu" null) - ]; + buildInputs = [ cracklib ]; - installFlags = [ - "sysconfdir=\${out}/etc" - "SCONFIGDIR=\${out}/etc/security" - ]; + crossAttrs = { + propagatedBuildInputs = [ flex.crossDrv cracklib.crossDrv ]; + preConfigure = preConfigure + '' + ar x ${flex.crossDrv}/lib/libfl.a + mv libyywrap.o libyywrap-target.o + ar x ${flex}/lib/libfl.a + mv libyywrap.o libyywrap-host.o + export LDFLAGS="$LDFLAGS $PWD/libyywrap-target.o" + sed -e 's/@CC@/gcc/' -i doc/specs/Makefile.in + ''; + postConfigure = '' + sed -e "s@ $PWD/libyywrap-target.o@ $PWD/libyywrap-host.o@" -i doc/specs/Makefile + ''; + }; postInstall = '' - # Prepare unix_chkpwd for setuid wrapping mv -v $out/sbin/unix_chkpwd{,.orig} ln -sv /var/setuid-wrappers/unix_chkpwd $out/sbin/unix_chkpwd ''; + preConfigure = '' + configureFlags="$configureFlags --includedir=$out/include/security" + ''; + meta = { homepage = http://ftp.kernel.org/pub/linux/libs/pam/; description = "Pluggable Authentication Modules, a flexible mechanism for authenticating user"; - license = licenses.bsd3; - platforms = platforms.linux; - maintainers = with maintainers; [ wkennington ]; + platforms = stdenv.lib.platforms.linux; }; }