From 70c7d6b44ce12bd1600810fa989cea78b2d39c01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Thu, 23 Oct 2025 16:57:47 -0700 Subject: [PATCH 1/2] python3Packages.mat2: 0.13.5 -> 0.14.0 Diff: https://github.com/jvoisin/mat2/compare/0.13.5...0.14.0 Changelog: https://github.com/jvoisin/mat2/blob/0.14.0/CHANGELOG.md --- .../python-modules/mat2/bubblewrap-path.patch | 35 ------------- .../python-modules/mat2/default.nix | 52 +++++++------------ 2 files changed, 20 insertions(+), 67 deletions(-) delete mode 100644 pkgs/development/python-modules/mat2/bubblewrap-path.patch diff --git a/pkgs/development/python-modules/mat2/bubblewrap-path.patch b/pkgs/development/python-modules/mat2/bubblewrap-path.patch deleted file mode 100644 index 2c71930b6df8..000000000000 --- a/pkgs/development/python-modules/mat2/bubblewrap-path.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/libmat2/bubblewrap.py b/libmat2/bubblewrap.py -index 970d5dd..5d3c0b7 100644 ---- a/libmat2/bubblewrap.py -+++ b/libmat2/bubblewrap.py -@@ -22,11 +22,7 @@ CalledProcessError = subprocess.CalledProcessError - - - def _get_bwrap_path() -> str: -- which_path = shutil.which('bwrap') -- if which_path: -- return which_path -- -- raise RuntimeError("Unable to find bwrap") # pragma: no cover -+ return '@bwrap@' - - - def _get_bwrap_args(tempdir: str, -@@ -37,16 +33,11 @@ def _get_bwrap_args(tempdir: str, - - # XXX: use --ro-bind-try once all supported platforms - # have a bubblewrap recent enough to support it. -- ro_bind_dirs = ['/usr', '/lib', '/lib64', '/bin', '/sbin', '/etc/alternatives', cwd] -+ ro_bind_dirs = ['/nix/store', cwd] - for bind_dir in ro_bind_dirs: - if os.path.isdir(bind_dir): # pragma: no cover - ro_bind_args.extend(['--ro-bind', bind_dir, bind_dir]) - -- ro_bind_files = ['/etc/ld.so.cache'] -- for bind_file in ro_bind_files: -- if os.path.isfile(bind_file): # pragma: no cover -- ro_bind_args.extend(['--ro-bind', bind_file, bind_file]) -- - args = ro_bind_args + \ - ['--dev', '/dev', - '--proc', '/proc', diff --git a/pkgs/development/python-modules/mat2/default.nix b/pkgs/development/python-modules/mat2/default.nix index 19ec148450c4..f91a9e412482 100644 --- a/pkgs/development/python-modules/mat2/default.nix +++ b/pkgs/development/python-modules/mat2/default.nix @@ -3,18 +3,19 @@ stdenv, buildPythonPackage, pytestCheckHook, - fetchFromGitLab, + fetchFromGitHub, fetchpatch, replaceVars, - bubblewrap, exiftool, ffmpeg, setuptools, wrapGAppsHook3, gdk-pixbuf, + gnome, gobject-introspection, librsvg, poppler_gi, + webp-pixbuf-loader, mutagen, pygobject3, pycairo, @@ -24,33 +25,17 @@ buildPythonPackage rec { pname = "mat2"; - version = "0.13.5"; + version = "0.14.0"; pyproject = true; - src = fetchFromGitLab { - domain = "0xacab.org"; + src = fetchFromGitHub { owner = "jvoisin"; repo = "mat2"; tag = version; - hash = "sha256-ivFgH/88DBucZRaO/OMsLlwJCjv/VQXb6AiKWhZ8XH0="; + hash = "sha256-JTt2/PuSxOXXHUuRP42y8jxw09mNMMz1piJM4ldnjq0="; }; patches = [ - (fetchpatch { - name = "exiftool-13.25-compat.patch"; - url = "https://0xacab.org/jvoisin/mat2/-/commit/473903b70e1b269a6110242a9c098a10c18554e2.patch"; - hash = "sha256-vxxjAFwiTDlcTT3ZlfhOG4rlzBJS+LhLoA++8y2hEok="; - }) - (fetchpatch { - name = "fix-test-on-python313.patch"; - url = "https://0xacab.org/jvoisin/mat2/-/commit/f07344444d6d2f04a1f93e2954f4910b194bee0c.patch"; - hash = "sha256-y756sKkjGO11A2lrRsXAwWgupOZ00u0cDypvkbsiNbY="; - }) - (fetchpatch { - name = "fix-test-on-python312.patch"; - url = "https://0xacab.org/jvoisin/mat2/-/commit/7a8ea224bc327b8ee929379d577c74968ea1c352.patch"; - hash = "sha256-pPiYhoql5WhjhLKvd6y3OnvxORSbXIGCsZMc7UH3i1Q="; - }) # hardcode paths to some binaries (replaceVars ./paths.patch { exiftool = lib.getExe exiftool; @@ -64,11 +49,6 @@ buildPythonPackage rec { ./executable-name.patch # hardcode path to mat2 executable ./tests.patch - ] - ++ lib.optionals (stdenv.hostPlatform.isLinux) [ - (replaceVars ./bubblewrap-path.patch { - bwrap = lib.getExe bubblewrap; - }) ]; postPatch = '' @@ -86,7 +66,6 @@ buildPythonPackage rec { buildInputs = [ gdk-pixbuf - librsvg poppler_gi ]; @@ -97,6 +76,15 @@ buildPythonPackage rec { ]; postInstall = '' + export GDK_PIXBUF_MODULE_FILE="${ + gnome._gdkPixbufCacheBuilder_DO_NOT_USE { + extraLoaders = [ + librsvg + webp-pixbuf-loader + ]; + } + }" + install -Dm 444 data/mat2.svg -t "$out/share/icons/hicolor/scalable/apps" install -Dm 444 doc/mat2.1 -t "$out/share/man/man1" '' @@ -106,12 +94,12 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; - meta = with lib; { + meta = { description = "Handy tool to trash your metadata"; - homepage = "https://0xacab.org/jvoisin/mat2"; - changelog = "https://0xacab.org/jvoisin/mat2/-/blob/${version}/CHANGELOG.md"; - license = licenses.lgpl3Plus; + homepage = "https://github.com/jvoisin/mat2"; + changelog = "https://github.com/jvoisin/mat2/blob/${src.tag}/CHANGELOG.md"; + license = lib.licenses.lgpl3Plus; mainProgram = "mat2"; - maintainers = with maintainers; [ dotlambda ]; + maintainers = with lib.maintainers; [ dotlambda ]; }; } From e3ea0e3229336f5843de7e71d94c19ae44aaa717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 25 Oct 2025 15:50:06 -0700 Subject: [PATCH 2/2] python3Packages.mat2: run versionCheckHook --- pkgs/development/python-modules/mat2/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/python-modules/mat2/default.nix b/pkgs/development/python-modules/mat2/default.nix index f91a9e412482..f6ff184eb2c0 100644 --- a/pkgs/development/python-modules/mat2/default.nix +++ b/pkgs/development/python-modules/mat2/default.nix @@ -21,6 +21,7 @@ pycairo, dolphinIntegration ? false, kdePackages, + versionCheckHook, }: buildPythonPackage rec { @@ -94,6 +95,9 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + meta = { description = "Handy tool to trash your metadata"; homepage = "https://github.com/jvoisin/mat2";