* [PATCH] gnu: Add Handbrake. @ 2016-10-31 3:08 Eric Bavier 2016-10-31 8:09 ` Efraim Flashner 2016-10-31 9:30 ` Ricardo Wurmus 0 siblings, 2 replies; 6+ messages in thread From: Eric Bavier @ 2016-10-31 3:08 UTC (permalink / raw) To: guix-devel; +Cc: Eric Bavier * 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 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 = \ %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/packages/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=1 ./autogen.sh + set -e; cd $(GTK.build/); $(call fn.ABSOLUTE,$(GTK.src/))configure \ + $(GTK.CONFIGURE.extra) \ +- PKG_CONFIG_PATH=$(BUILD/)contrib/lib/pkgconfig \ ++ PKG_CONFIG_PATH=$(BUILD/)contrib/lib/pkgconfig$(if $(PKG_CONFIG_PATH),:)$(PKG_CONFIG_PATH) \ + CFLAGS="$(call fn.ARGS,GTK.GCC,.g .O *D ?extra)" \ + LDFLAGS="$(call fn.ARGS,GTK.GCC,?strip .g .O ?extra.exe)" \ + --prefix=$(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 © 2016 Kei Kebreau <kei@openmailbox.org> ;;; Copyright © 2016 Dmitry Nikolaev <cameltheman@gmail.com> ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca> +;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org> ;;; ;;; 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) #: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 Access 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?file=" + "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 bootstrapped + ("autoconf" ,autoconf) + ("curl" ,curl) ;not actually used, but tested for + ("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 unsupported + #:configure-flags '("--enable-gtk") + #: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 \\+= contrib") "# MODULES += contrib")) + #t)) + (add-before 'configure 'fix-x265-linking + (lambda _ + (substitute* "test/module.defs" + ;; Fix missing library during linking error + (("TEST.GCC.l =") "TEST.GCC.l = 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=" 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 selection +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 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] gnu: Add Handbrake. 2016-10-31 3:08 [PATCH] gnu: Add Handbrake Eric Bavier @ 2016-10-31 8:09 ` Efraim Flashner 2016-10-31 8:46 ` Efraim Flashner 2016-10-31 9:30 ` Ricardo Wurmus 1 sibling, 1 reply; 6+ messages in thread From: Efraim Flashner @ 2016-10-31 8:09 UTC (permalink / raw) To: Eric Bavier; +Cc: guix-devel [-- Attachment #1: Type: text/plain, Size: 9800 bytes --] 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 > > 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 = \ > %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/packages/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=1 ./autogen.sh > + set -e; cd $(GTK.build/); $(call fn.ABSOLUTE,$(GTK.src/))configure \ > + $(GTK.CONFIGURE.extra) \ > +- PKG_CONFIG_PATH=$(BUILD/)contrib/lib/pkgconfig \ > ++ PKG_CONFIG_PATH=$(BUILD/)contrib/lib/pkgconfig$(if $(PKG_CONFIG_PATH),:)$(PKG_CONFIG_PATH) \ > + CFLAGS="$(call fn.ARGS,GTK.GCC,.g .O *D ?extra)" \ > + LDFLAGS="$(call fn.ARGS,GTK.GCC,?strip .g .O ?extra.exe)" \ > + --prefix=$(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 © 2016 Kei Kebreau <kei@openmailbox.org> > ;;; Copyright © 2016 Dmitry Nikolaev <cameltheman@gmail.com> > ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca> > +;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org> > ;;; > ;;; 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 Access > 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?file=" > + "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 bootstrapped > + ("autoconf" ,autoconf) > + ("curl" ,curl) ;not actually used, but tested for > + ("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 unsupported > + #: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=wget 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 \\+= contrib") "# MODULES += contrib")) > + #t)) > + (add-before 'configure 'fix-x265-linking > + (lambda _ > + (substitute* "test/module.defs" > + ;; Fix missing library during linking error > + (("TEST.GCC.l =") "TEST.GCC.l = 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=" 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 selection > +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 > > -- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 801 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gnu: Add Handbrake. 2016-10-31 8:09 ` Efraim Flashner @ 2016-10-31 8:46 ` Efraim Flashner 0 siblings, 0 replies; 6+ messages in thread From: Efraim Flashner @ 2016-10-31 8:46 UTC (permalink / raw) To: Eric Bavier; +Cc: guix-devel [-- Attachment #1: Type: text/plain, Size: 4363 bytes --] On Mon, Oct 31, 2016 at 10:09:26AM +0200, Efraim Flashner wrote: > 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. ... > > #:use-module (gnu packages base) > > #:use-module (gnu packages bison) > > #:use-module (gnu packages cdrom) > > + #:use-module (gnu packages cmake) I'm not sure you need this one > > #:use-module (gnu packages compression) > > #:use-module (gnu packages curl) > > #:use-module (gnu packages databases) ... > > + ("libx264" ,libx264) > > + ("libx265" ,x265) > > + ("zlib" ,zlib))) > > + (arguments > > + `(#:tests? #f ;tests require Ruby and claim to be unsupported > > + #: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=wget eliminate the need for curl in native-inputs? > to answer some of my own questions, wget isn't natively there, using '--fetch=wget' with curl and no wget fails configuring. qsv: not packaged hwd: also breaks configure adding '--enable-x265' doesn't remove the need for the 'fix-x265-linking issue > > + #: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)))) I commented the autogen part out by accident and it didn't seem to be needed afterall. > > + (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 \\+= contrib") "# MODULES += contrib")) > > + #t)) > > + (add-before 'configure 'fix-x265-linking > > + (lambda _ > > + (substitute* "test/module.defs" > > + ;; Fix missing library during linking error > > + (("TEST.GCC.l =") "TEST.GCC.l = 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=" 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 selection > > +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 > > > > -- Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 801 bytes --] ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gnu: Add Handbrake. 2016-10-31 3:08 [PATCH] gnu: Add Handbrake Eric Bavier 2016-10-31 8:09 ` Efraim Flashner @ 2016-10-31 9:30 ` Ricardo Wurmus 2016-11-04 4:08 ` Eric Bavier 1 sibling, 1 reply; 6+ messages in thread From: Ricardo Wurmus @ 2016-10-31 9:30 UTC (permalink / raw) To: Eric Bavier; +Cc: guix-devel Eric Bavier <bavier@member.fsf.org> writes: > * 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. Yay, thanks for the patch! > 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 > > 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 = \ > %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/packages/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=1 ./autogen.sh > + set -e; cd $(GTK.build/); $(call fn.ABSOLUTE,$(GTK.src/))configure \ > + $(GTK.CONFIGURE.extra) \ > +- PKG_CONFIG_PATH=$(BUILD/)contrib/lib/pkgconfig \ > ++ PKG_CONFIG_PATH=$(BUILD/)contrib/lib/pkgconfig$(if $(PKG_CONFIG_PATH),:)$(PKG_CONFIG_PATH) \ > + CFLAGS="$(call fn.ARGS,GTK.GCC,.g .O *D ?extra)" \ > + LDFLAGS="$(call fn.ARGS,GTK.GCC,?strip .g .O ?extra.exe)" \ > + --prefix=$(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 © 2016 Kei Kebreau <kei@openmailbox.org> > ;;; Copyright © 2016 Dmitry Nikolaev <cameltheman@gmail.com> > ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca> > +;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org> > ;;; > ;;; 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 line is not needed (it’s a duplicate of what’s three lines above). > #: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 Access > 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?file=" > + "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"))))) Please use '(begin … #t) here. > + (build-system glib-or-gtk-build-system) > + (native-inputs > + `(("automake" ,automake) ;gui subpackage must be bootstrapped > + ("autoconf" ,autoconf) > + ("curl" ,curl) ;not actually used, but tested for > + ("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 unsupported > + #:configure-flags '("--enable-gtk") > + #: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"))) I don’t think “setenv” is limited to the “begin” block as it has a side-effect. You could pull the “setenv” outside of the “and” expression. > + ;; 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 \\+= contrib") "# MODULES += contrib")) > + #t)) > + (add-before 'configure 'fix-x265-linking > + (lambda _ > + (substitute* "test/module.defs" > + ;; Fix missing library during linking error > + (("TEST.GCC.l =") "TEST.GCC.l = 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=" 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 selection > +of modern, widely supported codecs.") > + ;; Most under GPL version 2, and portions under BSD 3 Clause > + (license (list license:gpl2 license:bsd-3)))) Okay! ~~ Ricardo ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] gnu: Add Handbrake. 2016-10-31 9:30 ` Ricardo Wurmus @ 2016-11-04 4:08 ` Eric Bavier 2016-11-12 11:37 ` Ludovic Courtès 0 siblings, 1 reply; 6+ messages in thread From: Eric Bavier @ 2016-11-04 4:08 UTC (permalink / raw) To: Ricardo Wurmus; +Cc: guix-devel, Eric Bavier [-- Attachment #1: Type: text/plain, Size: 1054 bytes --] On Mon, 31 Oct 2016 10:30:40 +0100 Ricardo Wurmus <rekado@elephly.net> wrote: > Eric Bavier <bavier@member.fsf.org> writes: > > > * 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. > > Yay, thanks for the patch! Thanks for the feedback! I've incorporated your and Efraim's suggestions in the attached patch. The resulting Handbrake mostly works, but the default transcoding presets and gui icons are missing. I've done as much as I can to debug this, but I can't put any more time into it. I could commit this as-is and fix it later, or someone else could pick it up. Handbrake bundles quite a few libraries, often with non-trivial patches. This package modifies the build a bit to use system libraries (something the handbrake devs emphatically do *not* support). I wouldn't feel comfortable using the bundled libraries until there was a more comprehensive assesment of the library versions and the patches made. `~Eric [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-gnu-Add-Handbrake.patch --] [-- Type: text/x-patch, Size: 9555 bytes --] From b5c9a644a71e664b86662aab9b636046fd6e5220 Mon Sep 17 00:00:00 2001 From: Eric Bavier <bavier@member.fsf.org> Date: Fri, 25 Dec 2015 20:29:09 -0600 Subject: [PATCH] gnu: Add Handbrake. * 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 | 24 +++++ gnu/packages/video.scm | 109 +++++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 gnu/packages/patches/handbrake-pkg-config-path.patch 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 = \ %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/packages/patches/handbrake-pkg-config-path.patch new file mode 100644 index 0000000..18f3953 --- /dev/null +++ b/gnu/packages/patches/handbrake-pkg-config-path.patch @@ -0,0 +1,24 @@ +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=1 ./autogen.sh + set -e; cd $(GTK.build/); $(call fn.ABSOLUTE,$(GTK.src/))configure \ + $(GTK.CONFIGURE.extra) \ +- PKG_CONFIG_PATH=$(BUILD/)contrib/lib/pkgconfig \ ++ PKG_CONFIG_PATH=$(BUILD/)contrib/lib/pkgconfig$(if $(PKG_CONFIG_PATH),:)$(PKG_CONFIG_PATH) \ + CFLAGS="$(call fn.ARGS,GTK.GCC,.g .O *D ?extra)" \ + LDFLAGS="$(call fn.ARGS,GTK.GCC,?strip .g .O ?extra.exe)" \ + --prefix=$(PREFIX) \ +--- Handbrake-0.10.5-0.77d09e9-checkout/make/include/contrib.defs 1969-12-31 18:00:00.000000000 -0600 ++++ Handbrake-0.10.5-0.77d09e9-checkout/make/include/contrib.defs 2016-11-01 13:11:43.826144311 -0500 +@@ -119,7 +119,7 @@ + endif + $(1).CONFIGURE.env.CPPFLAGS = CPPFLAGS="-I$$(call fn.ABSOLUTE,$(CONTRIB.build/))include $$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra *D)" + $(1).CONFIGURE.env.LDFLAGS = LDFLAGS="-L$$(call fn.ABSOLUTE,$(CONTRIB.build/))lib $$(call fn.ARGS,$(1).GCC,*archs *sysroot *minver ?extra.exe *D)" +- $(1).CONFIGURE.env.PKG_CONFIG_PATH = PKG_CONFIG_PATH="$$(call fn.ABSOLUTE,$$(CONTRIB.build/))lib/pkgconfig" ++ $(1).CONFIGURE.env.PKG_CONFIG_PATH = PKG_CONFIG_PATH="$$(call fn.ABSOLUTE,$$(CONTRIB.build/))lib/pkgconfig$(if $(PKG_CONFIG_PATH),:)$(PKG_CONFIG_PATH)" + + $(1).CONFIGURE.env.args = !CC !CFLAGS !CXX !CXXFLAGS !CPPFLAGS !LD !LDFLAGS !PKG_CONFIG_PATH !LOCAL_PATH !CROSS + $(1).CONFIGURE.env = $$(call fn.ARGS,$(1).CONFIGURE.env,$$($(1).CONFIGURE.env.args)) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index e9e419c..df1edbc 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2016 Kei Kebreau <kei@openmailbox.org> ;;; Copyright © 2016 Dmitry Nikolaev <cameltheman@gmail.com> ;;; Copyright © 2016 Andy Patterson <ajpatter@uwaterloo.ca> +;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -50,6 +51,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 +65,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 +89,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 +1690,106 @@ specifications.") (description "libaacs is a library which implements the Advanced Access 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?file=" + "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. + '(begin + (for-each delete-file-recursively '("contrib" "macosx" "win")) + #t)))) + (build-system glib-or-gtk-build-system) + (native-inputs + `(("automake" ,automake) ;gui subpackage must be bootstrapped + ("autoconf" ,autoconf) + ("curl" ,curl) ;not actually used, but tested for + ("intltool" ,intltool) + ("libtool" ,libtool) + ("pkg-config" ,pkg-config) + ("python" ,python-2))) ;for configuration + (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) + ("x265" ,x265) + ("zlib" ,zlib))) + (arguments + `(#:tests? #f ;tests require Ruby and claim to be unsupported + #: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")) + (setenv "NOCONFIGURE" "1") + ;; Patch the Makefile so that it doesn't bootstrap again. + (substitute* "gtk/module.rules" + ((".*autogen\\.sh.*") "")) + (zero? (system* "sh" "./gtk/autogen.sh")))) + (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 \\+= contrib") "# MODULES += contrib")) + #t)) + (add-before 'configure 'fix-x265-linking + (lambda _ + (substitute* "test/module.defs" + ;; Fix missing library during linking error + (("TEST.GCC.l =") "TEST.GCC.l = 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=" 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 selection +of modern, widely supported codecs.") + ;; Most under GPL version 2 or later, and portions under BSD 3 Clause + (license (list license:gpl2+ license:bsd-3)))) -- 2.10.2 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] gnu: Add Handbrake. 2016-11-04 4:08 ` Eric Bavier @ 2016-11-12 11:37 ` Ludovic Courtès 0 siblings, 0 replies; 6+ messages in thread From: Ludovic Courtès @ 2016-11-12 11:37 UTC (permalink / raw) To: Eric Bavier; +Cc: guix-devel, Eric Bavier Eric Bavier <ericbavier@centurylink.net> skribis: > On Mon, 31 Oct 2016 10:30:40 +0100 > Ricardo Wurmus <rekado@elephly.net> wrote: > >> Eric Bavier <bavier@member.fsf.org> writes: >> >> > * 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. >> >> Yay, thanks for the patch! > > Thanks for the feedback! I've incorporated your and Efraim's > suggestions in the attached patch. > > The resulting Handbrake mostly works, but the default transcoding > presets and gui icons are missing. I've done as much as I can to debug > this, but I can't put any more time into it. I could commit this > as-is and fix it later, or someone else could pick it up. There are other packages with missing icons, I think this can be fixed separately. So I’d say you can commit it. Thank you, Ludo’. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-11-12 11:37 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-10-31 3:08 [PATCH] gnu: Add Handbrake Eric Bavier 2016-10-31 8:09 ` Efraim Flashner 2016-10-31 8:46 ` Efraim Flashner 2016-10-31 9:30 ` Ricardo Wurmus 2016-11-04 4:08 ` Eric Bavier 2016-11-12 11:37 ` Ludovic Courtès
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.