Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Feb 2014 19:46:40 GMT
From:      Arjan Gijsberts <arjan@liralab.it>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/186387: Update port multimedia/handbrake to 0.9.9
Message-ID:  <201402021946.s12Jked1060594@oldred.freebsd.org>
Resent-Message-ID: <201402021950.s12Jo09T085250@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         186387
>Category:       ports
>Synopsis:       Update port multimedia/handbrake to 0.9.9
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 02 19:50:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Arjan Gijsberts
>Release:        10
>Organization:
>Environment:
FreeBSD localhost 10.0-RELEASE FreeBSD 10.0-RELEASE #34 r260687: Wed Jan 15 15:24:29 CET 2014     root@localhost:/usr/obj/usr/src/sys/CUSTOM amd64
>Description:
The current multimedia/handbrake port is outdated and fails to build on FreeBSD 10/11 due to gcc and iconv issues (see ports/183914).

The attached patch updates the port to the most recent upstream version 0.9.9. In this version, a number of bundled packages have been replaced with system libraries; these are now pulled in from the corresponding ports. Building with clang fails on the bundled version of mp4v2, so the port still depends on gcc. Finally, hardcoded dependencies on libiconv have been patched to allow the port to use the native iconv implementation in base.

I could only test the port on FreeBSD 10.0 without X11, so additional testing is definitely appreciated. This is my first non-trivial patch for a port, so comments on quality and style are equally appreciated.
>How-To-Repeat:

>Fix:
Patch attached.

Patch attached with submission follows:

Index: Makefile
===================================================================
--- Makefile	(revision 342361)
+++ Makefile	(working copy)
@@ -2,8 +2,8 @@
 # $FreeBSD$
 
 PORTNAME=	handbrake
-PORTVERSION=	0.9.8
-PORTREVISION=	2
+PORTVERSION=	0.9.9
+PORTREVISION=	1
 CATEGORIES=	multimedia
 MASTER_SITES=	SF/${PORTNAME}/${PORTVERSION} \
 		http://download.handbrake.fr/handbrake/contrib/:contrib
@@ -11,24 +11,16 @@
 		a52dec-0.7.4.tar.gz:contrib \
 		faac-1.28.tar.gz:contrib \
 		faad2-2.7.tar.gz:contrib \
-		ffmpeg-v0.7-1696-gcae4f4b.tar.bz2:contrib \
-		fontconfig-2.8.0.tar.gz:contrib \
-		freetype-2.4.7.tar.bz2:contrib \
+		libav-v9.6.tar.bz2:contrib \
 		lame-3.98.tar.gz:contrib \
-		libass-0.10.0-1.tar.gz:contrib \
-		libbluray-0.0.1-pre-213-ga869da8.tar.gz:contrib \
+		libbluray-0.2.3.tar.bz2:contrib \
 		libdca-r81-strapped.tar.gz:contrib \
 		libdvdnav-svn1168.tar.gz:contrib \
 		libdvdread-svn1168.tar.gz:contrib \
 		libmkv-0.6.5-0-g82075ae.tar.gz:contrib \
-		libogg-1.3.0.tar.gz:contrib \
-		libsamplerate-0.1.4.tar.gz:contrib \
-		libtheora-1.1.0.tar.bz2:contrib \
-		libvorbis-aotuv_b6.03.tar.bz2:contrib \
-		libxml2-2.7.7.tar.gz:contrib \
 		mp4v2-trunk-r355.tar.bz2:contrib \
 		mpeg2dec-0.5.1.tar.gz:contrib \
-		x264-r2146-bcd41db.tar.gz:contrib
+		x264-r2273-b3065e6.tar.gz:contrib
 DIST_SUBDIR=	${PORTNAME}
 
 MAINTAINER=	dmarion@FreeBSD.org
@@ -37,10 +29,22 @@
 LICENSE=	GPLv2
 
 BUILD_DEPENDS=	yasm:${PORTSDIR}/devel/yasm
-LIB_DEPENDS=	libfribidi.so:${PORTSDIR}/converters/fribidi
+LIB_DEPENDS=	libfontconfig.so:${PORTSDIR}/x11-fonts/fontconfig \
+		libfreetype.so:${PORTSDIR}/print/freetype2 \
+		libfribidi.so:${PORTSDIR}/converters/fribidi \
+		libxml2.so:${PORTSDIR}/textproc/libxml2 \
+		libass.so:${PORTSDIR}/multimedia/libass \
+		libogg.so:${PORTSDIR}/audio/libogg \
+		libvorbis.so:${PORTSDIR}/audio/libvorbis \
+		libvorbisenc.so:${PORTSDIR}/audio/libvorbis \
+		libtheoradec.so:${PORTSDIR}/multimedia/libtheora \
+		libtheoraenc.so:${PORTSDIR}/multimedia/libtheora \
+		libsamplerate.so:${PORTSDIR}/audio/libsamplerate
+		
 RUN_DEPENDS=	${LOCALBASE}/lib/libdvdcss.so:${PORTSDIR}/multimedia/libdvdcss
 
-USES=		gmake pkgconfig
+USES=		gmake pkgconfig iconv
+USE_GCC=	any
 USE_AUTOTOOLS=	libtool aclocal
 LIBTOOLFILES=	configure
 USE_PYTHON_BUILD=	yes
@@ -92,7 +96,7 @@
 # considered good in FreeBSD.  Instead, we will prepare everything manually.
 post-extract: .SILENT
 # Unversioned directories can be copied in a loop
-.for d in a52dec lame libdca libdvdnav libdvdread libsamplerate mpeg2dec x264
+.for d in a52dec lame libdca libdvdnav libdvdread mpeg2dec x264
 	${MKDIR} ${BUILD_WRKSRC}/contrib/${d}
 	${MV} ${WRKDIR}/${d} ${BUILD_WRKSRC}/contrib/${d}
 .endfor
@@ -102,21 +106,10 @@
 		libxml2 mp4v2
 	${MV} ${WRKDIR}/faac-1.28 ${BUILD_WRKSRC}/contrib/faac
 	${MV} ${WRKDIR}/faad2-2.7 ${BUILD_WRKSRC}/contrib/faad2
-	${MV} ${WRKDIR}/ffmpeg-v0.7-1696-gcae4f4b \
-		${BUILD_WRKSRC}/contrib/ffmpeg
-	${MV} ${WRKDIR}/fontconfig-2.8.0 ${BUILD_WRKSRC}/contrib/fontconfig
-	${MV} ${WRKDIR}/freetype-2.4.7 ${BUILD_WRKSRC}/contrib/freetype
-	${MV} ${WRKDIR}/libass-0.10.0-1 ${BUILD_WRKSRC}/contrib/libass
-	${MV} ${WRKDIR}/libbluray-0.0.1-pre-213-ga869da8 \
-		${BUILD_WRKSRC}/contrib/libbluray
+	${MV} ${WRKDIR}/libav-v9.6 ${BUILD_WRKSRC}/contrib/ffmpeg/libav-v9.6
+	${MV} ${WRKDIR}/libbluray-0.2.3 ${BUILD_WRKSRC}/contrib/libbluray
 	${MV} ${WRKDIR}/libmkv-0.6.5-0-g82075ae ${BUILD_WRKSRC}/contrib/libmkv
-	${MV} ${WRKDIR}/libogg-1.3.0 ${BUILD_WRKSRC}/contrib/libogg
-	${MV} ${WRKDIR}/libtheora-1.1.0 ${BUILD_WRKSRC}/contrib/libtheora
-	${MV} ${WRKDIR}/aotuv-b6.03_20110424 ${BUILD_WRKSRC}/contrib/libvorbis
-	${MV} ${WRKDIR}/libxml2-2.7.7 ${BUILD_WRKSRC}/contrib/libxml2
 	${MV} ${WRKDIR}/mp4v2-trunk-r355 ${BUILD_WRKSRC}/contrib/mp4v2
-# Remove one patch file that does not apply cleanly
-	${RM} ${WRKSRC}/contrib/fontconfig/A00-config.patch
 # Avoid conflict with `print/harfbuzz' (also installs "hb.h")
 	${MV} ${WRKSRC}/libhb/hb.h ${WRKSRC}/libhb/hb-of-handbrake.h
 
@@ -124,15 +117,24 @@
 	@${REINPLACE_CMD} -e 's|machine/soundcard|sys/soundcard|' \
 		${BUILD_WRKSRC}/contrib/a52dec/a52dec/libao/audio_out_oss.c
 	@${REINPLACE_CMD} -e 's|-ldl|-lc| ; s|\[dl\]|[c]|' \
-		${BUILD_WRKSRC}/contrib/libbluray/libbluray-0.0.1-pre-213-ga869da8/configure.ac
+		${BUILD_WRKSRC}/contrib/libbluray/libbluray-0.2.3/configure.ac
 	@${REINPLACE_CMD} -e 's|<malloc|<stdlib|' ${WRKSRC}/libhb/fifo.c
 	@${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' \
-		${WRKSRC}/contrib/libass/module.defs \
 		${WRKSRC}/libhb/module.defs ${WRKSRC}/test/module.defs
 	@${REINPLACE_CMD} -e 's|libdvdcss\.so\.2|libdvdcss.so|' \
 		${BUILD_WRKSRC}/contrib/libdvdread/libdvdread/src/dvd_input.c
 	@${FIND} ${WRKSRC} -type f -name '*.[ch]' -print0 | ${XARGS} -0 \
 		${REINPLACE_CMD} -e '/#include/s|hb\.h|hb-of-handbrake.h|'
+	@${REINPLACE_CMD} -e "s|ToolProbe( 'GCC.gcc',   'gcc',|ToolProbe( 'GCC.gcc',   '${CC}',|" \
+		${WRKSRC}/make/configure.py 
+	@${REINPLACE_CMD} -e 's|avcodec avformat avutil avresample|avformat avcodec avresample avutil|' \
+		${WRKSRC}/libhb/module.defs ${WRKSRC}/test/module.defs 
+.if empty(ICONV_LIB)	
+	@${REINPLACE_CMD} -e 's|iconv||' ${WRKSRC}/test/module.defs
+	@${REINPLACE_CMD} -e 's|LIBHB.GCC.l += iconv|LIBHB.GCC.l += |' ${WRKSRC}/libhb/module.defs
+.endif
+	${TR} -d '\r' < ${WRKSRC}/contrib/mpeg2dec/A02-gwluserdata.patch > ${WRKDIR}/A02-gwluserdata.patch
+	${MV} ${WRKDIR}/A02-gwluserdata.patch ${WRKSRC}/contrib/mpeg2dec/
 
 do-install:
 	${INSTALL_PROGRAM} ${BUILD_WRKSRC}/HandBrakeCLI ${PREFIX}/bin
Index: distinfo
===================================================================
--- distinfo	(revision 342361)
+++ distinfo	(working copy)
@@ -1,5 +1,5 @@
-SHA256 (handbrake/HandBrake-0.9.8.tar.bz2) = dba75a9ff772e419c01d75532c1bf0d7253e73d7ead184eee755cd4c133dc798
-SIZE (handbrake/HandBrake-0.9.8.tar.bz2) = 3156964
+SHA256 (handbrake/HandBrake-0.9.9.tar.bz2) = a71dd774104cda00cfb51a813550351d638253791f2f419d04a66f3158a835b3
+SIZE (handbrake/HandBrake-0.9.9.tar.bz2) = 9315199
 SHA256 (handbrake/a52dec-0.7.4.tar.gz) = 54981ab08fc09a675b9924372cf0cca5aa5363b918c4c19065c2d40e2858be47
 SIZE (handbrake/a52dec-0.7.4.tar.gz) = 242978
 SHA256 (handbrake/faac-1.28.tar.gz) = c5141199f4cfb17d749c36ba8cfe4b25f838da67c22f0fec40228b6b9c3d19df
@@ -6,18 +6,12 @@
 SIZE (handbrake/faac-1.28.tar.gz) = 678891
 SHA256 (handbrake/faad2-2.7.tar.gz) = ee26ed1e177c0cd8fa8458a481b14a0b24ca0b51468c8b4c8b676fd3ceccd330
 SIZE (handbrake/faad2-2.7.tar.gz) = 1137407
-SHA256 (handbrake/ffmpeg-v0.7-1696-gcae4f4b.tar.bz2) = f39b2ea8f47db9c84c9bb091707312cd19b927d8f4a957c20222add1a5dd2497
-SIZE (handbrake/ffmpeg-v0.7-1696-gcae4f4b.tar.bz2) = 4242565
-SHA256 (handbrake/fontconfig-2.8.0.tar.gz) = fa2a1c6eea654d9fce7a4b1220f10c99cdec848dccaf1625c01f076b31382335
-SIZE (handbrake/fontconfig-2.8.0.tar.gz) = 1548409
-SHA256 (handbrake/freetype-2.4.7.tar.bz2) = ba22620479954582371286268ef75e6e932c0270ee67d6797bbf3ed9d31a5d77
-SIZE (handbrake/freetype-2.4.7.tar.bz2) = 1490543
+SHA256 (handbrake/libav-v9.6.tar.bz2) = ea41941866fb64d7e363684a4705574f65786bd9eb0fe1f796dee4c0d459aa52
+SIZE (handbrake/libav-v9.6.tar.bz2) = 4672723
 SHA256 (handbrake/lame-3.98.tar.gz) = 40235e84dfe4760ad3f352590a64b7bda1502a386c97d06229df356426e37686
 SIZE (handbrake/lame-3.98.tar.gz) = 1411318
-SHA256 (handbrake/libass-0.10.0-1.tar.gz) = a0c652f4a5c1bfd58cd47ff627fff2dfbd471b40f765aa96fd1b251c0058b867
-SIZE (handbrake/libass-0.10.0-1.tar.gz) = 745314
-SHA256 (handbrake/libbluray-0.0.1-pre-213-ga869da8.tar.gz) = 4aa7127201a5d3d4148d99c37c7701ede6e0707456dacc8a59464dc68e231b76
-SIZE (handbrake/libbluray-0.0.1-pre-213-ga869da8.tar.gz) = 241927
+SHA256 (handbrake/libbluray-0.2.3.tar.bz2) = 2c65cfb02aeec31721f9ea65ee2c085a9bfe163e99dd01b52ccb3f53ba205eea
+SIZE (handbrake/libbluray-0.2.3.tar.bz2) = 465239
 SHA256 (handbrake/libdca-r81-strapped.tar.gz) = ab2519af6c2f12411a2bd674b83615af9b0d5fb09f28ad5dab714ea1bfab9df1
 SIZE (handbrake/libdca-r81-strapped.tar.gz) = 523282
 SHA256 (handbrake/libdvdnav-svn1168.tar.gz) = 7cf4ff6ab0b5d3db3c300fc3cdb24e1ad59f22dd90352df075a604bc698d01c7
@@ -26,19 +20,9 @@
 SIZE (handbrake/libdvdread-svn1168.tar.gz) = 946033
 SHA256 (handbrake/libmkv-0.6.5-0-g82075ae.tar.gz) = 7314a296c68f42b826164074a96e247e52d8ef9287c21ebc5fe1bf9e73643e97
 SIZE (handbrake/libmkv-0.6.5-0-g82075ae.tar.gz) = 32742
-SHA256 (handbrake/libogg-1.3.0.tar.gz) = a8de807631014615549d2356fd36641833b8288221cea214f8a72750efe93780
-SIZE (handbrake/libogg-1.3.0.tar.gz) = 425144
-SHA256 (handbrake/libsamplerate-0.1.4.tar.gz) = 4b4af3ecaee05c8875a9b113c6a2f816f06f283fb882914e57b21c0b08b67b75
-SIZE (handbrake/libsamplerate-0.1.4.tar.gz) = 4259244
-SHA256 (handbrake/libtheora-1.1.0.tar.bz2) = 74be9fe9f85d18c45bdcbb018cebf12c74e2234aeecb4d4c4cb92d80bdd287e2
-SIZE (handbrake/libtheora-1.1.0.tar.bz2) = 1785634
-SHA256 (handbrake/libvorbis-aotuv_b6.03.tar.bz2) = 95455420f07e4b3abdf32bda9f5921e9ed3f1afdc3739098dc090150a42fd7fd
-SIZE (handbrake/libvorbis-aotuv_b6.03.tar.bz2) = 1250659
-SHA256 (handbrake/libxml2-2.7.7.tar.gz) = af5b781418ba4fff556fa43c50086658ea8a2f31909c2b625c2ce913a1d9eb68
-SIZE (handbrake/libxml2-2.7.7.tar.gz) = 4868502
 SHA256 (handbrake/mp4v2-trunk-r355.tar.bz2) = 5b7d4e62df506b1246463da82cc2f02415eb462e6ccd5848f98f5cdcfc1f3d4f
 SIZE (handbrake/mp4v2-trunk-r355.tar.bz2) = 475488
 SHA256 (handbrake/mpeg2dec-0.5.1.tar.gz) = 161539061aa89864968a5150ed6c6a028a830c4868f7dd7c500732baef47fb71
 SIZE (handbrake/mpeg2dec-0.5.1.tar.gz) = 522405
-SHA256 (handbrake/x264-r2146-bcd41db.tar.gz) = 7b3d0ad309426ad49ff21df4d2ee5553b5769bc2bf2b7ae50f37f5fc72d190b1
-SIZE (handbrake/x264-r2146-bcd41db.tar.gz) = 656089
+SHA256 (handbrake/x264-r2273-b3065e6.tar.gz) = 956c82c9318740ef3744cf6e752fb6181be0716273e2e8976306624f0864a815
+SIZE (handbrake/x264-r2273-b3065e6.tar.gz) = 681489
Index: files/patch-contrib_fontconfig_module.defs
===================================================================
--- files/patch-contrib_fontconfig_module.defs	(revision 342361)
+++ files/patch-contrib_fontconfig_module.defs	(working copy)
@@ -1,11 +0,0 @@
---- ./contrib/fontconfig/module.defs.orig	2010-09-28 18:10:49.000000000 -0400
-+++ ./contrib/fontconfig/module.defs	2011-05-24 05:50:46.060808283 -0400
-@@ -19,6 +19,8 @@
-     FONTCONFIG.config_archoption  = --with-arch=i386
- else ifeq ($(BUILD.system),linux)
-     FONTCONFIG.cc_archoption      = 
-+else ifeq ($(BUILD.system),freebsd)
-+    FONTCONFIG.cc_archoption      = 
- else
-     FONTCONFIG.cc_archoption      = -arch $(FONTCONFIG.GCC.archs)
-     FONTCONFIG.config_archoption  = --with-arch=$(FONTCONFIG.GCC.archs)
Index: files/patch-contrib_freetype_module.defs
===================================================================
--- files/patch-contrib_freetype_module.defs	(revision 342361)
+++ files/patch-contrib_freetype_module.defs	(working copy)
@@ -1,8 +0,0 @@
---- ./contrib/freetype/module.defs.orig	2010-09-28 18:10:49.000000000 -0400
-+++ ./contrib/freetype/module.defs	2011-05-24 05:50:46.062809316 -0400
-@@ -3,3 +3,5 @@
- 
- FREETYPE.FETCH.url = http://download.m0k.org/handbrake/contrib/freetype-2.3.9.tar.gz
- FREETYPE.EXTRACT.tarbase = freetype-2.3.9
-+FREETYPE.CONFIGURE.env.GNUMAKE = GNUMAKE="gmake"
-+FREETYPE.CONFIGURE.env.args += !GNUMAKE
Index: files/patch-contrib_libass_module.defs
===================================================================
--- files/patch-contrib_libass_module.defs	(revision 342361)
+++ files/patch-contrib_libass_module.defs	(working copy)
@@ -1,14 +0,0 @@
---- ./contrib/libass/module.defs.orig	2010-09-28 18:10:49.000000000 -0400
-+++ ./contrib/libass/module.defs	2011-05-24 05:50:46.096807667 -0400
-@@ -7,9 +7,9 @@
- # Disable as many external dependencies as I can get away with
- # and tell configure where to find our version of freetype
- LIBASS.CONFIGURE.extra = \
--    --disable-png --disable-enca \
-+    --disable-png --disable-enca --disable-harfbuzz \
-     FREETYPE_LIBS="-L$(call fn.ABSOLUTE,$(CONTRIB.build/))lib -lfreetype" \
--    FREETYPE_CFLAGS="-I$(call fn.ABSOLUTE,$(CONTRIB.build/))include/freetype2" \
-+    FREETYPE_CFLAGS="-I$(call fn.ABSOLUTE,$(CONTRIB.build/))include/freetype2 -I/usr/local/include" \
-     FONTCONFIG_LIBS="-L$(call fn.ABSOLUTE,$(CONTRIB.build/))lib -lfontconfig" \
-     FONTCONFIG_CFLAGS="-I$(call fn.ABSOLUTE,$(CONTRIB.build/))include"
- 
Index: files/patch-test_module.defs
===================================================================
--- files/patch-test_module.defs	(revision 342361)
+++ files/patch-test_module.defs	(working copy)
@@ -1,23 +1,12 @@
---- ./test/module.defs.orig	2010-09-28 18:10:49.000000000 -0400
-+++ ./test/module.defs	2011-05-24 05:50:46.097808812 -0400
-@@ -10,8 +10,8 @@
- TEST.exe = $(BUILD/)$(call TARGET.exe,$(HB.name)CLI)
- 
- TEST.libs = $(LIBHB.a) $(foreach n, \
--        a52 ass avcodec avformat avutil dca dvdnav dvdread faac fontconfig freetype mkv mpeg2 mp3lame mp4v2 \
--        ogg samplerate swscale theora vorbis vorbisenc x264 xml2 bluray, \
-+        a52 ass avformat avcodec avutil dca dvdnav dvdread faac fontconfig freetype mkv mpeg2 mp3lame mp4v2 \
-+        samplerate swscale theora vorbis vorbisenc ogg x264 xml2 bluray, \
-         $(CONTRIB.build/)lib/lib$(n).a )
- 
- TEST.install.exe = $(DESTDIR)$(PREFIX/)bin/$(notdir $(TEST.exe))
-@@ -50,6 +50,9 @@
+--- ./test/module.defs.orig	2014-02-02 01:43:20.388459727 +0100
++++ ./test/module.defs	2014-02-02 01:50:43.545619545 +0100
+@@ -42,6 +42,9 @@
      TEST.GCC.l += iconv
  else ifeq ($(BUILD.system),linux)
      TEST.GCC.l += pthread dl m
 +else ifeq ($(BUILD.system),freebsd)
-+	TEST.GCC.l += pthread iconv
-+	TEST.GCC.L += /usr/local/lib
++    TEST.GCC.l += pthread iconv
++    TEST.GCC.L += /usr/local/lib
  else ifeq ($(BUILD.system),solaris)
-     TEST.GCC.l += pthread nsl socket
+     TEST.GCC.l += pthread nsl socket iconv
  else ifeq (1-mingw,$(BUILD.cross)-$(BUILD.system))


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402021946.s12Jked1060594>