all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
To: 31307@debbugs.gnu.org
Subject: [bug#31307] [PATCH] Add MAT, the Metadata Anonymisation Toolkit
Date: Mon, 8 Nov 2021 02:34:16 +0100	[thread overview]
Message-ID: <20211108023416.6b7609f9@primary_laptop> (raw)
In-Reply-To: <87wowrj9kq.fsf@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 563 bytes --]

Hi,

I found while browsing debbugs.gnu.org, and I've started working on
adding MAT2.

I've got it working, so I'm attaching my work as-is to avoid
duplication of work. Tests probably need to be disabled for it to work.

I didn't submit it yet because not only the package needs some cleanups
(that could have been fixed), but more importantly I also wanted to make
tests work as I was afraid that getting this package wrong could have
bad consequences for people if for some reasons it didn't cleanup the
metadata due to packaging issues.

Denis.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: mat2.scm --]
[-- Type: text/x-scheme, Size: 5749 bytes --]

;;; Copyright © 2021 Denis Carikli <GNUtoo@cyberdimension.org>
;;;
;;; 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 <http://www.gnu.org/licenses/>.
(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+)))


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      parent reply	other threads:[~2021-11-08  1:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-28 21:38 [bug#31307] [PATCH] Add MAT, the Metadata Anonymisation Toolkit from Boum Chris Marusich
2018-04-28 22:11 ` Nils Gillmann
2018-04-29  3:09   ` Chris Marusich
2018-04-29  8:18     ` Chris Marusich
2018-05-02  6:00     ` Chris Marusich
2018-05-02  6:12       ` Nils Gillmann
2018-05-05 20:33 ` Ludovic Courtès
2018-05-05 21:37   ` Chris Marusich
2018-05-06 19:26     ` Leo Famulari
2018-05-06 19:44   ` Leo Famulari
2018-06-15  7:06     ` Ludovic Courtès
2018-07-05  8:29       ` Chris Marusich
2018-06-16 13:42     ` Nils Gillmann
2021-09-13  2:26       ` Sarah Morgensen
2021-11-08  1:34 ` Denis 'GNUtoo' Carikli [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211108023416.6b7609f9@primary_laptop \
    --to=gnutoo@cyberdimension.org \
    --cc=31307@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.