mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-03 21:40:12 +00:00
This commit was created by a combination of scripts and tools: - an ast-grep script to prefix things in meta with `lib.`, - a modified nixf-diagnose / nixf combination to remove unused `with lib;`, and - regular nixfmt. Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
61 lines
1.3 KiB
Nix
61 lines
1.3 KiB
Nix
{
|
|
stdenv,
|
|
lib,
|
|
fetchFromGitHub,
|
|
perl,
|
|
perlPackages,
|
|
sharnessExtensions ? { },
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "sharness";
|
|
version = "1.2.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "felipec";
|
|
repo = "sharness";
|
|
rev = "v${finalAttrs.version}";
|
|
hash = "sha256-C0HVWgTm9iXDSFyXcUVRfT0ip31YGaaZ6ZvxggK/x7o=";
|
|
};
|
|
|
|
# Used for testing
|
|
nativeBuildInputs = [
|
|
perl
|
|
perlPackages.IOTty
|
|
];
|
|
|
|
outputs = [
|
|
"out"
|
|
"doc"
|
|
];
|
|
|
|
makeFlags = [ "prefix=$(out)" ];
|
|
|
|
extensions = lib.mapAttrsToList (k: v: "${k}.sh ${v}") sharnessExtensions;
|
|
|
|
postInstall = lib.optionalString (sharnessExtensions != { }) ''
|
|
extDir=$out/share/sharness/sharness.d
|
|
mkdir -p "$extDir"
|
|
linkExtensions() {
|
|
set -- $extensions
|
|
while [ $# -ge 2 ]; do
|
|
ln -s "$2" "$extDir/$1"
|
|
shift 2
|
|
done
|
|
}
|
|
linkExtensions
|
|
'';
|
|
|
|
doCheck = true;
|
|
|
|
passthru.SHARNESS_TEST_SRCDIR = finalAttrs.finalPackage + "/share/sharness";
|
|
|
|
meta = {
|
|
description = "Portable shell library to write, run and analyze automated tests adhering to Test Anything Protocol (TAP)";
|
|
homepage = "https://github.com/chriscool/sharness";
|
|
license = lib.licenses.gpl2Only;
|
|
maintainers = [ lib.maintainers.spacefrogg ];
|
|
platforms = lib.platforms.unix;
|
|
};
|
|
})
|