From 904cdf19567e92cdaced13775f83962aed2272ec Mon Sep 17 00:00:00 2001 From: xeals Date: Thu, 15 Aug 2024 14:05:42 +1000 Subject: [PATCH] betanin: 0.4.0 -> 0.5.6 --- pkgs/by-name/be/betanin/package.nix | 91 ++++++++++++++++------------- 1 file changed, 51 insertions(+), 40 deletions(-) diff --git a/pkgs/by-name/be/betanin/package.nix b/pkgs/by-name/be/betanin/package.nix index a12a3cf..15e0728 100644 --- a/pkgs/by-name/be/betanin/package.nix +++ b/pkgs/by-name/be/betanin/package.nix @@ -1,71 +1,82 @@ { lib -, callPackage +, buildNpmPackage , fetchFromGitHub , python3 , beets }: let - py = python3.pkgs; - - version = "0.4.0.ffe45c02"; + version = "0.5.6"; src = fetchFromGitHub { - owner = "xeals"; + owner = "sentriz"; repo = "betanin"; - rev = "ffe45c028037fc1659f62a9cdc9e1413dc2f358d"; - hash = "sha256-5d8Y7PDlhkdVRVX+KvpiQ2WYNRELwc+ya5s4Qi+YQpI="; + rev = "v${version}"; + hash = "sha256-8JzZfxXzey6vGwsnpXTea/gTMFwmeeavimn5njHIEg0="; }; - client = callPackage ./client { - inherit src version; + client = buildNpmPackage { + pname = "betanin_client"; + inherit version src; + + sourceRoot = "${src.name}/betanin_client"; + + npmDepsHash = "sha256-VkCQKpkDCTDejv8eRAN2Zfbq8TlWLdtqVJU3fo9hQrI="; + NODE_ENV = "production"; + NODE_OPTIONS = "--openssl-legacy-provider"; + + npmInstallFlags = [ "--include=dev" ]; + installPhase = '' + cp -r dist $out + ''; }; in -py.buildPythonApplication { +python3.pkgs.buildPythonApplication { pname = "betanin"; inherit version src; - - clientDistDir = "${client}/lib/node_modules/betanin/dist/"; - - doCheck = false; + format = "pyproject"; patches = [ ./paths.patch ]; postPatch = '' + export clientDistDir="${client}" export libPrefix="${python3.libPrefix}" substituteAllInPlace betanin/paths.py + + # pythonRelaxDepsHook doesn't work + sed -i 's/Flask <3.0.0/Flask/' pyproject.toml ''; - propagatedBuildInputs = - (builtins.attrValues { - inherit (py) - apprise - alembic - click - flask - flask-cors - flask-jwt-extended - flask_migrate - flask-restx - flask-socketio - flask-sqlalchemy - gevent - pyxdg - loguru - ptyprocess - python-engineio - python-socketio - sqlalchemy - sqlalchemy-utils - toml; - }) ++ [ - beets - ]; + build-system = with python3.pkgs; [ setuptools ]; + + dependencies = (with python3.pkgs; [ + apprise + alembic + click + flask + flask-cors + flask-jwt-extended + flask_migrate + flask-restx + flask-socketio + flask-sqlalchemy + gevent + pyxdg + loguru + ptyprocess + python-engineio + python-socketio + sqlalchemy + sqlalchemy-utils + toml + ]) ++ [ + beets + ]; meta = { homepage = "https://github.com/sentriz/betanin"; description = "beets based mitm of your torrent client and music player"; license = lib.licenses.gpl3Only; maintainers = [ ]; - platforms = python3.meta.platforms; + platforms = lib.platforms.linux; }; }