From ce4fc55f31f04e90e56eff4cc95cf38e4f3f8c21 Mon Sep 17 00:00:00 2001 From: pacien Date: Sun, 5 Jun 2022 23:00:56 +0200 Subject: [PATCH 1/3] matrix-commander: unstable-2021-08-05 -> 2.30.0 The project switched to pyproject, allowing the use of `buildPythonApplication` instead of `mkDerivation`. Some of the modules listed as dependencies but shipping with Python itself had to be patched out. --- .../matrix-commander/default.nix | 69 ++++++++++++------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 47 insertions(+), 24 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/matrix-commander/default.nix b/pkgs/applications/networking/instant-messengers/matrix-commander/default.nix index ad3248fabba9..576ebf1075b5 100644 --- a/pkgs/applications/networking/instant-messengers/matrix-commander/default.nix +++ b/pkgs/applications/networking/instant-messengers/matrix-commander/default.nix @@ -1,38 +1,61 @@ -{ stdenv, lib, fetchFromGitHub, cacert, python3 }: +{ lib +, fetchFromGitHub +, buildPythonApplication +, cacert +, setuptools +, matrix-nio +, python-magic +, markdown +, pillow +, urllib3 +, aiofiles +, notify2 +, dbus-python +, python-olm +}: -stdenv.mkDerivation { +buildPythonApplication { pname = "matrix-commander"; - version = "unstable-2021-08-05"; + version = "2.30.0"; src = fetchFromGitHub { owner = "8go"; repo = "matrix-commander"; - rev = "7ab3fd9a0ef4eb19d882cb3701d2025b4d41b63a"; - sha256 = "sha256-WWf7GbJxGlqIdsS1d0T1DO0WN2RBepHGgJrl/nt7UIg="; + rev = "77cf433af0d2e63a88b8914026795a0da5486b77"; + sha256 = "sha256-qUyaN0syP2lLRJLCAD5nCWfwR/CW4t/g40a8xDYseIg="; }; - buildInputs = [ - cacert - (python3.withPackages(ps: with ps; [ - matrix-nio - magic - markdown - pillow - urllib3 - aiofiles - notify2 - ]))]; + format = "pyproject"; - installPhase = '' - runHook preInstall + postPatch = '' + # Dependencies already bundled with Python + sed -i \ + -e '/uuid/d' \ + -e '/argparse/d' \ + -e '/asyncio/d' \ + -e '/datetime/d' \ + setup.cfg requirements.txt - mkdir -p $out/bin - cp $src/matrix-commander.py $out/bin/matrix-commander - chmod +x $out/bin/matrix-commander - - runHook postInstall + # Dependencies not correctly detected + sed -i \ + -e '/dbus-python/d' \ + setup.cfg requirements.txt ''; + propagatedBuildInputs = [ + cacert + setuptools + matrix-nio + python-magic + markdown + pillow + urllib3 + aiofiles + notify2 + dbus-python + python-olm + ]; + meta = with lib; { description = "Simple but convenient CLI-based Matrix client app for sending and receiving"; homepage = "https://github.com/8go/matrix-commander"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index daa30701e59c..4cdff0b1a0af 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -28029,7 +28029,7 @@ with pkgs; canonicaljson; }; - matrix-commander = callPackage ../applications/networking/instant-messengers/matrix-commander { }; + matrix-commander = python3Packages.callPackage ../applications/networking/instant-messengers/matrix-commander { }; matrix-dl = callPackage ../applications/networking/instant-messengers/matrix-dl { }; From e8573094f3495d29790b6e8761b70ba2cf31a32c Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 11 Jun 2022 17:57:49 +0200 Subject: [PATCH 2/3] matrix-commander: 2.30.0 -> 2.36.0 --- .../instant-messengers/matrix-commander/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/matrix-commander/default.nix b/pkgs/applications/networking/instant-messengers/matrix-commander/default.nix index 576ebf1075b5..3713d6c0a1d5 100644 --- a/pkgs/applications/networking/instant-messengers/matrix-commander/default.nix +++ b/pkgs/applications/networking/instant-messengers/matrix-commander/default.nix @@ -14,15 +14,15 @@ , python-olm }: -buildPythonApplication { +buildPythonApplication rec { pname = "matrix-commander"; - version = "2.30.0"; + version = "2.36.0"; src = fetchFromGitHub { owner = "8go"; repo = "matrix-commander"; - rev = "77cf433af0d2e63a88b8914026795a0da5486b77"; - sha256 = "sha256-qUyaN0syP2lLRJLCAD5nCWfwR/CW4t/g40a8xDYseIg="; + rev = "v${version}"; + sha256 = "sha256-NjOPVQ9BJ2LI7qIr8R8xWDXuFTVIYnvN4hIzfrTCX9I="; }; format = "pyproject"; From 7dc14475ce5f3da4456ef85665324f9219ecf2f7 Mon Sep 17 00:00:00 2001 From: pacien Date: Thu, 16 Jun 2022 21:17:02 +0200 Subject: [PATCH 3/3] matrix-commander: 2.36.0 -> 2.37.3 --- .../instant-messengers/matrix-commander/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/matrix-commander/default.nix b/pkgs/applications/networking/instant-messengers/matrix-commander/default.nix index 3713d6c0a1d5..85c3dc86ea0f 100644 --- a/pkgs/applications/networking/instant-messengers/matrix-commander/default.nix +++ b/pkgs/applications/networking/instant-messengers/matrix-commander/default.nix @@ -11,18 +11,19 @@ , aiofiles , notify2 , dbus-python +, xdg , python-olm }: buildPythonApplication rec { pname = "matrix-commander"; - version = "2.36.0"; + version = "2.37.3"; src = fetchFromGitHub { owner = "8go"; repo = "matrix-commander"; rev = "v${version}"; - sha256 = "sha256-NjOPVQ9BJ2LI7qIr8R8xWDXuFTVIYnvN4hIzfrTCX9I="; + sha256 = "sha256-X5tCPR0EqY1dxViwh8/tEjJM2oo81L3H703pPzWzUv8="; }; format = "pyproject"; @@ -53,6 +54,7 @@ buildPythonApplication rec { aiofiles notify2 dbus-python + xdg python-olm ];