Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jan 2011 08:00:26 GMT
From:      David Naylor <naylor.b.david@gmail.com>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/151747: request to enable emulators/wine on amd64
Message-ID:  <201101100800.p0A80QaS090299@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/151747; it has been noted by GNATS.

From: David Naylor <naylor.b.david@gmail.com>
To: Gerald Pfeifer <gerald@pfeifer.com>
Cc: bug-followup@freebsd.org,
 kenorb@gmail.com
Subject: Re: ports/151747: request to enable emulators/wine on amd64
Date: Mon, 10 Jan 2011 09:58:38 +0200

 --nextPart1854410.piEAuNF1qW
 Content-Type: multipart/mixed;
   boundary="Boundary-01=_uwrKNRDZlmh0pVl"
 Content-Transfer-Encoding: 7bit
 
 
 --Boundary-01=_uwrKNRDZlmh0pVl
 Content-Type: Text/Plain;
   charset="us-ascii"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: inline
 
 On Thursday 06 January 2011 12:37:02 David Naylor wrote:
 > On Sunday 02 January 2011 13:08:48 Gerald Pfeifer wrote:
 > > On Mon, 29 Nov 2010, David Naylor wrote:
 > > > The patches and packages are now hosted at
 > > > http://mediafire.com/wine_fbsd64 .
 > > If there is a way to move most of the code into the slave port and
 > > have fewer changes to emulators/wine itself, I'd be open to consder
 > > those.
 >=20
 > I have attempted to do just that.  See attached for the patch.  I have
 > compile tested the patch (for wine and wine-fbsd64) and wine-fbsd64
 > produce the same list of files for packaging.
 
 I have updated the patch to automagically detect soft dependent libraries. =
 =20
 
 I have uploaded wine-fbsd64-1.3.10 to mediafire using this patch. =20
 
 --Boundary-01=_uwrKNRDZlmh0pVl
 Content-Type: text/x-patch;
   charset="ISO-8859-1";
   name="wine-fbsd64.diff"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment;
 	filename="wine-fbsd64.diff"
 
 diff -urN /usr/ports/emulators/wine/Makefile wine/Makefile
 =2D-- /usr/ports/emulators/wine/Makefile	2011-01-01 03:08:21.000000000 +0200
 +++ wine/Makefile	2011-01-07 18:03:50.000000000 +0200
 @@ -29,7 +29,7 @@
  LICENSE_FILE=3D	${WRKSRC}/LICENSE
 =20
  GNU_CONFIGURE=3D	yes
 =2DCONFIGURE_ARGS=3D	--datadir=3D${DATADIR} --verbose --disable-tests \
 +CONFIGURE_ARGS+=3D	--datadir=3D${DATADIR} --verbose --disable-tests \
  		--with-glu --with-opengl --with-xrandr \
  		--without-capi --without-gphoto --without-gsm \
  		--without-v4l --without-mpg123 --without-sane \
 @@ -37,7 +37,11 @@
  CONFIGURE_ENV=3D	CPPFLAGS=3D"-I${LOCALBASE}/include" \
  		LDFLAGS=3D"-L${LOCALBASE}/lib" \
  		FLEX=3D"${LOCALBASE}/bin/flex"
 +CONFLICTS?=3D	wine-fbsd64.*
 +.if !defined(USE_LDCONFIG32)
  USE_LDCONFIG=3D	${PREFIX}/lib ${PREFIX}/lib/wine
 +.endif
 +WINELIBDIR?=3D	${PREFIX}/lib
  MAKE_JOBS_SAFE=3D	yes
  MAN1=3D		widl.1 wine.1 winebuild.1 winedbg.1 winedump.1 winegcc.1 \
  		winemaker.1 wineserver.1 wmc.1 wrc.1
 @@ -65,6 +69,8 @@
  		OPENAL	"Use OpenAL (3D audio library)"			Off \
  		WINEMAKER "Fully support winemaker (requires Perl)"	Off
 =20
 +.PHONY: post-install-wine
 +
  .include <bsd.port.pre.mk>
 =20
  .ifdef WITHOUT_CUPS
 @@ -126,7 +132,12 @@
  pre-build:
  	cd ${WRKSRC} && ${GMAKE} depend
 =20
 =2Dpost-install:
 +# This target allows hooks for wine-fbsd64
 +.if !target(post-install-wine)
 +post-install-wine:
 +.endif
 +
 +post-install: post-install-wine
  	@${RM} -f ${MAN1PREFIX}/man/de.UTF-8/man1/wine.1 \
  	          ${MAN1PREFIX}/man/de.UTF-8/man1/winemaker.1 \
  	          ${MAN1PREFIX}/man/de.UTF-8/man1/wineserver.1 \
 @@ -135,8 +146,8 @@
  	          ${MAN1PREFIX}/man/fr.UTF-8/man1/wineserver.1
  	@-${RMDIR} -p ${MAN1PREFIX}/man/de.UTF-8/man1 \
  	              ${MAN1PREFIX}/man/fr.UTF-8/man1
 =2D	${MV} -f ${PREFIX}/lib/libwine.so.1.0 ${PREFIX}/lib/libwine.so.1
 =2D	${LN} -sf libwine.so.1 ${PREFIX}/lib/libwine.so
 +	${MV} -f ${WINELIBDIR}/libwine.so.1.0 ${WINELIBDIR}/libwine.so.1
 +	${LN} -sf libwine.so.1 ${WINELIBDIR}/libwine.so
  .if !defined(NOPORTDOCS)
  	-@${MKDIR} ${DOCSDIR}
  .for i in README ANNOUNCE AUTHORS
 diff -urN /usr/ports/emulators/wine/files/binbounce wine/files/binbounce
 =2D-- /usr/ports/emulators/wine/files/binbounce	1970-01-01 02:00:00.0000000=
 00 +0200
 +++ wine/files/binbounce	2011-01-01 12:32:55.000000000 +0200
 @@ -0,0 +1,32 @@
 +#!/bin/sh
 +
 +TARGET=3D"$0"
 +_count=3D0
 +while [ -L "$TARGET" ]
 +do
 +  _old=3D"$TARGET"
 +  TARGET=3D"`readlink "$TARGET"`"
 +  if [ ! -e "$TARGET" ]
 +  then
 +    TARGET=3D"`dirname "$_old"`/$TARGET"
 +  fi
 +  _count=3D$(($_count + 1))
 +  if [ $_count -gt 100 ]
 +  then
 +    echo "$0: to many symbolic links" > /dev/stderr
 +    exit 1
 +  fi
 +done
 +
 +LOCALBASE=3D`dirname "$TARGET"`/..
 +BINNAME=3D`basename "$TARGET"`
 +
 +if [ `uname -p` =3D i386 ]
 +then
 +  export LD_LIBRARY_PATH=3D"$LOCALBASE/lib32":"$LOCALBASE/lib32/wine":"$LD=
 _LIBRARY_PATH"
 +else
 +  export LD_32_LIBRARY_PATH=3D"$LOCALBASE/lib32":"$LOCALBASE/lib32/wine":"=
 $LD_32_LIBRARY_PATH"
 +fi
 +export PATH=3D"$LOCALBASE/bin32":"$PATH"
 +
 +exec "$LOCALBASE/bin32/$BINNAME" "$@"
 diff -urN /usr/ports/emulators/wine-fbsd64/ChangeLog wine-fbsd64/ChangeLog
 =2D-- /usr/ports/emulators/wine-fbsd64/ChangeLog	1970-01-01 02:00:00.000000=
 000 +0200
 +++ wine-fbsd64/ChangeLog	2011-01-07 18:13:50.000000000 +0200
 @@ -0,0 +1,38 @@
 +2010/07:
 + * Automatically detect soft dependencies
 +
 +2011/01/05:
 + * Update patch to make it minimally invasive for wine/Makefile
 +
 +2011/01/01:
 + * Update wine to 1.3.10
 +
 +2010/10/17:
 + * Update wine to 1.3.5
 + * Add support for openal (soft dependency)
 +
 +2010/01/18:
 + * Update wine to 1.1.36
 + * Follow relative symbolic links to script
 + * Use readlink (vs `ls -l | sed ...`)
 +
 +2009/12/20:
 + * Correctly set bin/lib directories
 + * Support running on i386
 + * Follow symbolic links to script
 + * Allow spaces in path
 + * Hard link the bin/* files (otherwise symbolic link following breaks)
 +
 +2009/12/19:
 + * Include freetype (it is a soft dependency)
 + * Include libXrender (it is a soft dependency)
 +
 +2009/12/18:
 + * Rename to something with a little more sense (wine-amd64-[V] -> wine-fb=
 sd64.[V])
 + * Fix conflicts (wine conflicts with wine-fbsd64)
 +
 +2009/12/17:
 + * Automatically determine libraries and binaries
 +
 +2009/12/08:
 + * Initial implementation of WINE/i386 on FreeBSD/amd64=20
 diff -urN /usr/ports/emulators/wine-fbsd64/Makefile wine-fbsd64/Makefile
 =2D-- /usr/ports/emulators/wine-fbsd64/Makefile	1970-01-01 02:00:00.0000000=
 00 +0200
 +++ wine-fbsd64/Makefile	2011-01-07 23:14:50.000000000 +0200
 @@ -0,0 +1,57 @@
 +# New ports collection Makefile for:	wine-fbsd64
 +# Date created:				2011/01/05
 +# Whom:					David Naylor <naylor.b.david@gmail.com>
 +#
 +# $FreeBSD$
 +
 +PKGNAMESUFFIX=3D	-fbsd64
 +
 +# TODO: mention patch-wine-nvidia.sh
 +# TODO: fix wine/fakedlls/openal32.dll
 +
 +# Use the wine port to do most of the heavy lifting
 +MASTERDIR=3D	${.CURDIR}/../wine
 +
 +ACTUAL-PACKAGE-DEPENDS=3D	${DO_NADA}
 +CONFIGURE_ARGS+=3D	--bindir=3D${PREFIX}/bin32 --libdir=3D${PREFIX}/lib32
 +CONFLICTS=3D	wine-[0-9]*
 +PLIST_REINPLACE+=3D	winelib
 +PLIST_REINPLACE_WINELIB=3D	s!lib/!lib32/!g
 +USE_LDCONFIG32=3D	${PREFIX}/lib32 ${PREFIX}/lib32/wine
 +WINELIBDIR=3D	${PREFIX}/lib32
 +
 +# Hook into post-install and do some adapting to make i386 binaries work n=
 icely
 +# under FreeBSD/amd64 (include add dependant i386 libs)
 +post-install-wine:
 +	# The following line is also done in port-install (undo it afterwards)
 +	${MV} -f ${WINELIBDIR}/libwine.so.1.0 ${WINELIBDIR}/libwine.so.1
 +	# Find all libraries that are linked too (via ldd(1))
 +	grep -v '[@%]' ${TMPPLIST} | sed "s!^!${PREFIX}/!g" | \
 +	xargs -n1 file -F' ' | grep ELF | cut -f1 -d' ' | \
 +	env LD_LIBRARY_PATH=3D${PREFIX}/lib32:${LD_LIBRARY_PATH} xargs ldd -f '%p=
 \n' \
 +	| sort -u | grep -v '^\(/usr\)\?/lib' | grep -v "^${PREFIX}/lib32/libwine=
 =2Eso" \
 +	| grep -v "^${PREFIX}/lib32/wine" > ${WRKDIR}/winelibs
 +	for i in `cat ${WRKDIR}/winelibs` ; do \
 +		${INSTALL_DATA} $${i} ${PREFIX}/lib32/ ; \
 +		echo lib32/`basename $${i}` >> ${TMPPLIST} ; \
 +	done
 +	# Find all soft dependancies (via strings(1))
 +	grep -v '[@%]' ${TMPPLIST} | sed "s!^!${PREFIX}/!g" | \
 +	xargs -n1 file -F' ' | grep ELF | cut -f1 -d' ' | xargs strings | \
 +	grep '^lib.*\.so' | sort -u > ${WRKDIR}/winesoftlibs
 +	for i in `cat ${WRKDIR}/winesoftlibs` ; do \
 +		if [ -e ${LOCALBASE}/lib/$${i} ] && [ -z "`grep $${i} ${TMPPLIST}`" ] ; =
 then \
 +			${INSTALL_DATA} ${LOCALBASE}/lib/$${i} ${PREFIX}/lib32/ ; \
 +			echo lib32/$${i} >> ${TMPPLIST} ; \
 +		fi ; \
 +	done
 +	${INSTALL_SCRIPT} ${FILESDIR}/binbounce ${PREFIX}/bin/wine
 +	for i in `grep ^bin ${TMPPLIST} | xargs -n1 basename` ; do \
 +		[ "$${i}" =3D "wine" ] || ${LN} -f ${PREFIX}/bin/wine ${PREFIX}/bin/$${i=
 } ; \
 +		echo bin32/$${i} >> ${TMPPLIST} ; \
 +	done
 +	echo '@unexec rmdir %D/bin32 2>/dev/null || true' >> ${TMPPLIST}
 +	# Undoing above change (keep consistent for port-install)
 +	${MV} -f ${WINELIBDIR}/libwine.so.1 ${WINELIBDIR}/libwine.so.1.0
 +
 +.include "${MASTERDIR}/Makefile"
 
 --Boundary-01=_uwrKNRDZlmh0pVl--
 
 --nextPart1854410.piEAuNF1qW
 Content-Type: application/pgp-signature; name=signature.asc 
 Content-Description: This is a digitally signed message part.
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.16 (FreeBSD)
 
 iEYEABECAAYFAk0qvDIACgkQUaaFgP9pFrJb3gCcCKyoMmBkAsXsBeTnO9GG1ZOe
 nxQAoI4G3DgmJKSGWeNcrheUieimZpOT
 =4kJW
 -----END PGP SIGNATURE-----
 
 --nextPart1854410.piEAuNF1qW--



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