1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-05 12:02:47 +00:00

Merge pull request #46756 from copumpkin/patch-shebangs-test

top-level/release.nix: add patchShebangs test
This commit is contained in:
Daniel Peebles 2018-09-17 14:20:25 -04:00 committed by GitHub
commit bb6506561d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 0 deletions

View file

@ -27,4 +27,6 @@ with pkgs;
macOSSierraShared = callPackage ./macos-sierra-shared {};
cross = callPackage ./cross {};
patch-shebangs = callPackage ./patch-shebangs {};
}

View file

@ -0,0 +1,26 @@
{ stdenv, runCommand }:
let
bad-shebang = stdenv.mkDerivation {
name = "bad-shebang";
unpackPhase = ":";
installPhase = ''
mkdir -p $out/bin
echo "#!/bin/sh" > $out/bin/test
echo "echo -n hello" >> $out/bin/test
chmod +x $out/bin/test
'';
};
in runCommand "patch-shebangs-test" {
passthru = { inherit bad-shebang; };
meta.platforms = stdenv.lib.platforms.all;
} ''
printf "checking whether patchShebangs works properly... ">&2
if ! grep -q '^#!/bin/sh' ${bad-shebang}/bin/test; then
echo "yes" >&2
touch $out
else
echo "no" >&2
exit 1
fi
''

View file

@ -77,6 +77,7 @@ let
jobs.tests.cc-wrapper-libcxx-39.x86_64-darwin
jobs.tests.stdenv-inputs.x86_64-darwin
jobs.tests.macOSSierraShared.x86_64-darwin
jobs.tests.patch-shebangs.x86_64-darwin
];
} else null;
@ -119,6 +120,7 @@ let
jobs.tests.cc-multilib-gcc.x86_64-linux
jobs.tests.cc-multilib-clang.x86_64-linux
jobs.tests.stdenv-inputs.x86_64-linux
jobs.tests.patch-shebangs.x86_64-linux
]
++ lib.collect lib.isDerivation jobs.stdenvBootstrapTools
++ lib.optionals supportDarwin [
@ -148,6 +150,7 @@ let
jobs.tests.cc-wrapper-libcxx-6.x86_64-darwin
jobs.tests.stdenv-inputs.x86_64-darwin
jobs.tests.macOSSierraShared.x86_64-darwin
jobs.tests.patch-shebangs.x86_64-darwin
];
};