lol
fork

Configure Feed

Select the types of activity you want to include in your feed.

mat2: init at 0.12.0

+241
+95
pkgs/development/python-modules/mat2/default.nix
··· 1 + { lib 2 + , buildPythonPackage 3 + , python 4 + , pythonOlder 5 + , fetchFromGitLab 6 + , substituteAll 7 + , bubblewrap 8 + , exiftool 9 + , ffmpeg 10 + , mime-types 11 + , wrapGAppsHook 12 + , gdk-pixbuf 13 + , gobject-introspection 14 + , librsvg 15 + , poppler_gi 16 + , mutagen 17 + , pygobject3 18 + , pycairo 19 + , dolphinIntegration ? false, plasma5Packages 20 + }: 21 + 22 + buildPythonPackage rec { 23 + pname = "mat2"; 24 + version = "0.12.0"; 25 + 26 + disabled = pythonOlder "3.5"; 27 + 28 + src = fetchFromGitLab { 29 + domain = "0xacab.org"; 30 + owner = "jvoisin"; 31 + repo = "mat2"; 32 + rev = version; 33 + sha256 = "0amxwwmcf47dakfm6zvsksv6ja7rz7dpmd1z2rsspy8yds6zgxs7"; 34 + }; 35 + 36 + patches = [ 37 + # hardcode paths to some binaries 38 + (substituteAll ({ 39 + src = ./paths.patch; 40 + bwrap = "${bubblewrap}/bin/bwrap"; 41 + exiftool = "${exiftool}/bin/exiftool"; 42 + ffmpeg = "${ffmpeg}/bin/ffmpeg"; 43 + # remove once faf0f8a8a4134edbeec0a73de7f938453444186d is in master 44 + mimetypes = "${mime-types}/etc/mime.types"; 45 + } // lib.optionalAttrs dolphinIntegration { 46 + kdialog = "${plasma5Packages.kdialog}/bin/kdialog"; 47 + })) 48 + # the executable shouldn't be called .mat2-wrapped 49 + ./executable-name.patch 50 + # hardcode path to mat2 executable 51 + ./tests.patch 52 + ]; 53 + 54 + postPatch = '' 55 + substituteInPlace dolphin/mat2.desktop \ 56 + --replace "@mat2@" "$out/bin/mat2" \ 57 + --replace "@mat2svg@" "$out/share/icons/hicolor/scalable/apps/mat2.svg" 58 + ''; 59 + 60 + nativeBuildInputs = [ 61 + wrapGAppsHook 62 + ]; 63 + 64 + buildInputs = [ 65 + gdk-pixbuf 66 + gobject-introspection 67 + librsvg 68 + poppler_gi 69 + ]; 70 + 71 + propagatedBuildInputs = [ 72 + mutagen 73 + pygobject3 74 + pycairo 75 + ]; 76 + 77 + postInstall = '' 78 + install -Dm 444 data/mat2.svg -t "$out/share/icons/hicolor/scalable/apps" 79 + install -Dm 444 doc/mat2.1 -t "$out/share/man/man1" 80 + '' + lib.optionalString dolphinIntegration '' 81 + install -Dm 444 dolphin/mat2.desktop -t "$out/share/kservices5/ServiceMenus" 82 + ''; 83 + 84 + checkPhase = '' 85 + ${python.interpreter} -m unittest discover -v 86 + ''; 87 + 88 + meta = with lib; { 89 + description = "A handy tool to trash your metadata"; 90 + homepage = "https://0xacab.org/jvoisin/mat2"; 91 + changelog = "https://0xacab.org/jvoisin/mat2/-/blob/${version}/CHANGELOG.md"; 92 + license = licenses.lgpl3Plus; 93 + maintainers = with maintainers; [ dotlambda ]; 94 + }; 95 + }
+13
pkgs/development/python-modules/mat2/executable-name.patch
··· 1 + diff --git a/mat2 b/mat2 2 + index 3b77e1e..b99a633 100755 3 + --- a/mat2 4 + +++ b/mat2 5 + @@ -46,7 +46,7 @@ def __check_file(filename: str, mode: int = os.R_OK) -> bool: 6 + 7 + 8 + def create_arg_parser() -> argparse.ArgumentParser: 9 + - parser = argparse.ArgumentParser(description='Metadata anonymisation toolkit 2') 10 + + parser = argparse.ArgumentParser(description='Metadata anonymisation toolkit 2', prog='mat2') 11 + 12 + parser.add_argument('-V', '--verbose', action='store_true', 13 + help='show more verbose status information')
+111
pkgs/development/python-modules/mat2/paths.patch
··· 1 + diff --git a/dolphin/mat2.desktop b/dolphin/mat2.desktop 2 + index e623962..5d69ae2 100644 3 + --- a/dolphin/mat2.desktop 4 + +++ b/dolphin/mat2.desktop 5 + @@ -7,5 +7,5 @@ Type=Service 6 + [Desktop Action cleanMetadata] 7 + Name=Clean metadata 8 + Name[es]=Limpiar metadatos 9 + -Icon=/usr/share/icons/hicolor/scalable/apps/mat2.svg 10 + -Exec=kdialog --yesno "$( mat2 -s %U )" --title "Clean Metadata?" && mat2 %U 11 + +Icon=@mat2svg@ 12 + +Exec=@kdialog@ --yesno "$( @mat2@ -s %U )" --title "Clean Metadata?" && @mat2@ %U 13 + diff --git a/libmat2/bubblewrap.py b/libmat2/bubblewrap.py 14 + index 970d5dd..5d3c0b7 100644 15 + --- a/libmat2/bubblewrap.py 16 + +++ b/libmat2/bubblewrap.py 17 + @@ -22,11 +22,7 @@ CalledProcessError = subprocess.CalledProcessError 18 + 19 + 20 + def _get_bwrap_path() -> str: 21 + - which_path = shutil.which('bwrap') 22 + - if which_path: 23 + - return which_path 24 + - 25 + - raise RuntimeError("Unable to find bwrap") # pragma: no cover 26 + + return '@bwrap@' 27 + 28 + 29 + def _get_bwrap_args(tempdir: str, 30 + @@ -37,16 +33,11 @@ def _get_bwrap_args(tempdir: str, 31 + 32 + # XXX: use --ro-bind-try once all supported platforms 33 + # have a bubblewrap recent enough to support it. 34 + - ro_bind_dirs = ['/usr', '/lib', '/lib64', '/bin', '/sbin', '/etc/alternatives', cwd] 35 + + ro_bind_dirs = ['/nix/store', cwd] 36 + for bind_dir in ro_bind_dirs: 37 + if os.path.isdir(bind_dir): # pragma: no cover 38 + ro_bind_args.extend(['--ro-bind', bind_dir, bind_dir]) 39 + 40 + - ro_bind_files = ['/etc/ld.so.cache'] 41 + - for bind_file in ro_bind_files: 42 + - if os.path.isfile(bind_file): # pragma: no cover 43 + - ro_bind_args.extend(['--ro-bind', bind_file, bind_file]) 44 + - 45 + args = ro_bind_args + \ 46 + ['--dev', '/dev', 47 + '--proc', '/proc', 48 + diff --git a/libmat2/exiftool.py b/libmat2/exiftool.py 49 + index eb65b2a..51a0fa1 100644 50 + --- a/libmat2/exiftool.py 51 + +++ b/libmat2/exiftool.py 52 + @@ -1,8 +1,6 @@ 53 + -import functools 54 + import json 55 + import logging 56 + import os 57 + -import shutil 58 + import subprocess 59 + from typing import Dict, Union, Set 60 + 61 + @@ -70,14 +68,5 @@ class ExiftoolParser(abstract.AbstractParser): 62 + return False 63 + return True 64 + 65 + -@functools.lru_cache() 66 + def _get_exiftool_path() -> str: # pragma: no cover 67 + - which_path = shutil.which('exiftool') 68 + - if which_path: 69 + - return which_path 70 + - 71 + - # Exiftool on Arch Linux has a weird path 72 + - if os.access('/usr/bin/vendor_perl/exiftool', os.X_OK): 73 + - return '/usr/bin/vendor_perl/exiftool' 74 + - 75 + - raise RuntimeError("Unable to find exiftool") 76 + + return '@exiftool@' 77 + diff --git a/libmat2/parser_factory.py b/libmat2/parser_factory.py 78 + index 9965432..bd45179 100644 79 + --- a/libmat2/parser_factory.py 80 + +++ b/libmat2/parser_factory.py 81 + @@ -8,6 +8,7 @@ from . import abstract, UNSUPPORTED_EXTENSIONS 82 + 83 + T = TypeVar('T', bound='abstract.AbstractParser') 84 + 85 + +mimetypes.init(['@mimetypes@']) 86 + mimetypes.add_type('application/epub+zip', '.epub') 87 + mimetypes.add_type('application/x-dtbncx+xml', '.ncx') # EPUB Navigation Control XML File 88 + 89 + diff --git a/libmat2/video.py b/libmat2/video.py 90 + index b4a3232..3dd7ee5 100644 91 + --- a/libmat2/video.py 92 + +++ b/libmat2/video.py 93 + @@ -1,6 +1,4 @@ 94 + import subprocess 95 + -import functools 96 + -import shutil 97 + import logging 98 + 99 + from typing import Dict, Union 100 + @@ -135,10 +133,5 @@ class MP4Parser(AbstractFFmpegParser): 101 + } 102 + 103 + 104 + -@functools.lru_cache() 105 + def _get_ffmpeg_path() -> str: # pragma: no cover 106 + - which_path = shutil.which('ffmpeg') 107 + - if which_path: 108 + - return which_path 109 + - 110 + - raise RuntimeError("Unable to find ffmpeg") 111 + + return '@ffmpeg@'
+18
pkgs/development/python-modules/mat2/tests.patch
··· 1 + diff --git a/tests/test_climat2.py b/tests/test_climat2.py 2 + index cede642..2d5ad77 100644 3 + --- a/tests/test_climat2.py 4 + +++ b/tests/test_climat2.py 5 + @@ -10,12 +10,7 @@ import glob 6 + from libmat2 import images, parser_factory 7 + 8 + 9 + -mat2_binary = ['./mat2'] 10 + - 11 + -if 'MAT2_GLOBAL_PATH_TESTSUITE' in os.environ: 12 + - # Debian runs tests after installing the package 13 + - # https://0xacab.org/jvoisin/mat2/issues/16#note_153878 14 + - mat2_binary = ['/usr/bin/env', 'mat2'] 15 + +mat2_binary = [os.environ['out'] + '/bin/mat2'] 16 + 17 + 18 + class TestHelp(unittest.TestCase):
+2
pkgs/top-level/all-packages.nix
··· 2616 2616 2617 2617 massren = callPackage ../tools/misc/massren { }; 2618 2618 2619 + mat2 = with python3.pkgs; toPythonApplication mat2; 2620 + 2619 2621 maxcso = callPackage ../tools/archivers/maxcso {}; 2620 2622 2621 2623 medusa = callPackage ../tools/security/medusa { };
+2
pkgs/top-level/python-packages.nix
··· 4044 4044 4045 4045 mask-rcnn = callPackage ../development/python-modules/mask-rcnn { }; 4046 4046 4047 + mat2 = callPackage ../development/python-modules/mat2 { }; 4048 + 4047 4049 matchpy = callPackage ../development/python-modules/matchpy { }; 4048 4050 4049 4051 mathlibtools = callPackage ../development/python-modules/mathlibtools { };