uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
96
pkgs/os-specific/linux/shadow/default.nix
Normal file
96
pkgs/os-specific/linux/shadow/default.nix
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
{ lib, stdenv, nixosTests, fetchpatch, fetchFromGitHub, autoreconfHook, libxslt
|
||||
, libxml2 , docbook_xml_dtd_45, docbook_xsl, itstool, flex, bison, runtimeShell
|
||||
, pam ? null, glibcCross ? null
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
glibc =
|
||||
if stdenv.hostPlatform != stdenv.buildPlatform
|
||||
then glibcCross
|
||||
else assert stdenv.hostPlatform.libc == "glibc"; stdenv.cc.libc;
|
||||
|
||||
dots_in_usernames = fetchpatch {
|
||||
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-apps/shadow/files/shadow-4.1.3-dots-in-usernames.patch";
|
||||
sha256 = "1fj3rg6x3jppm5jvi9y7fhd2djbi4nc5pgwisw00xlh4qapgz692";
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "shadow";
|
||||
version = "4.11.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "shadow-maint";
|
||||
repo = "shadow";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-PxLX5V0t18JftT5wT41krNv18Ew7Kz3MfZkOi/80ODA=";
|
||||
};
|
||||
|
||||
buildInputs = lib.optional (pam != null && stdenv.isLinux) pam;
|
||||
nativeBuildInputs = [autoreconfHook libxslt libxml2
|
||||
docbook_xml_dtd_45 docbook_xsl flex bison itstool
|
||||
];
|
||||
|
||||
patches =
|
||||
[ ./keep-path.patch
|
||||
# Obtain XML resources from XML catalog (patch adapted from gtk-doc)
|
||||
./respect-xml-catalog-files-var.patch
|
||||
dots_in_usernames
|
||||
./runtime-shell.patch
|
||||
];
|
||||
|
||||
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" "man" ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
# Assume System V `setpgrp (void)', which is the default on GNU variants
|
||||
# (`AC_FUNC_SETPGRP' is not cross-compilation capable.)
|
||||
preConfigure = ''
|
||||
export ac_cv_func_setpgrp_void=yes
|
||||
export shadow_cv_logdir=/var/log
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
"--enable-man"
|
||||
"--with-group-name-max-length=32"
|
||||
] ++ lib.optional (stdenv.hostPlatform.libc != "glibc") "--disable-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.*
|
||||
|
||||
# Move the su binary into the su package
|
||||
mkdir -p $su/bin
|
||||
mv $out/bin/su $su/bin
|
||||
'';
|
||||
|
||||
disallowedReferences = lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) stdenv.shellPackage;
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/shadow-maint";
|
||||
description = "Suite containing authentication-related tools such as passwd and su";
|
||||
license = licenses.bsd3;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
|
||||
passthru = {
|
||||
shellPath = "/bin/nologin";
|
||||
tests = { inherit (nixosTests) shadow; };
|
||||
};
|
||||
}
|
||||
19
pkgs/os-specific/linux/shadow/keep-path.patch
Normal file
19
pkgs/os-specific/linux/shadow/keep-path.patch
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
diff -ru shadow-4.1.5.1-orig/src/su.c shadow-4.1.5.1/src/su.c
|
||||
--- shadow-4.1.5.1-orig/src/su.c 2012-05-25 07:51:55.000000000 -0400
|
||||
+++ shadow-4.1.5.1/src/su.c 2012-07-25 17:22:57.013547930 -0400
|
||||
@@ -879,6 +879,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
+#if 0
|
||||
cp = getdef_str ((pw->pw_uid == 0) ? "ENV_SUPATH" : "ENV_PATH");
|
||||
if (NULL == cp) {
|
||||
addenv ((pw->pw_uid == 0) ? "PATH=/sbin:/bin:/usr/sbin:/usr/bin" : "PATH=/bin:/usr/bin", NULL);
|
||||
@@ -887,6 +888,7 @@
|
||||
} else {
|
||||
addenv ("PATH", cp);
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (getenv ("IFS") != NULL) { /* don't export user IFS ... */
|
||||
addenv ("IFS= \t\n", NULL); /* ... instead, set a safe IFS */
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
diff --git a/acinclude.m4 b/acinclude.m4
|
||||
index dd01f165..e23160ee 100644
|
||||
--- a/acinclude.m4
|
||||
+++ b/acinclude.m4
|
||||
@@ -46,9 +46,21 @@ AC_DEFUN([JH_CHECK_XML_CATALOG],
|
||||
ifelse([$3],,,[$3
|
||||
])dnl
|
||||
else
|
||||
- AC_MSG_RESULT([not found])
|
||||
- ifelse([$4],,
|
||||
- [AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])],
|
||||
- [$4])
|
||||
+ jh_check_xml_catalog_saved_ifs="$IFS"
|
||||
+ IFS=' '
|
||||
+ for f in $XML_CATALOG_FILES; do
|
||||
+ if [[ -f "$f" ]] && \
|
||||
+ AC_RUN_LOG([$XMLCATALOG --noout "$f" "$1" >&2]); then
|
||||
+ jh_found_xmlcatalog=true
|
||||
+ AC_MSG_RESULT([found])
|
||||
+ ifelse([$3],,,[$3])
|
||||
+ break
|
||||
+ fi
|
||||
+ done
|
||||
+ IFS="$jh_check_xml_catalog_saved_ifs"
|
||||
+ if ! $jh_found_xmlcatalog; then
|
||||
+ AC_MSG_RESULT([not found])
|
||||
+ ifelse([$4],,[AC_MSG_ERROR([could not find ifelse([$2],,[$1],[$2]) in XML catalog])],[$4])
|
||||
+ fi
|
||||
fi
|
||||
])
|
||||
13
pkgs/os-specific/linux/shadow/runtime-shell.patch
Normal file
13
pkgs/os-specific/linux/shadow/runtime-shell.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
diff --git a/configure.ac b/configure.ac
|
||||
index e4c6aaec..03883ad7 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -682,7 +682,7 @@ if test "$enable_utmpx" = "yes"; then
|
||||
[Define if utmpx should be used])
|
||||
fi
|
||||
|
||||
-AC_DEFINE_UNQUOTED(SHELL, ["$SHELL"], [The default shell.])
|
||||
+AC_DEFINE_UNQUOTED(SHELL, ["$RUNTIME_SHELL"], [The runtime shell.])
|
||||
|
||||
AM_GNU_GETTEXT_VERSION(0.16)
|
||||
AM_GNU_GETTEXT([external], [need-ngettext])
|
||||
Loading…
Add table
Add a link
Reference in a new issue