From jaj@hcl-club.lu  Wed Jan 23 02:47:26 2008
Return-Path: <jaj@hcl-club.lu>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 0DE3416A41B
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Jan 2008 02:47:26 +0000 (UTC)
	(envelope-from jaj@hcl-club.lu)
Received: from 0b10111.de (hcl-club.lu [62.75.155.129])
	by mx1.freebsd.org (Postfix) with ESMTP id 9C97B13C459
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 23 Jan 2008 02:47:25 +0000 (UTC)
	(envelope-from jaj@hcl-club.lu)
Received: from nirvana.my.domain (4be54-4-82-234-154-189.fbx.proxad.net [82.234.154.189])
	by 0b10111.de (Postfix) with ESMTP id C8B65BFB0032;
	Wed, 23 Jan 2008 03:25:35 +0100 (CET)
Received: by nirvana.my.domain (Postfix, from userid 1005)
	id 81C907EBF; Wed, 23 Jan 2008 03:25:30 +0100 (CET)
Message-Id: <20080123022530.81C907EBF@nirvana.my.domain>
Date: Wed, 23 Jan 2008 03:25:29 +0100 (CET)
From: Jona Joachim <jaj@hcl-club.lu>
Reply-To: Jona Joachim <jaj@hcl-club.lu>
To: FreeBSD-gnats-submit@freebsd.org
Cc: jaj@hcl-club.lu
Subject: [maintainer] multimedia/handbrake
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         119908
>Category:       ports
>Synopsis:       [maintainer] multimedia/handbrake
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    rafan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jan 23 02:50:01 UTC 2008
>Closed-Date:    Tue Feb 19 09:17:46 UTC 2008
>Last-Modified:  Tue Feb 19 09:17:46 UTC 2008
>Originator:     Jona Joachim
>Release:        FreeBSD 7.0-BETA4 i386
>Organization:
none
>Environment:
System: FreeBSD nirvana.my.domain 7.0-BETA4 FreeBSD 7.0-BETA4 #0: Thu Dec 6 11:05:32 CET 2007 root@nirvana.my.domain:/usr/obj/usr/src/sys/HYPOCENTER i386
>Description:
Hi!
Sorry for sending this in so late, I plain forgot about it :/
Our handbrake port doesn't currently build on amd64 because it is built
without -fPIC.
The following patch enables -fPIC on all archs except for i386.
ffmpeg (which is included in handbrake) doesn't build with -fPIC on i386,
this is a known issue. However it should build on amd64.
Unfortunately I can't test it myself, I only have FreeBSD boxes with i386.
So it would be kind if somebody could test-build handbrake on amd64 with
the following patch applied.

Best regards,
Jona
>How-To-Repeat:
>Fix:
--- handbrake.diff begins here ---
diff -ur /usr/ports/multimedia/handbrake/Makefile ./Makefile
--- /usr/ports/multimedia/handbrake/Makefile	2008-01-18 08:32:28.000000000 +0100
+++ ./Makefile	2008-01-23 03:04:48.000000000 +0100
@@ -71,8 +71,10 @@
 # nasm/yasm needed by x264
 .if ${ARCH}=="i386"
 BUILD_DEPENDS+=	nasm:${PORTSDIR}/devel/nasm
+PICFLAGS=
 .else
 BUILD_DEPENDS+=	yasm>=0.6.0:${PORTSDIR}/devel/yasm
+PICFLAGS=	-fPIC -DPIC
 .endif
 
 CONFIGURE_ENV+=	PKG_CONFIG_PATH=${WRKSRC}/contrib/lib/pkgconfig
@@ -102,8 +104,8 @@
 	@${REINPLACE_CMD} -e 's|%%CC%%|${CC}|g ; \
 		s|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g ; \
 		s|%%CONTRIB%%|${WRKSRC}/contrib|g ; \
-		s|./bootstrap|${SETENV} CC="${CC}" CXX="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" ${CONFIGURE_ENV} ./bootstrap|g ; \
-		s|./configure|${SETENV} CC="${CC}" CXX="${CXX}" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" ${CONFIGURE_ENV} ./configure|g' \
+		s|./bootstrap|${SETENV} CC="${CC}" CXX="${CXX}" CFLAGS="${CFLAGS} ${PICFLAGS}" CXXFLAGS="${CXXFLAGS}" ${CONFIGURE_ENV} ./bootstrap|g ; \
+		s|./configure|${SETENV} CC="${CC}" CXX="${CXX}" CFLAGS="${CFLAGS} ${PICFLAGS}" CXXFLAGS="${CXXFLAGS}" ${CONFIGURE_ENV} ./configure|g' \
 			${WRKSRC}/contrib/Jamfile
 	@${REINPLACE_CMD} -e 's|-O3||g ; s|-O20||g ; s|-O4 -ffast-math||g ; \
 		s| -mtune=.*"|"|g ; s| -mcpu=.*"|"|g ; \
Only in .: Makefile~
--- handbrake.diff ends here ---


>Release-Note:
>Audit-Trail:

From: Jona Joachim <jaj@hcl-club.lu>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/119908: [maintainer] multimedia/handbrake
Date: Fri, 25 Jan 2008 01:34:08 +0100

 The above patch is not very clean and I forgot to remove the BROKEN
 section.
 Here is a better and cleaner version of the patch.
 It was successfully tested on amd64 by elliot.schlegelmilch AT
 gmail.com.
 
 --- /usr/ports/multimedia/handbrake/Makefile	2008-01-18
 08:32:28.000000000 +0100 +++ Makefile	2008-01-24
 21:01:16.000000000 +0100 @@ -7,6 +7,7 @@
  
  PORTNAME=	handbrake
  PORTVERSION=	0.9.1
 +PORTREVISION=	1
  CATEGORIES=	multimedia
  MASTER_SITES=
 http://saintdevelopment.com/mirror/handbrake/:main \
 http://junk.phantomgorilla.com/hb/:main \ @@ -59,15 +60,12 @@
  WRKSRC=		${WRKDIR}/HandBrake
  PLIST_FILES=	bin/handbrake
  
 -JAM?=		${LOCALBASE}/bin/jam
 +# -dx: verbose build, -q: quit immediately upon first error
 +JAM?=		${LOCALBASE}/bin/jam -dx -q
  APPLY?=		/usr/bin/apply
  
  .include <bsd.port.pre.mk>
  
 -.if ${ARCH} == "amd64"
 -BROKEN=		Does not compile
 -.endif
 -
  # nasm/yasm needed by x264
  .if ${ARCH}=="i386"
  BUILD_DEPENDS+=	nasm:${PORTSDIR}/devel/nasm
 @@ -75,6 +73,11 @@
  BUILD_DEPENDS+=	yasm>=0.6.0:${PORTSDIR}/devel/yasm
  .endif
  
 +# needed for amd64, doesn't work with i386
 +.if ${ARCH}!="i386"
 +CFLAGS+=	-fPIC -DPIC
 +.endif
 +
  CONFIGURE_ENV+=	PKG_CONFIG_PATH=${WRKSRC}/contrib/lib/pkgconfig
  MAKE_ENV+=	ARCH=${ARCH} MAKE=${GMAKE}
  
 @@ -118,9 +121,8 @@
  		s|$$PREFIX|${WRKSRC}/contrib|g' \
  			${WRKSRC}/contrib/ffmpeg/configure
  
 -# jam -dx, it will giving a verbose of build.
  do-build:
 -	@(cd ${WRKSRC} ; ${SETENV} ${MAKE_ENV} ${JAM} -dx)
 +	@(cd ${WRKSRC} ; ${SETENV} ${MAKE_ENV} ${JAM})
  
  do-install:
  	${INSTALL_PROGRAM} ${WRKSRC}/HandBrakeCLI
 ${PREFIX}/bin/handbrake
Responsible-Changed-From-To: freebsd-ports-bugs->rafan 
Responsible-Changed-By: rafan 
Responsible-Changed-When: Tue Feb 5 13:46:47 UTC 2008 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=119908 
State-Changed-From-To: open->feedback 
State-Changed-By: rafan 
State-Changed-When: Tue Feb 5 14:08:49 UTC 2008 
State-Changed-Why:  
With this patch, it builds find on 7.x amd64, but 
not on 6: 

http://www.rafan.org/tb/errors/6-FreeBSD/handbrake-0.9.1_1.log 

Could you please take a look? 

Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=119908 
State-Changed-From-To: feedback->closed 
State-Changed-By: linimon 
State-Changed-When: Tue Feb 19 09:17:05 UTC 2008 
State-Changed-Why:  
Submitter (maintainer) now prefers the solution in ports/120510. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=119908 
>Unformatted:
