From owner-svn-ports-head@FreeBSD.ORG Sat Aug 10 15:46:31 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 208DBE79; Sat, 10 Aug 2013 15:46:31 +0000 (UTC) (envelope-from dbn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F3B8B22E5; Sat, 10 Aug 2013 15:46:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r7AFkUEM058458; Sat, 10 Aug 2013 15:46:30 GMT (envelope-from dbn@svn.freebsd.org) Received: (from dbn@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r7AFkUNj058457; Sat, 10 Aug 2013 15:46:30 GMT (envelope-from dbn@svn.freebsd.org) Message-Id: <201308101546.r7AFkUNj058457@svn.freebsd.org> From: David Naylor Date: Sat, 10 Aug 2013 15:46:30 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r324548 - head/emulators/i386-wine-devel X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Aug 2013 15:46:31 -0000 Author: dbn Date: Sat Aug 10 15:46:30 2013 New Revision: 324548 URL: http://svnweb.freebsd.org/changeset/ports/324548 Log: Enable packaging of emulators/i386-wine-devel on amd64 (part 2/2). CHANGES ------- Provide two ports, in one. When compiling on i386 the port behaves as a slave port of wine-devel, creating a package suitable for installation on amd64. No change here When compiling on amd64 the port manually installs the provided amd64 packages (see wiki.FreeBSD.org/i386-Wine for those packages) and thus allowing the packages to be "build" using the FreeBSD infrastructure, and critically, to appear in the standard package set without requiring users to manually add these packages to their systems. DESIGN ------ The bootstrapping (for choosing between i386 and amd64 Makefiles) was done manually as Makefile.i386 is a slave port while Makefile.inc (for amd64) is a master port. This situation does not work in the current infrastructure thus requiring a manual bootstrap. PRECEDENT --------- Although Ports does not support cross compiling of packages there is precedent in supplying binary packages for those situations where, otherwise, cross compiling is required. In support of taking this approach I site: - misc/compat?x ports - */linux-* ports Modified: head/emulators/i386-wine-devel/Makefile Modified: head/emulators/i386-wine-devel/Makefile ============================================================================== --- head/emulators/i386-wine-devel/Makefile Sat Aug 10 15:43:59 2013 (r324547) +++ head/emulators/i386-wine-devel/Makefile Sat Aug 10 15:46:30 2013 (r324548) @@ -1,90 +1,16 @@ -# Created by: David Naylor +# Created by: David Naylor (dbn@FreeBSD.org) # $FreeBSD$ -PKGNAMEPREFIX= i386- - -MAINTAINER= dbn@FreeBSD.org -COMMENT= 32bit Microsoft Windows compatibility environment for 64bit FreeBSD -LATEST_LINK= ${PKGNAMEPREFIX}wine-devel - -# Use the wine port to do most of the heavy lifting -MASTERDIR= ${.CURDIR}/../wine-devel -PKGINSTALL= ${.CURDIR}/files/pkg-install -PKGDEINSTALL= ${PKGINSTALL} - -RUN_DEPENDS= dri>0:${PORTSDIR}/graphics/dri - -ACTUAL-PACKAGE-DEPENDS= ${DO_NADA} -WINELIBDIR= ${PREFIX}/lib32 -CONFIGURE_ARGS+= --bindir=${PREFIX}/bin32 --libdir=${WINELIBDIR} -CONFLICTS= wine-[0-9]* -PLIST_REINPLACE+= winelib -PLIST_REINPLACE_WINELIB= s!lib/!lib32/!g -WINE_SLAVE_BUILD= yes -USE_LDCONFIG32= ${WINELIBDIR} ${WINELIBDIR}/wine - -# Hook into post-install and do some adapting to make i386 binaries work nicely -# under FreeBSD/amd64 -post-install-script: - # Install bounce script to access the 32bit executables - ${INSTALL_SCRIPT} ${.CURDIR}/files/binbounce ${PREFIX}/bin/wine - for i in `grep ^bin ${TMPPLIST} | xargs -n1 basename` ; do \ - [ "$${i}" = "wine" ] || ${LN} -f ${PREFIX}/bin/wine ${PREFIX}/bin/$${i} ; \ - echo bin32/$${i} >> ${TMPPLIST} ; \ - done - # Install dri libraries (internal libGL requirements) - ${MKDIR} ${PREFIX}/lib32/.libGL/dri - for i in ${LOCALBASE}/lib/dri/*.so; do \ - ${INSTALL_DATA} $${i} ${PREFIX}/lib32/.libGL/dri/ ; \ - echo lib32/.libGL/dri/$${i##*/} >> ${TMPPLIST} ; \ - done - # 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=${PREFIX}/lib32:${LD_LIBRARY_PATH} xargs ldd -f '%p\n' \ - | sort -u | grep -v '^\(/usr\)\?/lib' | grep -v "^${PREFIX}/lib32/libwine.so" \ - | grep -v "^${PREFIX}/lib32/wine" > ${WRKDIR}/winelibs - for i in `cat ${WRKDIR}/winelibs` ; do \ - if [ `basename $${i}` != libGL.so.1 ]; then \ - ${INSTALL_DATA} $${i} ${PREFIX}/lib32/ ; \ - echo lib32/$${i##*/} >> ${TMPPLIST} ; \ - else \ - ${INSTALL_DATA} $${i} ${PREFIX}/lib32/.libGL/ ; \ - echo lib32/.libGL/libGL.so.1 >> ${TMPPLIST} ; \ - fi ; \ - 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 - echo '@dirrm lib32/.libGL/dri' >> ${TMPPLIST} - echo '@dirrm lib32/.libGL' >> ${TMPPLIST} - if [ -n "${WITH_PKGNG}" ]; then \ - echo '@dirrmtry lib32' >> ${TMPPLIST}; \ - else \ - echo '@unexec rmdir %D/lib32 2>/dev/null || true' >> ${TMPPLIST}; \ - fi - echo '@dirrm bin32' >> ${TMPPLIST} - # Install nvidia patching script - ${INSTALL_SCRIPT} ${.CURDIR}/files/nvidia.sh ${DATADIR}/patch-nvidia.sh - echo ${DATADIR:S|$(PREFIX)/||}/patch-nvidia.sh >> ${TMPPLIST} - @${ECHO} - ${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL - ${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL - @${CAT} ${PKGMESSAGE} - -post-package-script: - if [ -n "${WITH_PKGNG}" ]; then \ - ${XZ_CMD} -dc ${PKGFILE} | \ - ${SED} -e "s/^\(arch: freebsd:.*:x86\):32/\1:64/" | \ - ${XZ_CMD} > ${WRKDIR}/${PKGNAME}${PKG_SUFX}; \ - ${MV} ${WRKDIR}/${PKGNAME}${PKG_SUFX} ${PKGFILE}; \ - fi - -.include "${MASTERDIR}/Makefile" +# Special bootstrapper to allow: +# - i386 specific port to be slave to ${PORTSDIR}/emulators/wine-devel +# - amd64 specific port to be normal port (based on binary package) + +.if !defined(ARCH) +ARCH!= uname -p +.endif + +.if ${ARCH} == i386 +.include "${.CURDIR}/Makefile.i386" +.else +.include "${.CURDIR}/Makefile.inc" +.endif