Patchwork [1/2] gnu: Add nasm.

login
register
mail settings
Submitter Jan Nieuwenhuizen
Date June 18, 2016, 8:46 p.m.
Message ID <87ziqi8bst.fsf@gnu.org>
Download mbox | patch
Permalink /patch/13223/
State New
Headers show

Comments

Jan Nieuwenhuizen - June 18, 2016, 8:46 p.m.
Hi,

Trying to play an h264 video, I found this comment in gst-plugins-bad:

     ;; XXX: The following dependencies are missing:
     ;;  vo-amrwbenc, vo-aacenc, bs2b, chromaprint, directfb, daala, libdts,
     ;;  faac, flite, libgsm, libde265, libmms, libmimic, mjpegtools,
     ;;  mpeg2enc, libofa, opencv, openh264, openni2, libtimemmgr, wildmidi,

and packaged openh264 and its dependency nasm.  Find attached.

Later I found that h264 can be played by installing gst-libav.

As an aside, I wonder why gst-plugins-bad is made to depend on qt and
Wayland.

Greetings,
Jan
Alex Kost - June 19, 2016, 3:15 p.m.
> From bfe40f5a42edf702277a2580336138438cdb8a62 Mon Sep 17 00:00:00 2001
> From: Jan Nieuwenhuizen <janneke@gnu.org>
> Date: Sat, 18 Jun 2016 22:39:33 +0200
> Subject: [PATCH 1/2] gnu: Add nasm.
>
> * gnu/packages/nasm.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

It's not related to this patch directly, but I think eventually it's
better to put 'nasm' and 'yasm' in a single module (and to name it (gnu
packages assembly) for example).  'lightning' package can also go there.
Andreas Enge - June 20, 2016, 9:40 a.m.
Hello,

On Sat, Jun 18, 2016 at 10:46:58PM +0200, Jan Nieuwenhuizen wrote:
> Trying to play an h264 video, I found this comment in gst-plugins-bad:
>      ;; XXX: The following dependencies are missing:
>      ;;  vo-amrwbenc, vo-aacenc, bs2b, chromaprint, directfb, daala, libdts,
>      ;;  faac, flite, libgsm, libde265, libmms, libmimic, mjpegtools,
>      ;;  mpeg2enc, libofa, opencv, openh264, openni2, libtimemmgr, wildmidi,
> and packaged openh264 and its dependency nasm.  Find attached.

is it a hard dependency? It looks as if nasm will only work on x86; then
openh264 would not work on any other architecture, and if we add it to some
gst-plugins, these would also not work there (well, they do not work anyway,
but that is a different story...).

Andreas
Jan Nieuwenhuizen - June 20, 2016, 5:26 p.m.
Andreas Enge writes:

> is it a hard dependency?

I thought it was, just re-checked.  It is a hard dependency on i686 or
x86_64.

It seems gas is required for (a flavour of?) arm and otherwise you'll
get c/c++ fallback functions.  See

    https://github.com/cisco/openh264

> It looks as if nasm will only work on x86; then
> openh264 would not work on any other architecture, and if we add it to some
> gst-plugins, these would also not work there (well, they do not work anyway,
> but that is a different story...).

Yeah, so not sure.  gst-libav handles h264 already, but I'm not sure
what the downside there is.  gst-plugins-bad had this comment about
openh264 missing...

Greetings,
Jan
Ludovic Courtès - June 21, 2016, 10:29 a.m.
Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> From bfe40f5a42edf702277a2580336138438cdb8a62 Mon Sep 17 00:00:00 2001
> From: Jan Nieuwenhuizen <janneke@gnu.org>
> Date: Sat, 18 Jun 2016 22:39:33 +0200
> Subject: [PATCH 1/2] gnu: Add nasm.
>
> * gnu/packages/nasm.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.

Applied but to assembly.scm as Alex suggested; I also added a
‘supported-systems’ field.

Thanks!

Ludo’.

Patch

From 950266815f8e2d8d57492c71d3cf72efc0fd9fdd Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sat, 18 Jun 2016 22:40:51 +0200
Subject: [PATCH 2/2] gnu: Add openh264.

* gnu/packages/video.scm (openh264): New variable.
---
 gnu/packages/video.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 377caa9..2b4c99e 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -7,6 +7,7 @@ 
 ;;; Copyright © 2015 Andy Patterson <ajpatter@uwaterloo.ca>
 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2015 Alex Vong <alexvong1995@gmail.com>
+;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -58,6 +59,7 @@ 
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lua)
   #:use-module (gnu packages mp3)
+  #:use-module (gnu packages nasm)
   #:use-module (gnu packages ncurses)
   #:use-module (gnu packages ocr)
   #:use-module (gnu packages perl)
@@ -1475,3 +1477,29 @@  implementation.")
 your graphical desktop and encodes it as a video.  This is a useful tool for
 making @dfn{screencasts}.")
     (license license:gpl2+)))
+
+(define-public openh264
+  (package
+    (name "openh264")
+    (version "1.5.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/cisco/"
+                                  name "/archive/v" version ".tar.gz"))
+              (sha256
+               (base32
+                "1d97dh5hzmy46jamfw03flvcz8md1hxp6y5n0b787h8ks7apn1wq"))))
+    (build-system gnu-build-system)
+    (native-inputs `(("nasm" ,nasm)
+                     ("python" ,python)))
+    (arguments
+     `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
+       #:test-target "test"
+       #:phases (modify-phases %standard-phases
+                  ;; no configure script
+                  (delete 'configure))))
+    (home-page "http://www.openh264.org/")
+    (synopsis "H264 decoder library")
+    (description
+     "Openh264 is a library which can decode H264 video streams.")
+    (license license:bsd-3)))
-- 
2.8.4