From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: Re: [PATCH] gnu: Add Handbrake. Date: Mon, 31 Oct 2016 10:09:26 +0200 Message-ID: <20161031080926.GF18185@macbook42.flashner.co.il> References: <20161031030822.10785-1-bavier@member.fsf.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="NY6JkbSqL3W9mApi" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c17ex-0003JZ-8i for guix-devel@gnu.org; Mon, 31 Oct 2016 04:09:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c17es-0000AQ-TZ for guix-devel@gnu.org; Mon, 31 Oct 2016 04:09:35 -0400 Received: from flashner.co.il ([178.62.234.194]:60897) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c17es-00009O-GK for guix-devel@gnu.org; Mon, 31 Oct 2016 04:09:30 -0400 Content-Disposition: inline In-Reply-To: <20161031030822.10785-1-bavier@member.fsf.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Eric Bavier Cc: guix-devel@gnu.org --NY6JkbSqL3W9mApi Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Oct 30, 2016 at 10:08:22PM -0500, Eric Bavier wrote: > * gnu/packages/video.scm (handbrake): New variable. > * gnu/packages/patches/handbrake-pkg-config-path.patch: New patch. > * gnu/local.mk (dist_patch_DATA): Add it. > --- > gnu/local.mk | 1 + > .../patches/handbrake-pkg-config-path.patch | 13 +++ > gnu/packages/video.scm | 114 +++++++++++++++= ++++++ > 3 files changed, 128 insertions(+) > create mode 100644 gnu/packages/patches/handbrake-pkg-config-path.patch >=20 > diff --git a/gnu/local.mk b/gnu/local.mk > index a64b7ec..1cdcf42 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -589,6 +589,7 @@ dist_patch_DATA =3D \ > %D%/packages/patches/gtk3-respect-GUIX_GTK3_PATH.patch \ > %D%/packages/patches/gtk3-respect-GUIX_GTK3_IM_MODULE_FILE.patch \ > %D%/packages/patches/gtkglext-disable-disable-deprecated.patch \ > + %D%/packages/patches/handbrake-pkg-config-path.patch \ > %D%/packages/patches/hdf4-architectures.patch \ > %D%/packages/patches/hdf4-reproducibility.patch \ > %D%/packages/patches/hdf4-shared-fortran.patch \ > diff --git a/gnu/packages/patches/handbrake-pkg-config-path.patch b/gnu/p= ackages/patches/handbrake-pkg-config-path.patch > new file mode 100644 > index 0000000..fafdb99 > --- /dev/null > +++ b/gnu/packages/patches/handbrake-pkg-config-path.patch > @@ -0,0 +1,13 @@ > +Do not clobber PKG_CONFIG_PATH during configure. > + > +--- HandBrake-0.10.5/gtk/module.rules.orig 2016-02-11 14:14:05.000000000= -0600 > ++++ HandBrake-0.10.5/gtk/module.rules 2016-10-29 22:27:50.550960848 -0500 > +@@ -15,7 +15,7 @@ > + set -e; cd $(GTK.src/); NOCONFIGURE=3D1 ./autogen.sh > + set -e; cd $(GTK.build/); $(call fn.ABSOLUTE,$(GTK.src/))configure \ > + $(GTK.CONFIGURE.extra) \ > +- PKG_CONFIG_PATH=3D$(BUILD/)contrib/lib/pkgconfig \ > ++ PKG_CONFIG_PATH=3D$(BUILD/)contrib/lib/pkgconfig$(if $(PKG_CONFIG_PAT= H),:)$(PKG_CONFIG_PATH) \ > + CFLAGS=3D"$(call fn.ARGS,GTK.GCC,.g .O *D ?extra)" \ > + LDFLAGS=3D"$(call fn.ARGS,GTK.GCC,?strip .g .O ?extra.exe)" \ > + --prefix=3D$(PREFIX) \ > diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm > index e9e419c..c7cc27a 100644 > --- a/gnu/packages/video.scm > +++ b/gnu/packages/video.scm > @@ -11,6 +11,7 @@ > ;;; Copyright =C2=A9 2016 Kei Kebreau > ;;; Copyright =C2=A9 2016 Dmitry Nikolaev > ;;; Copyright =C2=A9 2016 Andy Patterson > +;;; Copyright =C2=A9 2016 Eric Bavier > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -42,6 +43,7 @@ > #:use-module (guix build-system glib-or-gtk) > #:use-module (guix build-system python) > #:use-module (guix build-system waf) > + #:use-module (guix build-system glib-or-gtk) this one is extra, it's there 3 lines up :) > #:use-module (gnu packages) > #:use-module (gnu packages algebra) > #:use-module (gnu packages audio) > @@ -50,6 +52,7 @@ > #:use-module (gnu packages base) > #:use-module (gnu packages bison) > #:use-module (gnu packages cdrom) > + #:use-module (gnu packages cmake) > #:use-module (gnu packages compression) > #:use-module (gnu packages curl) > #:use-module (gnu packages databases) > @@ -63,11 +66,14 @@ > #:use-module (gnu packages gl) > #:use-module (gnu packages glib) > #:use-module (gnu packages guile) > + #:use-module (gnu packages gnome) > #:use-module (gnu packages gnupg) > + #:use-module (gnu packages gstreamer) > #:use-module (gnu packages gtk) > #:use-module (gnu packages image) > #:use-module (gnu packages linux) > #:use-module (gnu packages lua) > + #:use-module (gnu packages m4) > #:use-module (gnu packages mp3) > #:use-module (gnu packages ncurses) > #:use-module (gnu packages ocr) > @@ -84,6 +90,7 @@ > #:use-module (gnu packages tls) > #:use-module (gnu packages version-control) > #:use-module (gnu packages web) > + #:use-module (gnu packages webkit) > #:use-module (gnu packages xdisorg) > #:use-module (gnu packages xiph) > #:use-module (gnu packages xml) > @@ -1684,3 +1691,110 @@ specifications.") > (description "libaacs is a library which implements the Advanced Acc= ess > Content System specification.") > (license license:lgpl2.1+))) > + > +(define-public handbrake > + (package > + (name "handbrake") > + (version "0.10.5") > + (source (origin > + (method url-fetch) > + (uri (string-append "https://handbrake.fr/rotation.php?fil= e=3D" > + "HandBrake-" version ".tar.bz2")) > + (file-name (string-append "handbrake-" version ".tar.bz2")) > + (sha256 > + (base32 > + "1w720y3bplkz187wgvy4a4xm0vpppg45mlni55l6yi8v2bfk14pv")) > + (patches (search-patches "handbrake-pkg-config-path.patch"= )) > + (modules '((guix build utils))) > + (snippet > + ;; Remove bundled libraries and source not necessary for > + ;; running under a GNU environment. > + '(for-each delete-file-recursively '("contrib" "macosx" "= win"))))) > + (build-system glib-or-gtk-build-system) > + (native-inputs > + `(("automake" ,automake) ;gui subpackage must be bootstra= pped > + ("autoconf" ,autoconf) > + ("curl" ,curl) ;not actually used, but tested f= or > + ("intltool" ,intltool) > + ("libtool" ,libtool) > + ("pkg-config" ,pkg-config) > + ("python" ,python-2) ;for configuration > + ("yasm" ,yasm))) > + (inputs > + `(("bzip2" ,bzip2) > + ("dbus-glib" ,dbus-glib) > + ("ffmpeg" ,ffmpeg) > + ("fontconfig" ,fontconfig) > + ("freetype" ,freetype) > + ("glib" ,glib) > + ("gstreamer" ,gstreamer) > + ("gst-plugins-base" ,gst-plugins-base) > + ("gtk+" ,gtk+) > + ("lame" ,lame) > + ("libass" ,libass) > + ("libbluray" ,libbluray) > + ("libdvdnav" ,libdvdnav) > + ("libdvdread" ,libdvdread) > + ("libgudev" ,libgudev) > + ("libmpeg2" ,libmpeg2) > + ("libnotify" ,libnotify) > + ("libogg" ,libogg) > + ("libsamplerate" ,libsamplerate) > + ("libtheora" ,libtheora) > + ("libvorbis" ,libvorbis) > + ("libvpx" ,libvpx) > + ("libxml2" ,libxml2) > + ("libx264" ,libx264) > + ("libx265" ,x265) > + ("zlib" ,zlib))) > + (arguments > + `(#:tests? #f ;tests require Ruby and claim to be unsup= ported > + #:configure-flags '("--enable-gtk") I looked to see if there was the --ignore-options-i-dont-understand flag and I didn't see it. Do we need any of the other flags? --disable-gtk-update-checks --enable-qsv (intel quick sync, if we support it) --enable-hwd --enable-x265 would --fetch=3Dwget eliminate the need for curl in native-inputs? > + #:phases > + (modify-phases %standard-phases > + (add-before 'patch-source-shebangs 'bootstrap-gtk > + ;; Run bootstrap ahead of time so that shebangs get patched. > + (lambda _ > + (setenv "CONFIG_SHELL" (which "sh")) > + (and > + (begin > + (setenv "NOCONFIGURE" "1") > + (zero? (system* "sh" "./gtk/autogen.sh"))) > + ;; Patch the Makefile so that it doesn't bootstrap again. > + (begin > + (substitute* "gtk/module.rules" > + ((".*autogen\\.sh.*") "")) > + #t)))) > + (add-before 'configure 'disable-contrib > + (lambda _ > + (substitute* "make/include/main.defs" > + ;; Disable unconditional inclusion of some "contrib" > + ;; libraries (ffmpeg, libvpx, libdvdread, libdvdnav, > + ;; and libbluray), which would lead to fetching and > + ;; building of these libraries. Use our own instead. > + (("MODULES \\+=3D contrib") "# MODULES +=3D contrib")) > + #t)) > + (add-before 'configure 'fix-x265-linking > + (lambda _ > + (substitute* "test/module.defs" > + ;; Fix missing library during linking error > + (("TEST.GCC.l =3D") "TEST.GCC.l =3D x265")) > + #t)) > + (replace 'configure > + (lambda* (#:key outputs configure-flags #:allow-other-keys) > + ;; 'configure' is not an autoconf-generated script, and > + ;; errors on unrecognized arguments, > + ;; e.g. --enable-fast-install > + (let ((out (assoc-ref outputs "out"))) > + (zero? (apply system* "./configure" > + (string-append "--prefix=3D" out) > + (or configure-flags '())))))) > + (add-after 'configure 'chdir-build > + (lambda _ (chdir "./build") #t))))) > + (home-page "https://handbrake.fr") > + (synopsis "Video transcoder") > + (description > + "HandBrake is a tool for converting video from any format to a sele= ction > +of modern, widely supported codecs.") > + ;; Most under GPL version 2, and portions under BSD 3 Clause > + (license (list license:gpl2 license:bsd-3)))) > -- > 2.10.0 >=20 >=20 --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --NY6JkbSqL3W9mApi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJYFvw1AAoJEPTB05F+rO6Tx+MP/jaBywVVPCEA51aOqqG7C8nn VcByeQ+k70xjT4MiQT4/Etnq/KiISIKrLQKvG8QUPfxnIMrByksjJjWQlpz5zUdH sJnuFxRjVkHgEKkJunjGYOFh9Gdzx66lairpZUSRlsDYbf6anYnFesj9mjMqvIKR Ee5YMxze5qiXeGV8Bej8Kd2+yrFJu3uOdpLgeQCzBDTjstFQuqc0H7vgthK4GnGE nEFeZKRplNRSBNkvhQgBnBzZZw6zdP0zSWBWcq8ZZ6yS57RS5ttlwXY3bK8bXO6D hff7/GgI53PYypDDyK5KIv7do76jBxCksTccpQDhC7XSCHCgglQEU0sU9IE6Q0Wy 3Ni6UrumL/igkZ/sv+jz9ftx40GYyBy4EiKwwEUtIxmWnkkGbW35fWOHEb3UiFT5 ls5IvaDu4OFjfnzbwr31HY5ofi/QkW7p7YKRyF3Z6yfBk09Kc9AOjxd184NRzOpy SRb0fIlI9KigmBAd6Oyf7eug4MbfDdTQz27+OGNc3XPdL8XFmE1ICHr9SkjKVkYi 2UNdj8X0KegFenxG41l1azuOcUBnUSj49nvCRTpbBz5kxbFMASBTejmr9wQHMrhA KErB/Eorpi/YO+F4aN+4QRaaCzQ7aMk7eK9q1DP70mLenKtW0ZC+RHS613cODohL 11WhSZ9ifLsBkQAYDTm8 =C4KT -----END PGP SIGNATURE----- --NY6JkbSqL3W9mApi--