;;; Copyright © 2021 Denis Carikli ;;; ;;; This file is not part of GNU Guix (yet). ;;; ;;; This file is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; This file is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu packages mat2) #:use-module (guix build-system python) #:use-module (guix download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (gnu packages glib) #:use-module (gnu packages gnome) #:use-module (gnu packages gtk) #:use-module (gnu packages music) #:use-module (gnu packages pdf) #:use-module (gnu packages photo) #:use-module (gnu packages video) #:use-module (gnu packages virtualization)) (define-public mat2 (package (name "mat2") (version "0.12.1") (source (origin (method url-fetch) (uri (string-append ;; Also available at ;; http://wmj5kiic7b6kjplpbvwadnht2nh2qnkbnqtcv3dyvpqtz7ssbssftxid.onion "https://0xacab.org/jvoisin/mat2/-/archive/0.12.0/mat2-" version ".tar.bz2")) (sha256 (base32 "0lfip7g0rjvjspvwxyizknq2ccgrhfqp4ji7v0cch76srz12yb05")))) (build-system python-build-system) ;; - `python3-mutagen` for audio support ;; - `python3-gi-cairo` and `gir1.2-poppler-0.18` for PDF support ;; - `gir1.2-gdkpixbuf-2.0` for images support ;; - `gir1.2-rsvg-2.0` for svg support ;; - `FFmpeg`, optionally, for video support ;; - `libimage-exiftool-perl` for everything else ;; - `bubblewrap`, optionally, for sandboxing (inputs `(("python-mutagen" ,python-mutagen) ;; for audio support ("python-pycairo" ,python-pycairo) ;; for PDF support ("poppler", poppler) ;; for PDF support ("gdk-pixbuf", gdk-pixbuf) ;; for images support ("librsvg" ,librsvg) ;; for svg support ("ffmpeg" ,ffmpeg) ;; optional, for video support ("perl-image-exiftool", perl-image-exiftool) ;; for everything else ;; ("bubblewrap", bubblewrap) ;; optional, for sandboxing ("python-pygobject" ,python-pygobject) ;; used in tests )) ;; TODO (native-inputs `(("python-mutagen" ,python-mutagen) ;; for audio support ("python-pycairo" ,python-pycairo) ;; for PDF support ("poppler", poppler) ;; for PDF support ("gdk-pixbuf", gdk-pixbuf) ;; for images support ("librsvg" ,librsvg) ;; for svg support ("ffmpeg" ,ffmpeg) ;; optional, for video support ("perl-image-exiftool", perl-image-exiftool) ;; for everything else ;; ("bubblewrap", bubblewrap) ;; optional, for sandboxing ("python-pygobject" ,python-pygobject) ;; used in tests )) ;; TODO (propagated-inputs `(("python-mutagen" ,python-mutagen) ;; for audio support ("python-pycairo" ,python-pycairo) ;; for PDF support ("poppler", poppler) ;; for PDF support ("gdk-pixbuf", gdk-pixbuf) ;; for images support ("librsvg" ,librsvg) ;; for svg support ("ffmpeg" ,ffmpeg) ;; optional, for video support ("perl-image-exiftool", perl-image-exiftool) ;; for everything else ;; ("bubblewrap", bubblewrap) ;; optional, for sandboxing ("python-pygobject" ,python-pygobject) ;; used in tests )) ;; TODO ;; (arguments ;; `(#:tests? #f )) (arguments `(#:phases (modify-phases %standard-phases (add-after 'unpack 'fix-tests (lambda _ (substitute* "libmat2/exiftool.py" (("/usr/bin/vendor_perl/exiftool") (which "exiftool"))) ;; (substitute* "libmat2/bubblewrap.py" ;; (("shutil.which\\('bwrap'\\)") ;; (string-append "'" ;; (which "bwrap") ;; we have no bwrap for now ;; "'"))) (substitute* "libmat2/exiftool.py" (("shutil.which\\('exiftool'\\)") (string-append "'" (which "exiftool") "'"))) (substitute* "libmat2/video.py" (("shutil.which\\('ffmpeg'\\)") (string-append "'" (which "ffmpeg") "'"))) (substitute* (find-files "tests" "\\.py") (("^#!/usr/bin/env python3$") (which "python3"))) #t)) (delete 'check) (add-after 'install 'check (lambda _ ;; The Archlinux PKGBUILD uses that command for tests: (invoke "python" "-m" "unittest" "discover" "-v") #t))))) (synopsis "Metadata removal tool") (description "Metadata removal tool, supporting a wide range of commonly used file formats") (home-page "https://0xacab.org/jvoisin/mat2") (license license:gpl3+)))