Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Nov 2012 09:49:08 +0200
From:      David Naylor <naylor.b.david@gmail.com>
To:        ports@freebsd.org
Cc:        Gerald Pfeifer <gerald@pfeifer.com>
Subject:   wine/i386 for FreeBSD/amd64 port (aka wine-fbsd64)
Message-ID:  <201211030949.11291.naylor.b.david@gmail.com>

next in thread | raw e-mail | index | archive | help
--nextPart5411883.dyOoBIXW4W
Content-Type: Text/Plain;
  charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hi List,

# Executive Summary

Over the past years I have been maintaining the wine-fbsd64 port (see=20
http://mediafire.com/wine_fbsd64 for more).  The port itself effectively do=
es=20
static linking (it bundles all the libraries wine needs) with scripts to=20
bootstrap the environment to easily use wine from FreeBSD/amd64.  There is=
=20
also a script to install the i386 nVidia graphic drivers so that wine has=20
access to nVidia accelerated graphics from FreeBSD/amd64. =20

I would like to propose this port gets included in the port's collection an=
d=20
would like to get feedback, your comments please :-).

P.S. I'm not subscribed to the list, so please ensure I'm cc'ed in the=20
discussion.

# Details of the Port

Please see attached for the actual port.

## Port Preamble

This port is a slave port to emulators/wine(-devel).  The master port neede=
d=20
to be modified (already done):
 - to conditionally set USE_LDCONFIG (if USE_LDCONFIG32 was not set)
 - to allow the library directory to be changed (see WINELIBDIR)
 - to allow configure arguments to be appended

## Port Targets

The port itself does the following in the preamble:
 - specifies the pkg(de)install script to handle nVidia driver patching
 - overrides ACTUAL-PACKAGE-DEPENDS (all depends are bundled with the port)
 - defined the library directory to ${PREFIX}/lib32
 - defined the binary directory to ${PREFIX}/bin32
 - patches the PLIST to refer to lib32 (not lib)
 - defined USE_LDCONFIG32 appropriately

The post-install-script target:
 - Installs the files/binbounce file in ${PREFIX}/bin for each ${PREFIX}/bi=
n32=20
file (hard linked)
 - Finds all linked library, copies them to ${PREFIX}/lib32, and added them=
 to=20
the plist
 - Finds all dlopen'ed libraries, copies them to ${PREFIX}/lib32, and added=
=20
them to the plist
 - Installs the nVidia patch file
 - Run the (PRE-|POST-)INSTALL script

The post-package-script (run only if WITH_PKGNG is defined):
 - Amends the package so the arch label to 64bit

## Port scripts (in files/)

The binbounce file does the following to transparently fix the environment =
to=20
allow seamless running of the wine programs:
 - determines the location of the TARGET (follows symbolic links to itself)
 - fixes LD_LIBRARY_PATH if in an i386 environment (so lib32, lib32/wine is=
=20
found)
 - fixes LD_32_LIBRARY_PATH if in an amd64 environment (so lib32, lib32/win=
e,=20
/usr/lib32)
 - fixes PATH (so bin32 is found)
 - passes execution to the counterpart in bin32

The patch-nvidia.sh file does the following:
 - Downloads the nVidia distfile for i386 (iff nVidia amd64 driver is=20
installed)
 - Installs the required libraries into ${PREFIX}/lib32
 - When run from the install script it does _not_ download the distfile, on=
ly=20
installs the libraries iff the distfiles are already downloaded. =20

# Shortcomings of the port

The following are shortcomings that I am aware of:
 - Can only be compiled in an i386 environment, but the resulting package i=
s=20
*intended* for amd64 (although works fine in an i386 environment)
 - If, somehow, there is a recursive calling of wine programs then=20
LD_(32_)LIBRARY_PATH and PATH will continue to grow with every iteration. =
=20
 - The pkgng ports cannot be installed in an i386 environment as they are=20
labelled for amd64. =20

# Testing

The ports published on mediafire have been tested by many users.  The port=
=20
itself works flawlessly however there have been some reports about some fla=
ws=20
in the 32-bit compatibility layer of the kernel (although I cannot remember=
=20
the specifics now). =20

To produce the package on an amd64 system do the following:
# (cd /usr/ports/emulators/; patch -p0 < /path/to/diff)
# make -C /usr/src world DESTDIR=3D/i386 TARGET=3Di386
# mount -t devfs devfs /i386/dev
# mkdir /i386/usr/ports
# mount -t nullfs /usr/ports /i386/usr/ports
# chroot make -C /usr/ports/emulators/wine-fbsd64 package WITH_PKGNG=3Dyes

The package wine-fbsd64-1.5.16,1.txz (in pkgng format) will be available fr=
om=20
/usr/ports/packages/All/

# Conclusion

"It is based completely off the main port and uses the hack to,=20
 effectively, use static linking (or bundling of libraries).  In a
 sense it is a complete, yet quite stable and encompassing, hack. "=20
 - David ;-)

Regards,

--nextPart5411883.dyOoBIXW4W
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEABECAAYFAlCUzHcACgkQUaaFgP9pFrJBmACeLAlaAY5F3qosyuvwnFX7a4M7
3sYAniXRhsWVl4is/jRhEnE3GG5U59QN
=mVfS
-----END PGP SIGNATURE-----

--nextPart5411883.dyOoBIXW4W--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211030949.11291.naylor.b.david>