nixpkgs/pkgs/development/python-modules/xkcdpass/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

52 lines
1.1 KiB
Nix

{ lib
, buildPythonPackage
, fetchPypi
, installShellFiles
, pytestCheckHook
, pythonAtLeast
, pythonOlder
}:
buildPythonPackage rec {
pname = "xkcdpass";
version = "1.19.8";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-MK//Q5m4PeNioRsmxHaMbN2x7a4SkgVy0xkxuvnUufo=";
};
nativeBuildInputs = [
installShellFiles
];
nativeCheckInputs = [
pytestCheckHook
];
pythonImportsCheck = [
"xkcdpass"
];
disabledTests = lib.optionals (pythonAtLeast "3.10") [
# https://github.com/redacted/XKCD-password-generator/issues/138
"test_entropy_printout_valid_input"
];
postInstall = ''
installManPage *.?
install -Dm444 -t $out/share/doc/${pname} README*
'';
meta = with lib; {
description = "Generate secure multiword passwords/passphrases, inspired by XKCD";
mainProgram = "xkcdpass";
homepage = "https://github.com/redacted/XKCD-password-generator";
license = licenses.bsd3;
maintainers = with maintainers; [ peterhoeg ];
};
}