python310Packages.mat2: 0.13.0 -> 0.13.1

https://0xacab.org/jvoisin/mat2/-/releases/0.13.1
This commit is contained in:
Robert Schütz 2023-01-07 11:01:58 -08:00
parent a4eb1b11bc
commit 68fa297be7
3 changed files with 8 additions and 36 deletions

View file

@ -4,7 +4,6 @@
, unittestCheckHook
, pythonOlder
, fetchFromGitLab
, fetchpatch
, substituteAll
, bubblewrap
, exiftool
@ -24,7 +23,7 @@
buildPythonPackage rec {
pname = "mat2";
version = "0.13.0";
version = "0.13.1";
disabled = pythonOlder "3.5";
@ -33,7 +32,7 @@ buildPythonPackage rec {
owner = "jvoisin";
repo = "mat2";
rev = version;
hash = "sha256-H3l8w2F+ZcJ1P/Dg0ZVBJPUK0itLocL7a0jeSrG3Ws8=";
hash = "sha256-/HcWVXguZf9cCGY0xlC7uMnLkSAqZ0DIAC6JUw2KKDs=";
};
patches = [
@ -49,16 +48,6 @@ buildPythonPackage rec {
./executable-name.patch
# hardcode path to mat2 executable
./tests.patch
# fix gobject-introspection typelib path for Nautilus extension
(substituteAll {
src = ./fix_poppler.patch;
poppler_path = "${poppler_gi}/lib/girepository-1.0";
})
# https://0xacab.org/jvoisin/mat2/-/issues/178
(fetchpatch {
url = "https://0xacab.org/jvoisin/mat2/-/commit/618e0a8e3984fd534b95ef3dbdcb8a76502c90b5.patch";
hash = "sha256-l9UFim3hGj+d2uKITiDG1OnqGeo2McBIiRSmK0Vidg8=";
})
] ++ lib.optionals (stdenv.hostPlatform.isLinux) [
(substituteAll {
src = ./bubblewrap-path.patch;
@ -92,9 +81,6 @@ buildPythonPackage rec {
postInstall = ''
install -Dm 444 data/mat2.svg -t "$out/share/icons/hicolor/scalable/apps"
install -Dm 444 doc/mat2.1 -t "$out/share/man/man1"
install -Dm 444 nautilus/mat2.py -t "$out/share/nautilus-python/extensions"
buildPythonPath "$out $pythonPath $propagatedBuildInputs"
patchPythonScript "$out/share/nautilus-python/extensions/mat2.py"
'' + lib.optionalString dolphinIntegration ''
install -Dm 444 dolphin/mat2.desktop -t "$out/share/kservices5/ServiceMenus"
'';

View file

@ -1,14 +0,0 @@
diff --git a/nautilus/mat2.py b/nautilus/mat2.py
index 11e6986..5a0e68f 100644
--- a/nautilus/mat2.py
+++ b/nautilus/mat2.py
@@ -22,6 +22,9 @@ import gi
gi.require_version('Nautilus', '3.0')
gi.require_version('Gtk', '3.0')
gi.require_version('GdkPixbuf', '2.0')
+gi.require_version('GIRepository', '2.0')
+from gi.repository import GIRepository
+GIRepository.Repository.prepend_search_path('@poppler_path@')
from gi.repository import Nautilus, GObject, Gtk, Gio, GLib, GdkPixbuf
from libmat2 import parser_factory

View file

@ -13,7 +13,7 @@ index 41c8de4..11df258 100644
+Exec=@kdialog@ --yesno "$( @mat2@ -s %F )" --title "Clean Metadata?" && @mat2@ %U
+Exec[de]=@kdialog@ --yesno "$( @mat2@ -s %F )" --title "Metadaten löschen?" && @mat2@ %U
diff --git a/libmat2/exiftool.py b/libmat2/exiftool.py
index eb65b2a..51a0fa1 100644
index cdfce3d..1e83520 100644
--- a/libmat2/exiftool.py
+++ b/libmat2/exiftool.py
@@ -1,8 +1,6 @@
@ -23,13 +23,13 @@ index eb65b2a..51a0fa1 100644
import os
-import shutil
import subprocess
from typing import Dict, Union, Set
from typing import Union
@@ -70,14 +68,5 @@ class ExiftoolParser(abstract.AbstractParser):
@@ -67,14 +65,5 @@ class ExiftoolParser(abstract.AbstractParser):
return False
return True
-@functools.lru_cache()
-@functools.lru_cache
def _get_exiftool_path() -> str: # pragma: no cover
- which_path = shutil.which('exiftool')
- if which_path:
@ -42,7 +42,7 @@ index eb65b2a..51a0fa1 100644
- raise RuntimeError("Unable to find exiftool")
+ return '@exiftool@'
diff --git a/libmat2/video.py b/libmat2/video.py
index ae9e463..2acc65c 100644
index 4d33aa4..6388664 100644
--- a/libmat2/video.py
+++ b/libmat2/video.py
@@ -1,6 +1,4 @@
@ -51,7 +51,7 @@ index ae9e463..2acc65c 100644
-import shutil
import logging
from typing import Dict, Union
from typing import Union
@@ -135,10 +133,5 @@ class MP4Parser(AbstractFFmpegParser):
}