mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-18 10:04:08 +00:00
shadow: cleanup
This commit is contained in:
parent
0e32191623
commit
05046655d8
@ -1,14 +1,16 @@
|
||||
{ lib, stdenv, nixosTests, fetchpatch, fetchFromGitHub, autoreconfHook, libxslt
|
||||
, libxml2 , docbook_xml_dtd_45, docbook_xsl, itstool, flex, bison, runtimeShell
|
||||
, libxcrypt, pam ? null, glibcCross ? null
|
||||
{ lib, stdenv, fetchFromGitHub
|
||||
, runtimeShell, nixosTests, fetchpatch
|
||||
, autoreconfHook, bison, flex
|
||||
, docbook_xml_dtd_45, docbook_xsl
|
||||
, itstool , libxml2, libxslt
|
||||
, libxcrypt
|
||||
, glibcCross ? null
|
||||
, pam ? null
|
||||
, withTcb ? stdenv.isLinux, tcb
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
glibc =
|
||||
if stdenv.hostPlatform != stdenv.buildPlatform
|
||||
then glibcCross
|
||||
if stdenv.hostPlatform != stdenv.buildPlatform then glibcCross
|
||||
else assert stdenv.hostPlatform.libc == "glibc"; stdenv.cc.libc;
|
||||
|
||||
in
|
||||
@ -24,12 +26,19 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "sha256-L54DhdBYthfB9436t/XWXiqKhW7rfd0GLS7pYGB32rA=";
|
||||
};
|
||||
|
||||
outputs = [ "out" "su" "dev" "man" ];
|
||||
|
||||
RUNTIME_SHELL = runtimeShell;
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook bison flex
|
||||
docbook_xml_dtd_45 docbook_xsl
|
||||
itstool libxml2 libxslt
|
||||
];
|
||||
|
||||
buildInputs = [ libxcrypt ]
|
||||
++ lib.optional (pam != null && stdenv.isLinux) pam
|
||||
++ lib.optional withTcb tcb;
|
||||
nativeBuildInputs = [autoreconfHook libxslt libxml2
|
||||
docbook_xml_dtd_45 docbook_xsl flex bison itstool
|
||||
];
|
||||
|
||||
patches = [
|
||||
./keep-path.patch
|
||||
@ -44,16 +53,10 @@ stdenv.mkDerivation rec {
|
||||
})
|
||||
];
|
||||
|
||||
RUNTIME_SHELL = runtimeShell;
|
||||
|
||||
# The nix daemon often forbids even creating set[ug]id files.
|
||||
postPatch =
|
||||
''sed 's/^\(s[ug]idperms\) = [0-9]755/\1 = 0755/' -i src/Makefile.am
|
||||
'';
|
||||
|
||||
outputs = [ "out" "su" "dev" "man" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
postPatch = ''
|
||||
sed 's/^\(s[ug]idperms\) = [0-9]755/\1 = 0755/' -i src/Makefile.am
|
||||
'';
|
||||
|
||||
# Assume System V `setpgrp (void)', which is the default on GNU variants
|
||||
# (`AC_FUNC_SETPGRP' is not cross-compilation capable.)
|
||||
@ -70,21 +73,21 @@ stdenv.mkDerivation rec {
|
||||
] ++ lib.optional (stdenv.hostPlatform.libc != "glibc") "--disable-nscd"
|
||||
++ lib.optional withTcb "--with-tcb";
|
||||
|
||||
preBuild = lib.optionalString (stdenv.hostPlatform.libc == "glibc")
|
||||
''
|
||||
substituteInPlace lib/nscd.c --replace /usr/sbin/nscd ${glibc.bin}/bin/nscd
|
||||
'';
|
||||
preBuild = lib.optionalString (stdenv.hostPlatform.libc == "glibc") ''
|
||||
substituteInPlace lib/nscd.c --replace /usr/sbin/nscd ${glibc.bin}/bin/nscd
|
||||
'';
|
||||
|
||||
postInstall =
|
||||
''
|
||||
# Don't install ‘groups’, since coreutils already provides it.
|
||||
rm $out/bin/groups
|
||||
rm $man/share/man/man1/groups.*
|
||||
postInstall = ''
|
||||
# Don't install ‘groups’, since coreutils already provides it.
|
||||
rm $out/bin/groups
|
||||
rm $man/share/man/man1/groups.*
|
||||
|
||||
# Move the su binary into the su package
|
||||
mkdir -p $su/bin
|
||||
mv $out/bin/su $su/bin
|
||||
'';
|
||||
# Move the su binary into the su package
|
||||
mkdir -p $su/bin
|
||||
mv $out/bin/su $su/bin
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
disallowedReferences = lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) stdenv.shellPackage;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user