badchars: refactor

This commit is contained in:
Fabian Affolter 2024-03-27 14:23:52 +01:00
parent d50918bc1c
commit f97761e47b

View File

@ -1,33 +1,41 @@
{ lib { lib
, buildPythonApplication , buildPythonApplication
, fetchPypi , fetchPypi
, python3
}: }:
buildPythonApplication rec { python3.pkgs.buildPythonApplication rec {
pname = "badchars"; pname = "badchars";
version = "0.4.0"; version = "0.4.0";
pyproject = true;
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
sha256 = "1xqki8qnfwl97d60xj69alyzwa1mnfbwki25j0vhvhb05varaxz2"; hash = "sha256-4neV1S5gwQ03kEXEyZezNSj+PVXJyA5MO4lyZzGKE/c=";
}; };
postPatch = '' postPatch = ''
substituteInPlace setup.py --replace "argparse" "" substituteInPlace setup.py \
--replace-fail "argparse" ""
''; '';
build-system = with python3.pkgs; [
setuptools
];
# no tests are available and it can't be imported (it's only a script, not a module) # no tests are available and it can't be imported (it's only a script, not a module)
doCheck = false; doCheck = false;
meta = with lib; { meta = with lib; {
description = "HEX badchar generator for different programming languages"; description = "HEX badchar generator for different programming languages";
mainProgram = "badchars";
longDescription = '' longDescription = ''
A HEX bad char generator to instruct encoders such as shikata-ga-nai to A HEX bad char generator to instruct encoders such as shikata-ga-nai to
transform those to other chars. transform those to other chars.
''; '';
homepage = "https://github.com/cytopia/badchars"; homepage = "https://github.com/cytopia/badchars";
changelog = "https://github.com/cytopia/badchars/releases/tag/${version}";
license = with licenses; [ mit ]; license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ]; maintainers = with maintainers; [ fab ];
mainProgram = "badchars";
}; };
} }