source: build-files/ports-overlay/emulators/virtualbox-ose-additions/Makefile @ 2c8bed6

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

Use default compiler for virtualbox-ose-additions

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