From 0f462a28132ab4fa98b38cf930f1c5125ca79a11 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Mon, 6 Jan 2025 19:53:08 +0800 Subject: [PATCH] nixpkgs: patch mautrix-telegram References: https://github.com/mautrix/telegram/pull/991 --- flake/nixpkgs.nix | 5 +++++ patches/mautrix-telegram-sticker.patch | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 patches/mautrix-telegram-sticker.patch diff --git a/flake/nixpkgs.nix b/flake/nixpkgs.nix index 4fe856c..21ec8bb 100644 --- a/flake/nixpkgs.nix +++ b/flake/nixpkgs.nix @@ -8,6 +8,11 @@ let inputs.nixpkgs-terraform-providers-bin.overlay (_final: prev: { + mautrix-telegram = prev.mautrix-telegram.overrideAttrs (old: { + patches = (old.patches or [ ]) ++ [ + ../patches/mautrix-telegram-sticker.patch + ]; + }); libadwaita = prev.libadwaita.overrideAttrs (old: { patches = (old.patches or [ ]) ++ [ ../patches/libadwaita-without-adwaita-theme.patch diff --git a/patches/mautrix-telegram-sticker.patch b/patches/mautrix-telegram-sticker.patch new file mode 100644 index 0000000..c8dc3bf --- /dev/null +++ b/patches/mautrix-telegram-sticker.patch @@ -0,0 +1,24 @@ +diff --git a/mautrix_telegram/util/webm_converter.py b/mautrix_telegram/util/webm_converter.py +index 6ba4eed0..33d04514 100644 +--- a/mautrix_telegram/util/webm_converter.py ++++ b/mautrix_telegram/util/webm_converter.py +@@ -26,13 +26,17 @@ + + converter_args = { + "gif": { ++ "input_args": ("-c:v", "libvpx-vp9"), + "output_args": ("-vf", "split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse"), + }, + "png": { +- "input_args": ("-ss", "0"), ++ "input_args": ("-c:v", "libvpx-vp9", "-ss", "0"), + "output_args": ("-frames:v", "1"), + }, +- "webp": {}, ++ "webp": { ++ "input_args": ("-c:v", "libvpx-vp9"), ++ "output_args": ("-loop", "0"), ++ }, + } + +