source: build-files/ports-overlay/emulators/virtualbox-ose-additions/Makefile @ 58663b0

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3releng/10.1
Last change on this file since 58663b0 was 58663b0, checked in by Kris Moore <kris@…>, 14 months ago

Fix up next wave of ports

  • Property mode set to 100644
File size: 5.6 KB
Line 
1# Created by: Bernhard Froehlich <decke@bluelife.at>
2# $FreeBSD: emulators/virtualbox-ose-additions/Makefile 327721 2013-09-20 16:43:52Z bapt $
3
4PORTNAME=       virtualbox-ose
5DISTVERSION=    4.2.18
6CATEGORIES=     emulators kld
7MASTER_SITES=   http://download.virtualbox.org/virtualbox/${DISTVERSION}/ \
8                http://tmp.chruetertee.ch/ \
9                http://disasterarea.chruetertee.ch/
10PKGNAMESUFFIX=  -additions
11DISTNAME=       VirtualBox-${DISTVERSION}
12
13MAINTAINER=     vbox@FreeBSD.org
14COMMENT=        VirtualBox additions for FreeBSD guests
15
16LICENSE=        GPLv2
17LICENSE_FILE=   ${WRKSRC}/COPYING
18
19BUILD_DEPENDS=  yasm:${PORTSDIR}/devel/yasm \
20                as86:${PORTSDIR}/devel/dev86 \
21                kmk:${PORTSDIR}/devel/kBuild
22
23UNIQUENAME=     ${PORTNAME}${PKGNAMESUFFIX}
24WRKSRC=         ${WRKDIR}/VirtualBox-${PORTVERSION}
25USE_GCC=        4.7
26USE_RC_SUBR=    vboxguest vboxservice
27USES=           iconv
28ONLY_FOR_ARCHS= i386 amd64
29FETCH_ARGS=     -pRr
30USE_BZIP2=      yes
31MAKE_JOBS_UNSAFE=       yes
32
33HAS_CONFIGURE=  yes
34CONFIGURE_ARGS+=--with-gcc="${CC}" --with-g++="${CXX}" --nofatal \
35                --disable-xpcom --disable-sdl-ttf --disable-pulse \
36                --disable-alsa --disable-dbus --disable-python
37
38CONFLICTS=      bcc-[0-9]*
39CONFLICTS_INSTALL=      virtualbox-ose-additions-devel-[3,4]* virtualbox-ose-[3,4]* virtualbox-ose-devel-[3,4]* virtualbox-ose-legacy-[3,4]*
40
41OPTIONS_DEFINE= DEBUG X11 OPENGL
42OPTIONS_DEFAULT=        X11
43
44NO_STAGE=       yes
45.include <bsd.port.options.mk>
46
47PLIST_SUB+=     KMODDIR=${KMODDIR:C,^/,,}
48
49KMODDIR=        /boot/modules
50SRC_BASE?=      /usr/src
51VIDEODIR=       ${PREFIX}/lib/xorg/modules/drivers
52INPUTDIR=       ${PREFIX}/lib/xorg/modules/input
53
54VBOX_BIN=       ${WRKSRC}/out/${KMK_ARCH}/${KMK_BUILDTYPE}/bin/additions
55
56KMK_BUILDTYPE=  release
57KMK_CONFIG=     VBOX_LIBPATH_X11=${LOCALBASE}
58KMK_FLAGS=
59
60MAKE_FLAGS=     SYSDIR=${SRC_BASE}/sys
61
62.if ${PORT_OPTIONS:MDEBUG}
63KMK_FLAGS+=     BUILD_TYPE=debug
64KMK_BUILDTYPE=  debug
65MAKE_FLAGS+=    DEBUG_FLAGS="-O1 -g"
66PLIST_SUB+=     WITH_DEBUG=""
67.else
68PLIST_SUB+=     WITH_DEBUG="@comment "
69.endif
70
71.if ${PORT_OPTIONS:MX11}
72VBOX_WITH_X11=  1
73USE_XORG=       xcursor xmu inputproto xorg-server xrandr
74PLIST_SUB+=     X11=""
75.else
76VBOX_WITH_X11=
77PLIST_SUB+=     X11="@comment "
78.endif
79
80.if ${PORT_OPTIONS:MOPENGL}
81USE_XORG+=      xcomposite xdamage xext xfixes
82USE_GL=         gl
83PLIST_SUB+=     OPENGL=""
84.else
85CONFIGURE_ARGS+=--disable-opengl
86PLIST_SUB+=     OPENGL="@comment "
87.endif
88
89.if ${ARCH} == i386
90KMK_ARCH=       freebsd.x86
91.else
92KMK_ARCH=       freebsd.${ARCH}
93.endif
94
95XSERVER_ABI:=   ${XSERVER_VER:S/.//:R}
96
97.if !exists(${SRC_BASE}/sys/kern/bus_if.m)
98IGNORE=         requires kernel sources
99.endif
100
101.include <bsd.port.pre.mk>
102
103pre-everything::
104.if ${ARCH} == "amd64"
105.if !exists(/usr/lib32/libc.so)
106        @${ECHO} 'Requires 32-bit libraries installed under /usr/lib32.'
107        @${ECHO} 'Do: cd /usr/src; make build32 install32; ldconfig -v -m -R /usr/lib32'
108        @${FALSE}
109.endif
110.endif
111
112post-patch:
113        @${ECHO} 'VBOX_ONLY_ADDITIONS = 1' > ${WRKSRC}/LocalConfig.kmk
114        @${ECHO} 'VBOX_WITH_X11_ADDITIONS = ${VBOX_WITH_X11}' >> ${WRKSRC}/LocalConfig.kmk
115        @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
116                ${WRKSRC}/Config.kmk \
117                ${WRKSRC}/configure \
118                ${WRKSRC}/kBuild/units/qt4.kmk \
119                ${WRKSRC}/kBuild/sdks/LIBSDL.kmk \
120                ${WRKSRC}/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
121                ${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop
122        @${REINPLACE_CMD} -e 's|\$$KBUILDDIR_BIN/kmk_sed|${LOCALBASE}/bin/kmk_sed|g' ${WRKSRC}/configure
123.if empty(ICONV_LIB)
124        @${REINPLACE_CMD} -e 's|iconv||' ${WRKSRC}/Config.kmk ${WRKSRC}/src/VBox/Runtime/Makefile.kmk \
125                ${WRKSRC}/src/VBox/Additions/x11/VBoxClient/Makefile.kmk
126.endif
127
128pre-build:
129        @${REINPLACE_CMD} -e 's|/bin/bash|/bin/sh|' \
130                ${WRKSRC}/env.sh \
131                ${WRKSRC}/src/VBox/Additions/freebsd/Installer/vboxguest.sh
132
133do-build:
134        cd ${WRKSRC} && ${SH} env.sh && ${KMK_CONFIG} ${LOCALBASE}/bin/kmk ${KMK_FLAGS}
135        cd ${VBOX_BIN}/src && make ${MAKE_FLAGS}
136
137do-install:
138        ${MKDIR} ${KMODDIR}
139        ${INSTALL_KLD} ${VBOX_BIN}/src/vboxguest/vboxguest.ko ${KMODDIR}
140.if ${PORT_OPTIONS:MDEBUG}
141        ${INSTALL_KLD} ${VBOX_BIN}/src/vboxguest/vboxguest.ko.symbols ${KMODDIR}
142.endif
143.if ${PORT_OPTIONS:MX11}
144        ${INSTALL_KLD} ${VBOX_BIN}/vboxvideo.ko ${KMODDIR}
145.if ${PORT_OPTIONS:MDEBUG}
146        ${INSTALL_KLD} ${VBOX_BIN}/vboxvideo.ko.symbols ${KMODDIR}
147.endif
148.endif
149        @/usr/sbin/kldxref ${KMODDIR}
150
151        ${MKDIR} ${PREFIX}/etc/rc.d/
152
153        ${MKDIR} ${PREFIX}/sbin
154        ${INSTALL_PROGRAM} ${VBOX_BIN}/VBoxControl ${PREFIX}/sbin/
155        ${INSTALL_PROGRAM} ${VBOX_BIN}/VBoxService ${PREFIX}/sbin/
156
157.if ${PORT_OPTIONS:MX11}
158        ${INSTALL_PROGRAM} ${VBOX_BIN}/VBoxClient ${PREFIX}/bin/
159
160        ${MKDIR} ${PREFIX}/bin
161        ${INSTALL_SCRIPT} ${WRKSRC}/src/VBox/Additions/x11/Installer/98vboxadd-xclient \
162                ${PREFIX}/bin/VBoxClient-all
163
164        # X11 autostart
165        ${MKDIR} ${PREFIX}/etc/xdg/autostart/
166        ${INSTALL_DATA} ${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \
167                ${PREFIX}/etc/xdg/autostart/
168
169        # KDE autostart
170        ${MKDIR} ${PREFIX}/share/autostart/
171        ${INSTALL_DATA} ${WRKSRC}/src/VBox/Additions/x11/Installer/vboxclient.desktop \
172                ${PREFIX}/share/autostart/
173
174        ${MKDIR} ${VIDEODIR}
175        ${INSTALL_DATA} ${VBOX_BIN}/vboxvideo_drv_${XSERVER_ABI}.so ${VIDEODIR}/vboxvideo_drv.so
176
177        ${MKDIR} ${INPUTDIR}
178        ${INSTALL_DATA} ${VBOX_BIN}/vboxmouse_drv_${XSERVER_ABI}.so ${INPUTDIR}/vboxmouse_drv.so
179.endif
180
181.if ${PORT_OPTIONS:MOPENGL}
182        ${MKDIR} ${PREFIX}/lib
183        ${INSTALL_DATA} ${VBOX_BIN}/VBoxOGL.so ${PREFIX}/lib/
184        ${INSTALL_DATA} ${VBOX_BIN}/VBoxOGLarrayspu.so ${PREFIX}/lib/
185        ${INSTALL_DATA} ${VBOX_BIN}/VBoxOGLcrutil.so ${PREFIX}/lib/
186        ${INSTALL_DATA} ${VBOX_BIN}/VBoxOGLerrorspu.so ${PREFIX}/lib/
187        ${INSTALL_DATA} ${VBOX_BIN}/VBoxOGLfeedbackspu.so ${PREFIX}/lib/
188        ${INSTALL_DATA} ${VBOX_BIN}/VBoxOGLpackspu.so ${PREFIX}/lib/
189        ${INSTALL_DATA} ${VBOX_BIN}/VBoxOGLpassthroughspu.so ${PREFIX}/lib/
190
191        ${MKDIR} ${PREFIX}/lib/dri
192        ${LN} -sf ${PREFIX}/lib/VBoxOGL.so ${PREFIX}/lib/dri/vboxvideo_dri.so
193.endif
194
195post-install:
196        @${CAT} ${PKGMESSAGE}
197
198.include <bsd.port.post.mk>
Note: See TracBrowser for help on using the repository browser.