nixpkgs/pkgs/by-name/sh/sharness/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

53 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 = with lib; {
description = "Portable shell library to write, run and analyze automated tests adhering to Test Anything Protocol (TAP)";
homepage = "https://github.com/chriscool/sharness";
license = licenses.gpl2Only;
maintainers = [ maintainers.spacefrogg ];
platforms = platforms.unix;
};
})