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.
This commit is contained in:
pacien 2022-06-05 23:00:56 +02:00
parent d8bbeaa5c8
commit ce4fc55f31
2 changed files with 47 additions and 24 deletions

View File

@ -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";

View File

@ -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 { };