From b8549ca18700e90ef315fd04978a0edd699a770a Mon Sep 17 00:00:00 2001 From: Danilo Reyes Date: Sun, 18 May 2025 19:04:27 -0600 Subject: [PATCH] update pokemon + torrent wips --- pkgs/pokemon-colorscripts.nix | 4 +-- pkgs_wip/flatbencode.nix | 36 +++++++++++++++++++++++ pkgs_wip/torf-cli.nix | 52 +++++++++++++++++++++++++++++++++ pkgs_wip/torf.nix | 55 +++++++++++++++++++++++++++++++++++ 4 files changed, 145 insertions(+), 2 deletions(-) create mode 100644 pkgs_wip/flatbencode.nix create mode 100644 pkgs_wip/torf-cli.nix create mode 100644 pkgs_wip/torf.nix diff --git a/pkgs/pokemon-colorscripts.nix b/pkgs/pokemon-colorscripts.nix index 3e5cbde..69e1683 100644 --- a/pkgs/pokemon-colorscripts.nix +++ b/pkgs/pokemon-colorscripts.nix @@ -10,8 +10,8 @@ pkgs.stdenv.mkDerivation { src = pkgs.fetchFromGitLab { owner = "phoneybadger"; repo = "pokemon-colorscripts"; - rev = "0483c85b93362637bdd0632056ff986c07f30868"; - sha256 = "sha256-rj0qKYHCu9SyNsj1PZn1g7arjcHuIDGHwubZg/yJt7A="; + rev = "5802ff67520be2ff6117a0abc78a08501f6252ad"; + sha256 = "sha256-gKVmpHKt7S2XhSxLDzbIHTjJMoiIk69Fch202FZffqU="; }; buildInputs = with pkgs; [ diff --git a/pkgs_wip/flatbencode.nix b/pkgs_wip/flatbencode.nix new file mode 100644 index 0000000..281c92d --- /dev/null +++ b/pkgs_wip/flatbencode.nix @@ -0,0 +1,36 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, + wheel, +}: + +buildPythonPackage rec { + pname = "flatbencode"; + version = "0.2.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "acatton"; + repo = "flatbencode"; + rev = "v${version}"; + hash = "sha256-1/4w41E8IKygJTBcQOexiDytV6BvVBwIjajKz2uCfu8="; + }; + + build-system = [ + setuptools + wheel + ]; + + pythonImportsCheck = [ + "flatbencode" + ]; + + meta = { + description = "Fast, safe and non-recursive implementation of Bittorrent bencoding for Python 3"; + homepage = "https://github.com/acatton/flatbencode"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ ]; + }; +} diff --git a/pkgs_wip/torf-cli.nix b/pkgs_wip/torf-cli.nix new file mode 100644 index 0000000..673f6f1 --- /dev/null +++ b/pkgs_wip/torf-cli.nix @@ -0,0 +1,52 @@ +{ + lib, + python3, + fetchFromGitHub, +}: + +python3.pkgs.buildPythonApplication rec { + pname = "torf-cli"; + version = "5.2.1"; + pyproject = true; + + src = fetchFromGitHub { + owner = "rndusr"; + repo = "torf-cli"; + rev = "v${version}"; + hash = "sha256-ipF82mZq7iXsQOWD7w2b0dYDFOSZ7jjiqYAlp9SL4QU="; + }; + + build-system = [ + python3.pkgs.setuptools + ]; + + dependencies = with python3.pkgs; [ + pyxdg + torf + ]; + + optional-dependencies = with python3.pkgs; { + dev = [ + coverage + flake8 + isort + pytest + pytest-cov + ruff + tox + ]; + }; + + pythonImportsCheck = [ + "torf_cli" + ]; + + meta = { + description = "CLI tool for creating, reading and editing torrent files"; + homepage = "https://github.com/rndusr/torf-cli"; + changelog = "https://github.com/rndusr/torf-cli/blob/${src.rev}/CHANGELOG"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ ]; + mainProgram = "torf-cli"; + }; +} diff --git a/pkgs_wip/torf.nix b/pkgs_wip/torf.nix new file mode 100644 index 0000000..8f7a3d0 --- /dev/null +++ b/pkgs_wip/torf.nix @@ -0,0 +1,55 @@ +{ + lib, + python3, + fetchFromGitHub, +}: + +python3.pkgs.buildPythonApplication rec { + pname = "torf"; + version = "4.3.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "rndusr"; + repo = "torf"; + rev = "v${version}"; + hash = "sha256-vJapB4Tbn3tLLUIH9LemU9kTqG7TsByiotkWM52lsno="; + }; + + build-system = [ + python3.pkgs.setuptools + ]; + + dependencies = with python3.pkgs; [ + flatbencode + ]; + + optional-dependencies = with python3.pkgs; { + dev = [ + coverage + flake8 + isort + mypy + pytest + pytest-cov + pytest-httpserver + pytest-mock + pytest-xdist + ruff + tox + ]; + }; + + pythonImportsCheck = [ + "torf" + ]; + + meta = { + description = "Python module to create, parse and edit torrent files and magnet links"; + homepage = "https://github.com/rndusr/torf"; + changelog = "https://github.com/rndusr/torf/blob/${src.rev}/CHANGELOG"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ ]; + mainProgram = "torf"; + }; +}