View | Details | Raw Unified | Return to bug 151747 | Differences between
and this patch

Collapse All | Expand All

(-)wine-fbsd64/ChangeLog (+55 lines)
Line 0 Link Here
1
2012/05/30:
2
 * Fix package arch tag when using the pkgng format
3
4
2012/04/20:
5
 * Fix detection of libraries (move bin32 code earlier to include in lib checks)
6
7
2012/04/05:
8
 * Adapt port to track either stable or development branch (WITH_WINE_STABLE)
9
10
2011/10/23:
11
 * Integrate nvidia patching script
12
13
2011/01/31:
14
 * Remove requirement for post-install-wine hook (post-install-script used)
15
 * Propagate use of WINELIBDIR to USE_LDCONFIG32 and CONFIGURE_ARGS
16
 * Move binbounce script to wine-fsd64 port
17
18
2011/01/07:
19
 * Automatically detect soft dependencies
20
21
2011/01/05:
22
 * Update patch to make it minimally invasive for wine/Makefile
23
24
2011/01/01:
25
 * Update wine to 1.3.10
26
27
2010/10/17:
28
 * Update wine to 1.3.5
29
 * Add support for openal (soft dependency)
30
31
2010/01/18:
32
 * Update wine to 1.1.36
33
 * Follow relative symbolic links to script
34
 * Use readlink (vs `ls -l | sed ...`)
35
36
2009/12/20:
37
 * Correctly set bin/lib directories
38
 * Support running on i386
39
 * Follow symbolic links to script
40
 * Allow spaces in path
41
 * Hard link the bin/* files (otherwise symbolic link following breaks)
42
43
2009/12/19:
44
 * Include freetype (it is a soft dependency)
45
 * Include libXrender (it is a soft dependency)
46
47
2009/12/18:
48
 * Rename to something with a little more sense (wine-amd64-[V] -> wine-fbsd64.[V])
49
 * Fix conflicts (wine conflicts with wine-fbsd64)
50
51
2009/12/17:
52
 * Automatically determine libraries and binaries
53
54
2009/12/08:
55
 * Initial implementation of WINE/i386 on FreeBSD/amd64
(-)wine-fbsd64/Makefile (+73 lines)
Line 0 Link Here
1
# New ports collection Makefile for:	wine-fbsd64
2
# Date created:				2011/01/05
3
# Whom:					David Naylor <naylor.b.david@gmail.com>
4
#
5
# $FreeBSD$
6
7
PKGNAMESUFFIX=	-fbsd64
8
9
# Use the wine port to do most of the heavy lifting
10
.if defined(WITH_WINE_STABLE)
11
MASTERDIR?=	${.CURDIR}/../wine
12
.else
13
MASTERDIR?=	${.CURDIR}/../wine-devel
14
.endif
15
PKGINSTALL=	${.CURDIR}/pkg-install
16
PKGDEINSTALL=	${PKGINSTALL}
17
18
ACTUAL-PACKAGE-DEPENDS=	${DO_NADA}
19
WINELIBDIR=	${PREFIX}/lib32
20
CONFIGURE_ARGS+=	--bindir=${PREFIX}/bin32 --libdir=${WINELIBDIR}
21
CONFLICTS=	wine-[0-9]*
22
PLIST_REINPLACE+=	winelib
23
PLIST_REINPLACE_WINELIB=	s!lib/!lib32/!g
24
WINE_SLAVE_BUILD=	yes
25
USE_LDCONFIG32=	${WINELIBDIR} ${WINELIBDIR}/wine
26
27
# Hook into post-install and do some adapting to make i386 binaries work nicely
28
# under FreeBSD/amd64 (include add dependant i386 libs)
29
post-install-script:
30
	# Install bounce script to access the 32bit executables
31
	${INSTALL_SCRIPT} ${.CURDIR}/files/binbounce ${PREFIX}/bin/wine
32
	for i in `grep ^bin ${TMPPLIST} | xargs -n1 basename` ; do \
33
		[ "$${i}" = "wine" ] || ${LN} -f ${PREFIX}/bin/wine ${PREFIX}/bin/$${i} ; \
34
		echo bin32/$${i} >> ${TMPPLIST} ; \
35
	done
36
	echo '@unexec rmdir %D/bin32 2>/dev/null || true' >> ${TMPPLIST}
37
	# Find all libraries that are linked too (via ldd(1))
38
	grep -v '[@%]' ${TMPPLIST} | sed "s!^!${PREFIX}/!g" | \
39
	xargs -n1 file -F' ' | grep ELF | cut -f1 -d' ' | \
40
	env LD_LIBRARY_PATH=${PREFIX}/lib32:${LD_LIBRARY_PATH} xargs ldd -f '%p\n' \
41
	| sort -u | grep -v '^\(/usr\)\?/lib' | grep -v "^${PREFIX}/lib32/libwine.so" \
42
	| grep -v "^${PREFIX}/lib32/wine" > ${WRKDIR}/winelibs
43
	for i in `cat ${WRKDIR}/winelibs` ; do \
44
		${INSTALL_DATA} $${i} ${PREFIX}/lib32/ ; \
45
		echo lib32/`basename $${i}` >> ${TMPPLIST} ; \
46
	done
47
	# Find all soft dependancies (via strings(1))
48
	grep -v '[@%]' ${TMPPLIST} | sed "s!^!${PREFIX}/!g" | \
49
	xargs -n1 file -F' ' | grep ELF | cut -f1 -d' ' | xargs strings | \
50
	grep '^lib.*\.so' | sort -u > ${WRKDIR}/winesoftlibs
51
	for i in `cat ${WRKDIR}/winesoftlibs` ; do \
52
		if [ -e ${LOCALBASE}/lib/$${i} ] && [ -z "`grep $${i} ${TMPPLIST}`" ] ; then \
53
			${INSTALL_DATA} ${LOCALBASE}/lib/$${i} ${PREFIX}/lib32/ ; \
54
			echo lib32/$${i} >> ${TMPPLIST} ; \
55
		fi ; \
56
	done
57
	# Install nvidia patching script
58
	${INSTALL_SCRIPT} ${.CURDIR}/files/nvidia.sh ${DATADIR}/patch-nvidia.sh
59
	echo ${DATADIR:S|$(PREFIX)/||}/patch-nvidia.sh >> ${TMPPLIST}
60
	@${ECHO}
61
	${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
62
	${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
63
	@${CAT} ${PKGMESSAGE}
64
65
.if defined(WITH_PKGNG)
66
post-package-script:
67
	${XZ_CMD} -dc ${PKGFILE} | \
68
	${SED} -e "s/^\(arch: freebsd:.*:x86\):32/\1:64/" | \
69
	${XZ_CMD} > ${WRKDIR}/${PKGNAME}.txz
70
	${MV} ${WRKDIR}/${PKGNAME}.txz ${PKGFILE}
71
.endif
72
73
.include "${MASTERDIR}/Makefile"
(-)wine-fbsd64/files/binbounce (+32 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
TARGET="$0"
4
_count=0
5
while [ -L "$TARGET" ]
6
do
7
  _old="$TARGET"
8
  TARGET="`readlink "$TARGET"`"
9
  if [ ! -e "$TARGET" ]
10
  then
11
    TARGET="`dirname "$_old"`/$TARGET"
12
  fi
13
  _count=$(($_count + 1))
14
  if [ $_count -gt 100 ]
15
  then
16
    echo "$0: to many symbolic links" > /dev/stderr
17
    exit 1
18
  fi
19
done
20
21
LOCALBASE=`dirname "$TARGET"`/..
22
BINNAME=`basename "$TARGET"`
23
24
if [ `uname -p` = i386 ]
25
then
26
  export LD_LIBRARY_PATH="$LOCALBASE/lib32":"$LOCALBASE/lib32/wine":"$LD_LIBRARY_PATH"
27
else
28
  export LD_32_LIBRARY_PATH="$LOCALBASE/lib32":"$LOCALBASE/lib32/wine":"$LD_32_LIBRARY_PATH"
29
fi
30
export PATH="$LOCALBASE/bin32":"$PATH"
31
32
exec "$LOCALBASE/bin32/$BINNAME" "$@"
(-)wine-fbsd64/files/nvidia.sh (+147 lines)
Line 0 Link Here
1
#!/bin/sh
2
# Copyright 2010, 2011, 2012 David Naylor <naylor.b.david@gmail.com>.
3
#       All rights reserved.
4
#
5
# Redistribution and use in source and binary forms, with or without
6
# modification, are permitted provided that the following conditions are met:
7
#
8
#   1. Redistributions of source code must retain the above copyright notice,
9
#      this list of conditions and the following disclaimer.
10
#
11
#   2. Redistributions in binary form must reproduce the above copyright notice,
12
#      this list of conditions and the following disclaimer in the documentation
13
#      and/or other materials provided with the distribution.
14
#
15
# THIS SOFTWARE IS PROVIDED BY David Naylor ``AS IS'' AND ANY EXPRESS OR IMPLIED
16
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
18
# EVENT SHALL David Naylor OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
19
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
21
# OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
23
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
24
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
#
26
# The views and conclusions contained in the software and documentation are
27
# those of the authors and should not be interpreted as representing official
28
# policies, either expressed or implied, of David Naylor.
29
30
# Version 1.0 - 2010/05/28
31
#  - initial release
32
# Version 1.1 - 2010/10/04
33
#  - add support for 256 driver series
34
#  - use passive connections for FTP
35
#  - allow resuming of downloads if they were interrupted
36
#  - add license and copyright notice
37
# Version 1.2 - 2010/10/17
38
#  - try to save the NVIDIA tarball under $PORTSDIR/distfiles
39
#  - obay $PREFIX
40
#  - extract files directly to destination (avoids using /tmp)
41
# Version 1.3 - 2010/11/02
42
#  - add support for future driver series
43
# Version 1.4 - 2011/05/23
44
#  - add support for legacy drivers
45
# Version 1.5 - 2011/10/23
46
#  - add support for no-fetch mode
47
#  - backup the original openGL.so.1 library
48
49
set -e
50
51
PORTSDIR=${PORTSDIR:-/usr/ports}
52
PREFIX=${PREFIX:-/usr/local}
53
DISTDIR=${DISTDIR:-${PORTSDIR}/distfiles}
54
55
if [ -d $DISTDIR ]
56
then
57
  cd $DISTDIR
58
  NO_REMOVE_NVIDIA="yes"
59
else
60
  cd /tmp/
61
fi
62
63
terminate() {
64
65
  echo "!!! $2 !!!"
66
  echo "Terminating..."
67
  exit $1
68
69
}
70
71
args=`getopt -n $*`
72
if [ $? -ne 0 ]
73
then
74
  echo "Usage: $0 [-n]"
75
  exit 7
76
fi
77
set -- $args
78
while true
79
do
80
  case $1 in
81
    -n)
82
      NO_FETCH=yes
83
      ;;
84
    --)
85
      shift
86
      break
87
      ;;
88
  esac
89
  shift
90
done
91
92
[ `whoami` = root ] \
93
  || terminate 254 "This script should be run as root"
94
95
echo "===> Patching wine-fbsd64 to work with x11/nvidia-driver:"
96
97
if [ -z "${WINE}" ]
98
then
99
  WINE=`pkg_info -E wine-fbsd64'*' | cut -f 3 -d -`
100
fi
101
[ -n "$WINE" ] \
102
  || terminate 255 "Unable to detect wine-fbsd64, please install first"
103
echo "=> Detected wine-fbsd64: ${WINE}"
104
105
NV=`pkg_info -E nvidia-driver-'*' | cut -f 3 -d -`
106
[ -n "$NV" ] \
107
  || terminate 1 "Unable to detect nvidia-driver, please install first"
108
echo "=> Detected nvidia-driver: ${NV}"
109
110
NVIDIA=${NV}
111
NV=`echo ${NV} | cut -f 1 -d _ | cut -f 1 -d ,`
112
113
if [ ! -f NVIDIA-FreeBSD-x86-${NV}.tar.gz ]
114
then
115
  [ -n "$NO_FETCH" ] \
116
    && terminate 8 "NVIDIA-FreeBSD-x86-${NV}.tar.gz unavailable"
117
  echo "=> Downloading NVIDIA-FreeBSD-x86-${NV}.tar.gz from ftp://download.nvidia.com..."
118
  fetch -pRr ftp://download.nvidia.com/XFree86/FreeBSD-x86/${NV}/NVIDIA-FreeBSD-x86-${NV}.tar.gz \
119
    || terminate 2 "Failed to download NVIDIA-FreeBSD-x86-${NV}.tar.gz"
120
fi
121
122
echo "=> Extracting NVIDIA-FreeBSD-x86-${NV}.tar.gz to $PREFIX/lib32..."
123
EXTRACT_LIST="libGL.so.1"
124
case $NV in
125
  195*|173*|96*|71*)
126
    EXTRACT_LIST="$EXTRACT_LIST libGLcore.so.1 libnvidia-tls.so.1"
127
    ;;
128
  *)
129
    EXTRACT_LIST="$EXTRACT_LIST libnvidia-glcore.so.1 libnvidia-tls.so.1"
130
    ;;
131
esac
132
133
EXTRACT_ARGS="--strip-components 2 -C $PREFIX/lib32"
134
for i in $EXTRACT_LIST
135
do
136
  EXTRACT_ARGS="$EXTRACT_ARGS --include NVIDIA-FreeBSD-x86-${NV}/obj/$i"
137
done
138
[ -f ${PREFIX}/lib32/libGL.so.1~ ] \
139
  || cp ${PREFIX}/lib32/libGL.so.1 ${PREFIX}/lib32/libGL.so.1~
140
tar $EXTRACT_ARGS -xvf NVIDIA-FreeBSD-x86-${NV}.tar.gz \
141
  || terminate 3 "Failed to extract NVIDIA-FreeBSD-x86-${NV}.tar.gz"
142
143
echo "=> Cleaning up..."
144
[ -n "$NO_REMOVE_NVIDIA" ] || rm -vf NVIDIA-FreeBSD-x86-${NV}.tar.gz \
145
  || terminate 6 "Failed to remove files"
146
147
echo "===> wine-fbsd64-${WINE} successfully patched for nvidia-driver-${NVIDIA}"
(-)wine-fbsd64/pkg-install (+41 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
PKG_PREFIX=${PKG_PREFIX-/usr/local}
4
export PREFIX=${PKG_PREFIX}
5
export WINE=$1
6
7
case "$2" in
8
  PRE-INSTALL|DEINSTALL)
9
    mv -f ${PKG_PREFIX}/lib32/libGL.so.1~ ${PKG_PREFIX}/lib32/libGL.so.1 > /dev/null 2>&1
10
    rm -f ${PKG_PREFIX}/lib32/libGLcore.so.1 ${PKG_PREFIX}/lib32/libnvidia-glcore.so.1 ${PKG_PREFIX}/lib32/libnvidia-tls.so.1
11
    ;;
12
  POST-INSTALL)
13
    sh ${PKG_PREFIX}/share/wine/patch-nvidia.sh -n > /dev/null 2>&1
14
    case $? in
15
      0)
16
        cat << _EOF
17
$1 has been patched for use with nvidia graphics driver.  If
18
the version of the installed nvidia graphics driver changes execute (as root):
19
_EOF
20
        ;;
21
      1)
22
        cat << _EOF
23
This system does not appear to use a nvidia graphics driver.  If this changes
24
and then every time the driver's version changes execute (as root)
25
_EOF
26
        ;;
27
      *)
28
        cat << _EOF
29
A NVIDIA GRAPHICS DRIVER HAS BEEN DETECTED ON THIS SYSTEM AND THE AUTOMATED
30
PATCHING HAS FAILED, execute (as root)
31
_EOF
32
        ;;
33
    esac
34
    cat << _EOF
35
	sh ${PKG_PREFIX}/share/wine/patch-nvidia.sh
36
to get 2D/3D acceleration to work with the nvidia driver.  Without this wine
37
will crash when a program requires 2D/3D graphics acceleration.
38
39
_EOF
40
    ;;
41
esac

Return to bug 151747