From owner-freebsd-emulation@FreeBSD.ORG Mon Jan 18 14:55:28 2010 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17F661065676; Mon, 18 Jan 2010 14:55:28 +0000 (UTC) (envelope-from naylor.b.david@gmail.com) Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mx1.freebsd.org (Postfix) with ESMTP id F1DAD8FC1D; Mon, 18 Jan 2010 14:55:26 +0000 (UTC) Received: by fxm27 with SMTP id 27so2347024fxm.3 for ; Mon, 18 Jan 2010 06:55:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:organization:to:subject :date:user-agent:cc:references:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; bh=hGdqniGqqGSiaLT3TQ966MC0PKRa/CLPTPCqdq4rd/Y=; b=cEGYlPm4f3TMwZTi1Mt833UFlf5R55fp0Y9tySkS7kzu9RvImAynJzHnrZPdRbG4P0 5BCfaxe3tar4JPf+Co6jCrgjYgPQoZPco4WUEx6wSQURb0i2biqgyoEowBWY1dEAZIDZ ArIvVVhCLplKPtqwoNP8YQ3hH/J2xIcd3E1GI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:organization:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; b=WtqmNuTjmVoH6FA+9FecasxjIX1mbxGDa7tjH7OtlbdCMKjyRQ7OyiieX+4cuCJD7l Co6XEYLy37bMYeBF4iZA7ddrU0lQcM6G+Y2CfW5lp0UbSlnN0Q/OfyvRl4iTgA+2cu9B A3ZMv7VlhtSUHgQ1tfV6ne3mume3IBuFo4JoQ= Received: by 10.87.46.12 with SMTP id y12mr7726121fgj.47.1263826525637; Mon, 18 Jan 2010 06:55:25 -0800 (PST) Received: from dragon.dg ([41.216.197.17]) by mx.google.com with ESMTPS id d8sm11289451fga.13.2010.01.18.06.55.20 (version=SSLv3 cipher=RC4-MD5); Mon, 18 Jan 2010 06:55:24 -0800 (PST) From: David Naylor Organization: Private To: Gerald Pfeifer Date: Mon, 18 Jan 2010 16:55:21 +0200 User-Agent: KMail/1.12.3 (FreeBSD/8.0-STABLE; KDE/4.3.3; amd64; ; ) References: <200912081524.03878.naylor.b.david@gmail.com> <20100113.111307.1024833258536727945.chat95@mac.com> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2451768.b0hXnrl0jK"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201001181655.27904.naylor.b.david@gmail.com> X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-emulation@freebsd.org, ivoras@freebsd.org Subject: Re: [WIP] wine/i386 on FreeBSD/amd64 (take 3.1) X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jan 2010 14:55:28 -0000 --nextPart2451768.b0hXnrl0jK Content-Type: multipart/mixed; boundary="Boundary-01=_aZHVLFBSJ1F1aaY" Content-Transfer-Encoding: 7bit --Boundary-01=_aZHVLFBSJ1F1aaY Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 17 January 2010 23:18:33 Gerald Pfeifer wrote: > On Wed, 13 Jan 2010, Maho NAKATA wrote: > > Hi David Naylor, ivoras@, and gerald@ > > > > I fetch the following package > > http://people.freebsd.org/~ivoras/temp/wine-amd64-8-1.1.30%2c1.tbz > > and it works without problem. I tested my library which > > I have been developing, crossbuilding with mingw32 compiler environment > > and run with Wine on FreeBSD 8.0-RELEASE-p2/amd64. So everything > > is on FreeBSD to develop Windows application :-) >=20 > Thanks for letting me know, Maha-san! This is exciting news. >=20 > David, I did not see the actual patch but I wonder whether it might > make sense to have this as a slave port of emulators/wine, and if it > does will be more than happy to support you from my side. The current situation is as follows: the port needs to be build under=20 =46reeBSD/i386 (I've tried getting amd64 to cross compile to i386 but I thi= nk it=20 is missing cc1(obj) so that fails). Once the port is build and packaged it= =20 can be installed under amd64 and works as it does under i386. =20 The two things it does extra from the normal wine is include the 32bit=20 libraries wine depends on (such as x11) and add a shell script to properly = set=20 LD_32_LIBRARY_PATH (it appears ldconfig -32 -m /usr/local/lib32 does not wo= rk=20 alone, is this a bug?). =20 It is possible to take the normal wine package with the extra 32bit librari= es=20 and be able to reproduce the above. Also the above also runs as expected i= f=20 installed under FreeBSD/i386. =20 Attached are the patches updated to 1.1.36. =20 Regards --Boundary-01=_aZHVLFBSJ1F1aaY 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 2010-01-10 03:13:43.000000000 +0200 +++ wine/Makefile 2010-01-18 16:36:53.000000000 +0200 @@ -32,12 +32,10 @@ CONFIGURE_ENV=3D CPPFLAGS=3D"-I${LOCALBASE}/include" \ LDFLAGS=3D"-L${LOCALBASE}/lib" \ FLEX=3D"${LOCALBASE}/bin/flex" =2DUSE_LDCONFIG=3D ${PREFIX}/lib ${PREFIX}/lib/wine MAKE_JOBS_SAFE=3D yes MAN1=3D widl.1 wine.1 winebuild.1 winedbg.1 winedump.1 winegcc.1 \ winemaker.1 wineprefixcreate.1 wineserver.1 wmc.1 wrc.1 MLINKS=3D winegcc.1 wineg++.1 =2DONLY_FOR_ARCHS=3D i386 USE_BISON=3D build USE_BZIP2=3D yes USE_GMAKE=3D yes @@ -82,10 +80,33 @@ CONFIGURE_ARGS+=3D --without-xslt .endif =20 +# TODO: when does FreeBSD/i386 work properly under FreeBSD/amd64? .if ${OSVERSION} < 603000 IGNORE=3D fails to properly work on versions of FreeBSD before 6.3 .endif =20 +.ifdef WINE_CROSS_BUILD + +CONFIGURE_ARGS+=3D --bindir=3D${PREFIX}/bin32 --libdir=3D${PREFIX}/lib32 +CONFLICTS=3D wine-[0-9]* +ONLY_FOR_ARCHS=3D i386 amd64 +USE_LDCONFIG32=3D ${PREFIX}/lib32 ${PREFIX}/lib32/wine +WINELIBDIR=3D${PREFIX}/lib32 + +PLIST_REINPLACE+=3D winelib +PLIST_REINPLACE_WINELIB=3Ds!lib/!lib32/!g + +ACTUAL-PACKAGE-DEPENDS=3D${DO_NADA} + +.else + +CONFLICTS=3D wine-fbsd64.* +ONLY_FOR_ARCHS=3D i386 +USE_LDCONFIG=3D ${PREFIX}/lib ${PREFIX}/lib/wine +WINELIBDIR=3D${PREFIX}/lib + +.endif + post-patch: .if ${OSVERSION} < 700041 ${REINPLACE_CMD} 's/-lpthread/-lthr/g' ${WRKSRC}/configure @@ -101,8 +122,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 LICENSE @@ -111,6 +132,27 @@ @${INSTALL_DATA} ${WRKSRC}/programs/winedbg/README ${DOCSDIR}/README.wine= dbg @${INSTALL_DATA} ${WRKSRC}/tools/winedump/README ${DOCSDIR}/README.winedu= mp .endif +.ifdef WINE_CROSS_BUILD + 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.list + for i in `cat ${WRKDIR}/winelibs.list` ; do \ + ${INSTALL_DATA} $${i} ${PREFIX}/lib32/ ; \ + echo lib32/`basename $${i}` >> ${TMPPLIST} ; \ + done + for i in libfreetype.so.9 libXrender.so.1 ; do \ + ${INSTALL_DATA} ${LOCALBASE}/lib/$${i} ${PREFIX}/lib32/ ; \ + echo lib32/$${i} >> ${TMPPLIST} ; \ + 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} +.endif @${MKDIR} ${DESKTOPDIR} @${MV} ${DATADIR}/applications/wine.desktop ${DESKTOPDIR}/ @${ECHO} 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 2010-01-18 16:45:30.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 2010-01-18 16:51:01.000000000 +0200 @@ -0,0 +1,25 @@ +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 dependancy) + * Include libXrender (it is a soft dependancy) + +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 2009-12-18 19:44:47.000000000 +0200 @@ -0,0 +1,12 @@ +PORTNAME=3D wine +PKGNAMESUFFIX=3D -fbsd64.${OSVERSION:C/([0-9]).*/\1/} + +WINE_CROSS_BUILD=3Dyes + +MASTERDIR=3D ${.CURDIR}/../wine + +#.if ${ARCH} =3D=3D "amd64" +# TODO: install from package (how?) +#.endif + +.include "${MASTERDIR}/Makefile" --Boundary-01=_aZHVLFBSJ1F1aaY-- --nextPart2451768.b0hXnrl0jK Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iEYEABECAAYFAktUdl8ACgkQUaaFgP9pFrK+FQCfaRQgvqsh6p2aeDbFdgBe64OA HaQAnRgAmnMxPKGvWRlQnD0jVL8m8DmF =swXc -----END PGP SIGNATURE----- --nextPart2451768.b0hXnrl0jK--