Subject: bug#27434: closed (Re: [bug#27434] [PATCH] gnu: Add mkvtoolnix.)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 30 Jun 2017 16:46:03 +0000

Your bug report

#27434: [PATCH] gnu: Add mkvtoolnix.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
27434: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=27434
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#27434] [PATCH] gnu: Add mkvtoolnix.
From: Leo Famulari <[email-masked]>
To: Gregor Giesen <[email-masked]>
Cc: [email-masked]
Date: Fri, 30 Jun 2017 12:45:46 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

On Sun, Jun 25, 2017 at 05:43:31PM +0200, Gregor Giesen wrote:
> Dear Leo,
> 
> I had another look at those libraries:
> 
> On Sun, Jun 25, 2017 at 09:44:01AM -0400, Leo Famulari wrote:
> > I noticed it includes some files in 'lib/', and at least some of them
> > appear to be bundled copies of 3rd-party libraries:
> >
> > drwxr-xr-x 1 leo leo 194 May 20 13:25 libebml       -> libebml
> > drwxr-xr-x 1 leo leo 236 May 20 13:25 libmatroska   -> libmatroska
> > drwxr-xr-x 1 leo leo  70 May 20 13:25 nlohmann-json -> nlohmann-json-cpp
> > drwxr-xr-x 1 leo leo  26 May 20 13:25 pugixml       -> pugixml
> > drwxr-xr-x 1 leo leo  18 May 20 13:25 utf8-cpp      -> utfcpp
> those can be removed, they are already included in ‘inputs’ and the 
> configure script favours the system (guix) lib over them.
> 
> The remaining three libraries are referenced directly from the source
> code. Here are comments from README.md:
> 
> > drwxr-xr-x 1 leo leo  66 May 20 13:25 boost
> --8<---------------cut here---------------start------------->8---
> A class, `utf8_codecvt_facet`, derived from `std::codecvt<wchar_t, char>`,
> which can be used to convert utf8 data in files into `wchar_t` strings
> in the application.
> 
>   * License: Boost Software License - Version 1.0 (see `doc/licenses/Boost-1.0.txt`)
>   * URL: http://www.boost.org
> --8<---------------cut here----------------end-------------->8---
> 
> The other two are some ancient and orphaned libraries for deprecated
> video formats, however GPLv2/LGPLv2.1:
> 
> > drwxr-xr-x 1 leo leo 116 May 20 13:25 avilib-0.6.10
> --8<---------------cut here---------------start------------->8---
> Reading and writing avi files.
> 
> Copyright (C) 1999 Rainer Johanni <[email-masked]>, originally part
> of the transcode package.
> 
>   * License: GNU General Public License v2
>   * URL: http://www.transcoding.org/
> 
> > drwxr-xr-x 1 leo leo 120 May 20 13:25 librmff
> librmff is short for 'RealMedia file format access library'. It aims
> at providing the programmer an easy way to read and write RealMedia
> files.
> 
>   * License: GNU Lesser General Public License v2.1 (see `doc/licenses/LGPL-2.1.txt`)
>   * URL: https://www.bunkus.org/videotools/librmff/index.html
> --8<---------------cut here----------------end-------------->8---
> 
> Is it ok to just include them and adding those two licenses the package?

Thank you very much for investigating, and I'm sorry my response was
rather slow! I just pushed revisions of your patches, based on our
discussion, as 2973ebf504f4d958a8db40b09b210b237060fc92.

Subject: [PATCH] gnu: Add mkvtoolnix.
From: Gregor Giesen <[email-masked]>
To: [email-masked]
Date: Tue, 20 Jun 2017 23:54:33 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello everybody,

I have packed mkvtoolnix along with some dependencies.

Best,
Gregor
>From 84c9a44ca17f7e2bc07fd89ef245fc32d1a0ed7b Mon Sep 17 00:00:00 2001
From: Gregor Giesen <[email-masked]>
Date: Tue, 20 Jun 2017 23:47:33 +0200
Subject: [PATCH 1/1] gnu: Add mkvtoolnix.

* gnu/packages/serialization.scm (nlohmann-json-cpp): New variable.
* gnu/packages/video.scm (mkvtoolnix libmatroska): New variables.
* gnu/packages/xml.scm (libebml): New variable.
---
 gnu/packages/serialization.scm |  23 +++++++++
 gnu/packages/video.scm         | 113 +++++++++++++++++++++++++++++++++++++++++
 gnu/packages/xml.scm           |  21 ++++++++
 3 files changed, 157 insertions(+)

diff --git a/gnu/packages/serialization.scm b/gnu/packages/serialization.scm
index 6a3d8f900..7fdd20b57 100644
--- a/gnu/packages/serialization.scm
+++ b/gnu/packages/serialization.scm
@@ -5,6 +5,7 @@
 ;;; Copyright © 2016 Marius Bakke <[email-masked]>
 ;;; Copyright © 2016 Efraim Flashner <[email-masked]>
 ;;; Copyright © 2017 Corentin Bocquillon <[email-masked]>
+;;; Copyright © 2017 Gregor Giesen <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -328,3 +329,25 @@ RPC system.  Think JSON, except binary.  Or think Protocol Buffers, except faste
 convert JSON documents to BSON and the opposite.  BSON stands for Binary JSON,
 it is comparable to protobuf.")
     (license license:asl2.0)))
+
+(define-public nlohmann-json-cpp
+  (package
+    (name "nlohmann-json-cpp")
+    (version "2.1.1")
+    (source
+     (origin
+      (method url-fetch)
+      (uri (string-append "https://github.com/nlohmann/json/"
+                          "archive/v" version ".tar.gz"))
+      (file-name (string-append name "-" version ".tar.gz"))
+      (sha256
+       (base32
+        "0lrh6cjd643c7kmvmwafbgq7dqj3b778483gjhjbvp6rc6z5xf2r"))))
+    (build-system cmake-build-system)
+    (home-page "https://nlohmann.github.io/json/")
+    (synopsis "JSON library for C++")
+    (description
+     "JSON library for C++ trying to accomplish “Intuitive syntax”,
+“Trivial integration”, and “Serious testing”.
+However, “Memory efficiency” and “Speed” have not been primary goals.")
+    (license license:x11)))
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index ec81bc1a1..f8166c233 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2017 Thomas Danckaert <[email-masked]>
 ;;; Copyright © 2017 Ethan R. Jones <[email-masked]>
 ;;; Copyright © 2017 Clément Lassieur <[email-masked]>
+;;; Copyright © 2017 Gregor Giesen <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -57,14 +58,18 @@
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages boost)
   #:use-module (gnu packages cdrom)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages cmake)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages cpp)
   #:use-module (gnu packages curl)
   #:use-module (gnu packages databases)
   #:use-module (gnu packages dejagnu)
+  #:use-module (gnu packages docbook)
   #:use-module (gnu packages elf)
+  #:use-module (gnu packages file)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages freedesktop)
@@ -93,7 +98,10 @@
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
   #:use-module (gnu packages qt)
+  #:use-module (gnu packages ruby)
   #:use-module (gnu packages sdl)
+  #:use-module (gnu packages serialization)
+  #:use-module (gnu packages shells)
   #:use-module (gnu packages ssh)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages textutils)
@@ -272,6 +280,83 @@ H.264 (MPEG-4 AVC) video streams.")
                     "file://extras/cl.h"
                     "See extras/cl.h in the distribution.")))))
 
+(define-public mkvtoolnix
+  (package
+    (name "mkvtoolnix")
+    (version "12.0.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://mkvtoolnix.download/sources/"
+                           name "-" version ".tar.xz"))
+       (sha256
+        (base32
+         "0dmmjizmxcr6agiwxii4135nkniw5yiab4dpgkas5n1nrk8h292w"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("boost" ,boost)
+       ("bzip2" ,bzip2)
+       ("libebml" ,libebml)
+       ("flac" ,flac)
+       ("file" ,file)
+       ("libmatroska" ,libmatroska)
+       ("libogg" ,libogg)
+       ("libvorbis" ,libvorbis)
+       ("lzo" ,lzo)
+       ("pugixml" ,pugixml)
+       ("qt" ,qt)
+       ("utfcpp" ,utfcpp)
+       ("zlib" ,zlib)))
+    (native-inputs
+     `(("docbook-xsl" ,docbook-xsl)
+       ("gettext" ,gettext-minimal)
+       ("googletest" ,googletest)
+       ("libxslt" ,libxslt)
+       ("nlohmann-json-cpp" ,nlohmann-json-cpp)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("po4a" ,po4a)
+       ("ruby" ,ruby)
+       ("zsh", zsh)))
+    (arguments
+     `(#:configure-flags
+       (list (string-append "--with-boost="
+                            (assoc-ref %build-inputs "boost"))
+             (string-append "--with-docbook-xsl-root="
+                            (assoc-ref %build-inputs "docbook-xsl")
+                            "/xml/xsl/docbook-xsl-"
+                            ,(package-version docbook-xsl))
+             (string-append "--with-extra-includes="
+                            (assoc-ref %build-inputs "nlohmann-json-cpp")
+                            "/include/nlohmann"))
+        #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'add-googletest
+           (lambda _
+             (symlink
+              (string-append (assoc-ref %build-inputs "googletest")
+                             "/include/gtest") "lib/gtest")
+             #t))
+         (replace 'build
+           (lambda _
+             (let ((-j (list "-j" (number->string (parallel-job-count)))))
+               (zero? (apply system* "rake" -j)))))
+         (replace 'check
+           (lambda _
+             (zero? (system* "rake" "tests/unit"))))
+         (replace 'install
+           (lambda _
+             (zero? (system* "rake" "install")))))))
+    (home-page "https://mkvtoolnix.download")
+    (synopsis "Tools to create, alter and inspect Matroska files")
+    (description
+     "With these tools one can get information about (via @code{mkvinfo}) 
+Matroska files, extract tracks/data from (via @code{mkvextract}) Matroska
+files and create (via @code{mkvmerge}) Matroska files from other media files.
+Matroska is a new multimedia file format aiming to become THE new container
+format for the future.")
+    (license license:gpl2)))
+
 (define-public x265
   (package
     (name "x265")
@@ -407,6 +492,34 @@ developed according to the official standards for DV video: IEC 61834 and
 SMPTE 314M.")
     (license license:lgpl2.1+)))
 
+(define-public libmatroska
+  (package
+    (name "libmatroska")
+    (version "1.4.7")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://dl.matroska.org/downloads/"
+                           name "/" name "-" version ".tar.bz2"))
+       (sha256
+        (base32
+         "1yi5cnv13nhl27xyqayd5l3sf0j3swfj3apzibv71yg9pariwi26"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("pkg-config" ,pkg-config)))
+    (inputs
+     `(("libebml" ,libebml)))
+    (home-page "https://www.matroska.org")
+    (synopsis "C++ libary to parse Matroska files (.mkv and .mka)")
+    (description
+     "Matroska aims to become the standard of multimedia container formats.
+It is based on EBML (Extensible Binary Meta Language), a binary derivative
+of XML.  EBML enables the Matroska Development Team to gain significant
+advantages in terms of future format extensibility, without breaking file
+support in old parsers.
+libebml is a C++ library to read and write EBML files.")
+    (license license:lgpl2.1)))
+
 (define-public libva
   (package
     (name "libva")
diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm
index 263c26e31..3f684ffe4 100644
--- a/gnu/packages/xml.scm
+++ b/gnu/packages/xml.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2016 Tobias Geerinckx-Rice <[email-masked]>
 ;;; Copyright © 2016, 2017 Marius Bakke <[email-masked]>
 ;;; Copyright © 2017 Adriano Peluso <[email-masked]>
+;;; Copyright © 2017 Gregor Giesen <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -87,6 +88,26 @@ things the parser might find in the XML document (like start tags).")
               (base32
                "11c8jy1wvllvlk7xdc5cm8hdhg0hvs8j0aqy6s702an8wkdcls0q"))))))
 
+(define-public libebml
+  (package
+    (name "libebml")
+    (version "1.3.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://dl.matroska.org/downloads/"
+                           name "/" name "-" version ".tar.bz2"))
+       (sha256
+        (base32
+         "11zka6z9ncywyjr1gfm5cnii33ln7y3w6s86kiacchip2g7kw3f5"))))
+    (build-system gnu-build-system)
+    (home-page "https://www.matroska.org")
+    (synopsis "C++ libary to parse EBML files")
+    (description
+     "libebml is a C++ library to read and write EBML files.
+EBML (Extensible Binary Meta Language) is a binary pendant to XML.")
+    (license license:lgpl2.1)))
+
 (define-public libxml2
   (package
     (name "libxml2")
-- 
2.13.1