openssh: split out dev and man outputs (#450868)

This commit is contained in:
numinit
2025-10-23 05:09:18 +00:00
committed by GitHub
2 changed files with 16 additions and 6 deletions
+11 -5
View File
@@ -51,6 +51,12 @@ assert withFIDO -> withSecurityKey;
stdenv.mkDerivation (finalAttrs: {
inherit pname version src;
outputs = [
"out"
"dev"
"man"
];
patches = [
# Making openssh pass the LOCALE_ARCHIVE variable to the forked session processes,
# so the session 'bash' will receive the proper locale archive, and thus process
@@ -66,7 +72,7 @@ stdenv.mkDerivation (finalAttrs: {
# On Hydra this makes installation fail (sometimes?),
# and nix store doesn't allow such fancy permission bits anyway.
''
substituteInPlace Makefile.in --replace '$(INSTALL) -m 4711' '$(INSTALL) -m 0711'
substituteInPlace Makefile.in --replace-fail '$(INSTALL) -m 4711' '$(INSTALL) -m 0711'
'';
strictDeps = true;
@@ -180,13 +186,13 @@ stdenv.mkDerivation (finalAttrs: {
# explicitly enable the PermitUserEnvironment feature
substituteInPlace regress/test-exec.sh \
--replace \
--replace-fail \
'cat << EOF > $OBJ/sshd_config' \
$'cat << EOF > $OBJ/sshd_config\n\tPermitUserEnvironment yes'
# some tests want to use files under /bin as example files
for f in regress/sftp-cmds.sh regress/forwarding.sh; do
substituteInPlace $f --replace '/bin' "$(dirname $(type -p ls))"
substituteInPlace $f --replace-fail '/bin' "$(dirname $(type -p ls))"
done
# set up NIX_REDIRECTS for direct invocations
@@ -199,7 +205,7 @@ stdenv.mkDerivation (finalAttrs: {
''
# The extra tests check PKCS#11 interactions, which softhsm emulates with software only
substituteInPlace regress/test-exec.sh \
--replace /usr/local/lib/softhsm/libsofthsm2.so ${lib.getLib softhsm}/lib/softhsm/libsofthsm2.so
--replace-fail /usr/local/lib/softhsm/libsofthsm2.so ${lib.getLib softhsm}/lib/softhsm/libsofthsm2.so
''
);
# integration tests hard to get working on darwin with its shaky
@@ -221,7 +227,7 @@ stdenv.mkDerivation (finalAttrs: {
# Install ssh-copy-id, it's very useful.
cp contrib/ssh-copy-id $out/bin/
chmod +x $out/bin/ssh-copy-id
cp contrib/ssh-copy-id.1 $out/share/man/man1/
cp contrib/ssh-copy-id.1 $man/share/man/man1/
'';
installTargets = [ "install-nokeys" ];
+5 -1
View File
@@ -6,6 +6,10 @@
runCommand "ssh-copy-id-${openssh.version}"
{
outputs = [
"out"
"man"
];
meta = openssh.meta // {
description = "Tool to copy SSH public keys to a remote machine";
priority = (openssh.meta.priority or lib.meta.defaultPriority) - 1;
@@ -13,5 +17,5 @@ runCommand "ssh-copy-id-${openssh.version}"
}
''
install -Dm 755 {${openssh},$out}/bin/ssh-copy-id
install -Dm 644 {${openssh},$out}/share/man/man1/ssh-copy-id.1.gz
install -Dm 644 {${openssh.man},$man}/share/man/man1/ssh-copy-id.1.gz
''