# Created by: David Naylor # $FreeBSD$ PKGNAMEPREFIX= i386- MAINTAINER= dbn@FreeBSD.org COMMENT?= 32bit Microsoft Windows compatibility environment for 64bit FreeBSD # Use the wine port to do most of the heavy lifting SLAVEDIR?= ${.CURDIR} MASTERDIR= ${SLAVEDIR}/../wine PKGINSTALL= ${SLAVEDIR}/files/pkg-install PKGDEINSTALL= ${PKGINSTALL} RUN_DEPENDS= dri>0:graphics/dri CONFLICTS_INSTALL?= wine-[0-9]* wine-staging-[0-9]* wine-devel-[0-9]* \ i386-wine-staging-[0-9]* i386-wine-devel-[0-9]* ACTUAL-PACKAGE-DEPENDS= ${DO_NADA} WINELIBDIR= ${PREFIX}/lib32 CONFIGURE_ARGS+= --bindir=${PREFIX}/bin32 --libdir=${WINELIBDIR} PLIST_REINPLACE+= winelib PLIST_REINPLACE_WINELIB= s!lib/!lib32/!g WINE_SLAVE_BUILD= yes USE_LDCONFIG32= ${WINELIBDIR} ${WINELIBDIR}/wine BUNDLE_LIBS= yes .if !defined(WINE_CROSS_BUILD) IGNORE= This port is not for consumption on FreeBSD/i386. To cross-build for FreeBSD/amd64: make -DWINE_CROSS_BUILD .endif # Hook into post-install and do some adapting to make i386 binaries work nicely # under FreeBSD/amd64 post-install-script: # Fix pkg-plist references ${REINPLACE_CMD} -e 's!lib/!lib32/!g' ${TMPPLIST} # Install bounce script to access the 32bit executables ${INSTALL_SCRIPT} ${SLAVEDIR}/files/binbounce ${STAGEDIR}${PREFIX}/bin/wine for i in `grep ^bin ${TMPPLIST} | xargs -n1 basename` ; do \ [ "$${i}" = "wine" ] || ${LN} -f ${STAGEDIR}${PREFIX}/bin/wine ${STAGEDIR}${PREFIX}/bin/$${i} ; \ echo bin32/$${i} >> ${TMPPLIST} ; \ done # Install libGL ${MKDIR} ${STAGEDIR}${PREFIX}/lib32/.libGL/dri ${INSTALL_DATA} ${LOCALBASE}/lib/libGL.so.1 ${STAGEDIR}${PREFIX}/lib32/.libGL/ echo lib32/.libGL/libGL.so.1 >> ${TMPPLIST} # Install dri libraries (internal libGL requirements) for i in ${LOCALBASE}/lib/dri/*.so; do \ ${INSTALL_DATA} $${i} ${STAGEDIR}${PREFIX}/lib32/.libGL/dri/ ; \ echo lib32/.libGL/dri/$${i##*/} >> ${TMPPLIST} ; \ done # Find all soft dependencies (via strings(1)) grep -v '[@%]' ${TMPPLIST} | sed "s!^!${STAGEDIR}${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} ${STAGEDIR}${PREFIX}/lib32/ ; \ echo lib32/$${i} >> ${TMPPLIST} ; \ fi ; \ done # Find all libraries that are linked too (via ldd(1)) grep -v '[@%]' ${TMPPLIST} | sed "s!^!${STAGEDIR}${PREFIX}/!g" | \ xargs -n1 file -F' ' | grep ELF | cut -f1 -d' ' | \ env LD_LIBRARY_PATH=${STAGEDIR}${PREFIX}/lib32:${LD_LIBRARY_PATH} xargs ldd -f '%p\n' \ | sort -u | grep -v '^\(/usr\)\?/lib' | grep -v "^${STAGEDIR}${PREFIX}/lib32/libwine.so" \ | grep -v "^${STAGEDIR}${PREFIX}/lib32/wine" > ${WRKDIR}/winelibs for i in `cat ${WRKDIR}/winelibs` ; do \ if [ -z "`grep $${i##*/} ${TMPPLIST}`" ]; then \ ${INSTALL_DATA} $${i} ${STAGEDIR}${PREFIX}/lib32/ ; \ echo lib32/$${i##*/} >> ${TMPPLIST} ; \ fi ; \ done # Install nvidia patching script ${INSTALL_SCRIPT} ${SLAVEDIR}/files/nvidia.sh ${STAGEDIR}${DATADIR}/patch-nvidia.sh echo ${DATADIR:S|$(PREFIX)/||}/patch-nvidia.sh >> ${TMPPLIST} @${CAT} ${PKGMESSAGE} .include "${MASTERDIR}/Makefile"