From b5377afcbb36f81f0d90157d203fd6eb8627e1b8 Mon Sep 17 00:00:00 2001 From: Ethan Carter Edwards Date: Tue, 4 Mar 2025 23:27:42 -0500 Subject: [PATCH] countryguess: init at 0-unstable-2025-03-04 Signed-off-by: Ethan Carter Edwards --- pkgs/by-name/co/countryguess/package.nix | 48 ++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 pkgs/by-name/co/countryguess/package.nix diff --git a/pkgs/by-name/co/countryguess/package.nix b/pkgs/by-name/co/countryguess/package.nix new file mode 100644 index 000000000000..22cf4135f4db --- /dev/null +++ b/pkgs/by-name/co/countryguess/package.nix @@ -0,0 +1,48 @@ +{ + lib, + python3Packages, + fetchFromGitHub, + makeWrapper, +}: + +python3Packages.buildPythonApplication rec { + pname = "countryguess"; + version = "0-unstable-2025-03-04"; + # upstream pyproject.toml is nonsense. Copied from another project + # without customizing it for this project. + format = "other"; + + src = fetchFromGitHub { + owner = "swarbler"; + repo = "countryguess"; + rev = "28f45231bc3d8bedeb7d1b51d56ca1b56796ff8c"; + hash = "sha256-S/fy94aRoVI2CvICrviQ2ZgVESWYLuREb5mwsfXL6Hc="; + }; + + dependencies = with python3Packages; [ + art + colorama + ]; + + # upstream python file lacks shebang + postPatch = '' + echo '#!/usr/bin/env python3' | cat - countryguess.py > temp && mv temp countryguess.py + ''; + + installPhase = '' + runHook preInstall + + install -Dm744 countryguess.py $out/bin/countryguess + + runHook postInstall + ''; + + meta = { + description = "Guess the 193 U.N. recognised countries"; + homepage = "https://github.com/swarbler/countryguess"; + license = lib.licenses.mit; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ ethancedwards8 ]; + mainProgram = "countryguess"; + }; +}