3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #213717 from NickCao/mautrix

python3Packages.mautrix: 0.18.9 -> 0.19.3
This commit is contained in:
Nick Cao 2023-01-31 16:51:32 +08:00 committed by GitHub
commit f70192f2b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 103 additions and 61 deletions

View file

@ -1,40 +1,67 @@
{ lib
, buildPythonPackage
, fetchPypi
, aiohttp
, fetchFromGitHub
, pythonOlder
, sqlalchemy
, ruamel-yaml
, CommonMark
, lxml
# deps
, aiohttp
, attrs
, yarl
# optional deps
, python-magic
, python-olm
, unpaddedbase64
, pycryptodome
# check deps
, pytestCheckHook
, pytest-asyncio
, aiosqlite
, sqlalchemy
, asyncpg
}:
buildPythonPackage rec {
pname = "mautrix";
version = "0.18.9";
version = "0.19.3";
format = "setuptools";
disabled = pythonOlder "3.8";
src = fetchPypi {
inherit pname version;
hash = "sha256-Ihaz/izB9L6osu3CPwBWOwLZ2JOLKhsDuqOUf/B02qI=";
src = fetchFromGitHub {
owner = "mautrix";
repo = "python";
rev = "v${version}";
hash = "sha256-7nvy2/DUS2BkcyQUUG8+aT/JHcPu141e5YWOiccS6cU=";
};
propagatedBuildInputs = [
aiohttp
# defined in optional-requirements.txt
sqlalchemy
aiosqlite
ruamel-yaml
CommonMark
lxml
attrs
yarl
];
# no tests available
doCheck = false;
passthru.optional-dependencies = {
detect_mimetype = [
python-magic
];
encryption = [
python-olm
unpaddedbase64
pycryptodome
];
};
nativeCheckInputs = [
pytestCheckHook
];
checkInputs = [
pytest-asyncio
aiosqlite
sqlalchemy
asyncpg
] ++ passthru.optional-dependencies.encryption;
SQLALCHEMY_SILENCE_UBER_WARNING = 1;
pythonImportsCheck = [
"mautrix"
@ -45,6 +72,6 @@ buildPythonPackage rec {
homepage = "https://github.com/tulir/mautrix-python";
changelog = "https://github.com/mautrix/python/releases/tag/v${version}";
license = licenses.mpl20;
maintainers = with maintainers; [ nyanloutre ma27 sumnerevans ];
maintainers = with maintainers; [ nyanloutre ma27 sumnerevans nickcao ];
};
}

View file

@ -4,17 +4,18 @@ let
python = python3.override {
packageOverrides = self: super: {
mautrix = super.mautrix.overridePythonAttrs (oldAttrs: rec {
version = "0.16.3";
src = oldAttrs.src.override {
inherit (oldAttrs) pname;
inherit version;
hash = "sha256-OpHLh5pCzGooQ5yxAa0+85m/szAafV+l+OfipQcfLtU=";
version = "0.16.10";
src = fetchFromGitHub {
owner = "mautrix";
repo = "python";
rev = "v${version}";
hash = "sha256-YQsQ7M+mHcRdGUZp+mo46AlBmKSdmlgRdGieEG0Hu9k=";
};
});
};
};
in python.pkgs.buildPythonApplication rec {
in
python.pkgs.buildPythonApplication rec {
pname = "heisenbridge";
version = "1.13.1";
@ -30,11 +31,10 @@ in python.pkgs.buildPythonApplication rec {
'';
propagatedBuildInputs = with python.pkgs; [
aiohttp
irc
ruamel-yaml
mautrix
python-socks
pyyaml
];
nativeCheckInputs = with python.pkgs; [

View file

@ -1,17 +1,19 @@
{ fetchFromGitHub, fetchpatch
{ fetchFromGitHub
, fetchpatch
, lib
, python3
, protobuf3_20
, enableE2be ? true, enableMetrics ? true, enableSqlite ? true
, enableE2be ? true
, enableMetrics ? true
, enableSqlite ? true
}: python3.pkgs.buildPythonApplication rec {
pname = "mautrix-googlechat";
version = "0.4.0";
version = "unstable-2023-01-25";
src = fetchFromGitHub {
owner = "mautrix";
repo = "googlechat";
rev = "v${version}";
sha256 = "sha256-UVWYT0HTOUEkBG0n6KNhCSSO/2PAF1rIvCaw478z+q0=";
rev = "e2eb528745466468f059c506c22e500e0cd832aa";
sha256 = "sha256-FNlEHzuy89RuFUwZPmVA+4AmpQHGD+18BguGC6qBdBM=";
};
patches = [
@ -24,13 +26,6 @@
})
];
doCheck = false;
postPatch = ''
sed -i requirements.txt \
-e 's/asyncpg>=.*/asyncpg/'
'';
baseConfigPath = "share/mautrix-googlechat/example-config.yaml";
postInstall = ''
rm $out/example-config.yaml
@ -43,8 +38,12 @@
pycryptodome
unpaddedbase64
];
metrics = [ prometheus-client ];
sqlite = [ aiosqlite ];
metrics = [
prometheus-client
];
sqlite = [
aiosqlite
];
};
propagatedBuildInputs = with python3.pkgs; [
@ -54,14 +53,14 @@
ruamel-yaml
CommonMark
python-magic
(protobuf.override {
protobuf = protobuf3_20;
})
protobuf3
mautrix
] ++ lib.optionals enableE2be passthru.optional-dependencies.e2be
++ lib.optionals enableMetrics passthru.optional-dependencies.metrics
++ lib.optionals enableSqlite passthru.optional-dependencies.sqlite;
doCheck = false;
meta = with lib; {
homepage = "https://github.com/mautrix/googlechat";
description = "A Matrix-Google Chat puppeting bridge";

View file

@ -11,6 +11,20 @@ python3.pkgs.buildPythonPackage rec {
sha256 = "sha256-UbetU1n9zD/mVFaJc9FECDq/Zell1TI/aYPsGXGB8Js=";
};
postPatch = ''
# the version mangling in mautrix_signal/get_version.py interacts badly with pythonRelaxDepsHook
substituteInPlace setup.py \
--replace 'version=version' 'version="${version}"'
'';
nativeBuildInputs = with python3.pkgs; [
pythonRelaxDepsHook
];
pythonRelaxDeps = [
"mautrix"
];
propagatedBuildInputs = with python3.pkgs; [
CommonMark
aiohttp
@ -31,12 +45,6 @@ python3.pkgs.buildPythonPackage rec {
doCheck = false;
postPatch = ''
substituteInPlace requirements.txt \
--replace "asyncpg>=0.20,<0.26" "asyncpg>=0.20" \
--replace "mautrix>=0.16.0,<0.17" "mautrix>=0.16.0"
'';
postInstall = ''
mkdir -p $out/bin

View file

@ -9,28 +9,31 @@ let
python = python3.override {
packageOverrides = self: super: {
tulir-telethon = self.telethon.overridePythonAttrs (oldAttrs: rec {
version = "1.27.0a1";
version = "1.27.0a7";
pname = "tulir-telethon";
src = super.fetchPypi {
inherit pname version;
sha256 = "sha256-tABAY4UlTyMK1ZafIFawegjBAtcnq3HMNbE1L6WaT3E=";
sha256 = "sha256-w4WILvLvJBKf3Nlj0omTCDDD4z+b0XFlCplQ/IHwIPs=";
};
doCheck = false;
});
};
};
in python.pkgs.buildPythonPackage rec {
in
python.pkgs.buildPythonPackage rec {
pname = "mautrix-telegram";
version = "0.12.2";
version = "unstable-2023-01-28";
disabled = python.pythonOlder "3.8";
src = fetchFromGitHub {
owner = "mautrix";
repo = "telegram";
rev = "v${version}";
sha256 = "sha256-htCk0VLr6GfXbpYWF/2bmpko7gSVlkH6HwDjOMhW8is=";
rev = "f12abbe03846fd5897d58572ab24b70a58b337d2";
sha256 = "sha256-5ZZ85FOmTO26q2zhAIsF7mTlN4BLNLW2dQF+0culkUM=";
};
format = "setuptools";
patches = [ ./0001-Re-add-entrypoint.patch ];
propagatedBuildInputs = with python.pkgs; ([
@ -43,19 +46,24 @@ in python.pkgs.buildPythonPackage rec {
tulir-telethon
asyncpg
Mako
# optional
# speedups
cryptg
cchardet
aiodns
brotli
# qr_login
pillow
qrcode
# formattednumbers
phonenumbers
# metrics
prometheus-client
# sqlite
aiosqlite
] ++ lib.optionals withHQthumbnails [
# hq_thumbnails
moviepy
] ++ lib.optionals withE2BE [
# e2be
python-olm
pycryptodome
unpaddedbase64