2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"). You may
4 # only use this file in accordance with the terms of the CDDL.
6 # A full copy of the text of the CDDL should have accompanied this
7 # source. A copy of the CDDL is also available via the Internet at
8 # http://www.illumos.org/license/CDDL.
12 # Copyright 2017 Aurelien Larcher
13 # Copyright 2020 Michal Nowak
14 # Copyright 2019 Tim Mooney
15 # Copyright 2020 Jim Klimov
16 # Copyright 2021 omnios.org wrt the ctx patches
17 # Copyright 2022 Daniel Bell
19 include ..
/..
/..
/make-rules
/shared-macros.mk
22 COMPONENT_NAME
= VirtualBox
23 COMPONENT_VERSION
= 7.1.4
25 COMPONENT_SUMMARY
= VirtualBox
- general-purpose full virtualizer
26 COMPONENT_PROJECT_URL
= https
://www.virtualbox.org
/
27 COMPONENT_DOWNLOAD_URL
= https
://download.virtualbox.org
/virtualbox
/$(COMPONENT_VERSION
)
28 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
29 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.bz2
30 COMPONENT_ARCHIVE_URL
= $(COMPONENT_DOWNLOAD_URL
)/$(COMPONENT_ARCHIVE
)
31 COMPONENT_FMRI
= system
/virtualbox
32 COMPONENT_CLASSIFICATION
=System
/Virtualization
33 COMPONENT_LICENSE
= GPL-3.0
-only
34 COMPONENT_LICENSE_FILE
= COPYING
36 HASH_DIR
= $(COMPONENT_DIR
)/hashes
40 DEFAULT_HASH_FILES
= SHA256SUMS
41 export DEFAULT_HASH_FILES
43 # We need the hashfile before even parsing the Makefile since we need the build number from it.
44 ifeq (,$(wildcard $(HASH_DIR
)/SHA256SUMS
))
45 $(shell curl
-q
-o
$(HASH_DIR
)/SHA256SUMS
$(COMPONENT_DOWNLOAD_URL
)/SHA256SUMS
)
47 SDK_BUILD_NUM
=$(shell sed
-E
'/ [ \*]VirtualBoxSDK.*zip/!d;s/(^[0-9a-fA-F]+ [ \*]VirtualBoxSDK-[0-9\.]+-)([0-9]+)(.*$$)/\2/' $(HASH_DIR
)/SHA256SUMS
)
50 COMPONENT_NAME_1
= VirtualBoxSDK
51 COMPONENT_VERSION_1
= $(COMPONENT_VERSION
)-$(SDK_BUILD_NUM
)
52 COMPONENT_SRC_1
= $(COMPONENT_NAME_1
)-$(COMPONENT_VERSION_1
)
53 COMPONENT_ARCHIVE_URL_1
=$(COMPONENT_DOWNLOAD_URL
)/$(COMPONENT_ARCHIVE_1
)
54 COMPONENT_ARCHIVE_1
= $(COMPONENT_SRC_1
).zip
55 COMPONENT_LICENSE_1
= GPL-3.0
-only
57 UNPACK_ARGS_1
= -r
$(COMPONENT_SRC_1
)
59 COMPONENT_POST_UNPACK_ACTION_1
= \
60 cd
$(COMPONENT_SRC
); $(LN
) -s ..
/$(COMPONENT_SRC_1
)/sdk .
;
62 TEST_TARGET
= $(NO_TESTS
)
63 include $(WS_MAKE_RULES
)/common.mk
68 INSTALL_ADDITIONS
= $(BUILD_DIR
)/.install_additions
70 X11_SERVERDRV_DIR
= /usr
/lib
/xorg
/modules
/drivers
/$(MACH64
)
72 X11_SERVERINP_DIR
= /usr
/lib
/xorg
/modules
/input
/$(MACH64
)
74 VBOX_BINDIR
= $(BUILD_DIR_64
)/out
/solaris.
$(MACH64
)/$(FLAVOUR
)/bin
/additions
/
75 VBOX_MODULES
= vboxguest vboxms vboxvideo
76 VBOX_FS_MODULES
= vboxfs
78 VBOX_BINS
= VBoxControl VBoxService VBoxClient
81 QT5_ROOT
=/usr
/lib
/qt
/6.6
82 PATH
=$(PATH.gnu
):$(QT5_ROOT
)/bin
/$(MACH64
)
83 PKG_CONFIG_PATH
=$(PKG_CONFIG_PATH.
$(BITS
)):$(QT5_ROOT
)/lib
/$(MACH64
)/pkgconfig
85 CONFIGURE_SCRIPT
=$(@D
)/configure
87 # Build for the system Xorg (only possibility for 1.19) or for any guest up to 1.18
89 ifeq ($(strip $(USE_SYSTEM_X11
)),yes
)
90 LOCAL_CONFIG
+='\nVBOX_USE_SYSTEM_XORG_HEADERS = 1'
91 LOCAL_CONFIG
+='\nVBOX_USE_SYSTEM_GL_HEADERS = 1'
94 COMPONENT_BUILD_GMAKE_ARGS
=
96 COMPONENT_BUILD_TARGETS
=
97 COMPONENT_INSTALL_GMAKE_ARGS
=
98 COMPONENT_INSTALL_ARGS
=
99 COMPONENT_INSTALL_TARGETS
=
101 LOCAL_CONFIG
+= '\nVBOX_WITH_VBOXDRV = 1'
102 LOCAL_CONFIG
+= '\nVBOX_WITH_NETFLT = 1'
103 LOCAL_CONFIG
+= '\nVBOX_WITH_NETADP = 1'
105 # Disable audio/video-recording
106 LOCAL_CONFIG
+= '\nVBOX_WITH_VIDEOREC ='
107 LOCAL_CONFIG
+= '\nVBOX_WITH_AUDIO_VIDEOREC ='
109 # Enable building with pulse audio support
110 LOCAL_CONFIG
+='\nVBOX_WITH_AUDIO_PULSE = 1'
112 LOCAL_CONFIG
+='\nVBOX_GCC_OPT=$(CXXFLAGS)'
113 LOCAL_CONFIG
+='\nVBOX_GCC_std = -std=c++11'
114 LOCAL_CONFIG
+='\nVBOX_WITH_TESTSUITE='
115 LOCAL_CONFIG
+='\nVBOX_WITH_TESTCASES='
116 LOCAL_CONFIG
+='\nVBOX_WITH_DRAG_AND_DROP_GH = 1'
117 LOCAL_CONFIG
+='\nVBOX_WITH_X11_ADDITIONS = 1'
119 # needs also patch 27
120 LOCAL_CONFIG
+='\nVBOX_WITH_VIDEOHWACCEL = 1'
122 # Disable DTrace, needs patching
123 LOCAL_CONFIG
+='\nVBOX_WITH_DTRACE_R3 ='
124 LOCAL_CONFIG
+='\nVBOX_WITH_DTRACE_R3_MAIN ='
125 LOCAL_CONFIG
+='\nVBOX_WITH_DTRACE_R0DRV ='
126 LOCAL_CONFIG
+='\nVBOX_WITH_DTRACE_RC ='
127 LOCAL_CONFIG
+='\nVBOX_WITH_NATIVE_DTRACE ='
129 # Do not allow compiler override in kmk files
130 LOCAL_CONFIG
+= '\nTOOL_GXX3PLAIN_CC = $(CC)'
131 LOCAL_CONFIG
+= '\nTOOL_GXX3PLAIN_CXX = $(CXX)'
132 LOCAL_CONFIG
+= '\nTOOL_GXX3PLAIN_AS = $(CC)'
133 LOCAL_CONFIG
+= '\nTOOL_GXX3PLAIN_LD = $(CXX)'
134 LOCAL_CONFIG
+= '\nTOOL_GCC3PLAIN_CC = $(CC)'
135 LOCAL_CONFIG
+= '\nTOOL_GCC3PLAIN_CXX = $(CXX)'
136 LOCAL_CONFIG
+= '\nTOOL_GCC3PLAIN_AS = $(CC)'
137 LOCAL_CONFIG
+= '\nTOOL_GCC3PLAIN_LD = $(CXX)'
139 # Set OpenIndiana project as publisher of VirtualBox binaries
140 VBOX_BUILD_PUBLISHER
=OpenIndiana
142 COMPONENT_PRE_CONFIGURE_ACTION
= \
143 ( cd
$(@D
); echo
$(LOCAL_CONFIG
) > LocalConfig.kmk
; $(CP
) -a
$(SOURCE_DIR
)/* $(@D
) )
145 # Note: VirtualBox does not use a fully featured autoconf-style script,
146 # so we must define the full set of command line options here, not using
147 # values set via our configure.mk.
148 CONFIGURE_OPTIONS
= --with-gcc
="$(CC)"
149 CONFIGURE_OPTIONS
+= --with-g
++="$(CXX)"
151 CONFIGURE_OPTIONS
+= --disable-alsa
152 CONFIGURE_OPTIONS
+= --disable-dbus
153 CONFIGURE_OPTIONS
+= --disable-docs
154 # we enable pulse support in LocalConfig.kmk by setting the define, because
155 # --enable-pulse doesn't currently do what we need
156 # See: https://www.virtualbox.org/ticket/18544 for more info
157 #CONFIGURE_OPTIONS+= --enable-pulse
158 CONFIGURE_OPTIONS
+= --disable-python
159 CONFIGURE_OPTIONS
+= --disable-java
160 CONFIGURE_OPTIONS
+= --disable-sdl-ttf
161 CONFIGURE_OPTIONS
+= --disable-libvpx
162 # CONFIGURE_OPTIONS+= --nofatal
163 CONFIGURE_OPTIONS
+= --enable-webservice
164 CONFIGURE_OPTIONS
+= --enable-vnc
165 # VirtualBox does not use pkg-config so we need to provide little help
166 CONFIGURE_OPTIONS
+= --with-openssl-dir
=$(OPENSSL_PREFIX
)
167 CONFIGURE_OPTIONS.debug
+= --build-debug
169 CONFIGURE_OPTIONS
+= --enable-qt6
171 CONFIGURE_OPTIONS
+= $(CONFIGURE_OPTIONS.
$(BITS
))
172 CONFIGURE_OPTIONS
+= $(CONFIGURE_OPTIONS.
$(FLAVOUR
))
174 VBOX_PREFIX
= /opt
/VirtualBox
176 # As IPS is "no scripting land", user has to install the VNC extension Pack manually:
177 # https://www.virtualbox.org/manual/UserManual.html#otherextpacks.
178 COMPONENT_POST_INSTALL_ACTION
= \
179 build
/amd64
/kBuild
/bin
/solaris.amd64
/kmk
-C
$(@D
)/src
/VBox
/ExtPacks
/VNC packing
; \
180 pushd
$(@D
)/out
/solaris.amd64
/$(FLAVOUR
)/packages
/; \
181 mkdir
-p
$(PROTO_DIR
)$(VBOX_PREFIX
)/ExtensionPacks
/; \
182 install -m
644 VNC-
*.vbox-extpack
$(PROTO_DIR
)$(VBOX_PREFIX
)/ExtensionPacks
/VNC-
$(COMPONENT_VERSION
).vbox-extpack
; \
184 echo
"$(COMPONENT_VERSION)" > $(PROTO_DIR
)$(VBOX_PREFIX
)/VERSION
186 $(INSTALL_ADDITIONS
): $(INSTALL_64
)
187 $(MKDIR
) $(PROTO_DIR
)/usr
/bin
188 $(MKDIR
) $(PROTO_DIR
)/usr
/sbin
189 $(MKDIR
) $(PROTO_DIR
)/usr
/kernel
/drv
/$(MACH64
)
190 for fl in
$(VBOX_MODULES
); do \
191 cp
$(VBOX_BINDIR
)/$$fl $(PROTO_DIR
)/usr
/kernel
/drv
/$(MACH64
); \
192 cp
$(VBOX_BINDIR
)/$$fl.conf
$(PROTO_DIR
)/usr
/kernel
/drv || true
; \
194 $(MKDIR
) $(PROTO_DIR
)/usr
/kernel
/fs
/$(MACH64
)
195 for fl in
$(VBOX_FS_MODULES
); do \
196 cp
$(VBOX_BINDIR
)/$$fl $(PROTO_DIR
)/usr
/kernel
/fs
/$(MACH64
); \
198 for fl in
$(VBOX_BINS
); do \
199 cp
$(VBOX_BINDIR
)/$$fl $(PROTO_DIR
)/usr
/bin
; \
201 for fl in
$(VBOX_SBINS
); do \
202 cp
$(VBOX_BINDIR
)/$$fl $(PROTO_DIR
)/usr
/sbin
; \
204 cp
$(VBOX_BINDIR
)/1099.vboxclient
$(PROTO_DIR
)/usr
/bin
/VBoxClient-all
205 $(MKDIR
) $(PROTO_DIR
)/usr
/lib
/$(MACH64
)
206 $(MKDIR
) $(PROTO_DIR
)/var
/svc
/manifest
/application
/virtualbox
207 cp
$(VBOX_BINDIR
)/vboxservice.xml
$(PROTO_DIR
)/var
/svc
/manifest
/application
/virtualbox
208 cp
$(VBOX_BINDIR
)/vboxmslnk.xml
$(PROTO_DIR
)/var
/svc
/manifest
/application
/virtualbox
209 $(MKDIR
) $(PROTO_DIR
)/etc
/fs
/vboxfs
210 cp
$(VBOX_BINDIR
)/vboxfsmount
$(PROTO_DIR
)/etc
/fs
/vboxfs
/mount
211 $(MKDIR
) $(PROTO_DIR
)/etc
/xdg
/autostart
212 cp
$(VBOX_BINDIR
)/vboxclient.desktop
$(PROTO_DIR
)/etc
/xdg
/autostart
213 $(MKDIR
) $(PROTO_DIR
)/$(X11_SERVERDRV_DIR
)
214 cp
$(VBOX_BINDIR
)/vboxvideo_drv_system.so
$(PROTO_DIR
)/$(X11_SERVERDRV_DIR
)/vboxvideo_drv.so
215 $(MKDIR
) $(PROTO_DIR
)/lib
/opengl
/ogl_select
216 cp
$(VBOX_BINDIR
)/vbox_vendor_select
$(PROTO_DIR
)/lib
/opengl
/ogl_select
219 $(BUILD_64
): GMAKE
= cd
$(@D
)/src
/VBox
/HostDrivers
&& $(SHELL
) -c
". $(@D)/env.sh && kmk KBUILD_VERBOSE=3"
221 $(INSTALL_64
): GMAKE
= cd
$(@D
)/src
/VBox
/Installer
&& $(SHELL
) -c
". $(@D)/env.sh && kmk solaris-install VBOX_PATH_SI_SCRATCH_PKG=$(PROTO_DIR)"
223 install: $(INSTALL_64
) $(INSTALL_ADDITIONS
)
227 REQUIRED_PACKAGES
+= driver
/usb
228 REQUIRED_PACKAGES
+= system
/header
/header-agp
229 REQUIRED_PACKAGES
+= system
/header
/header-audio
230 REQUIRED_PACKAGES
+= system
/header
/header-usb
231 REQUIRED_PACKAGES
+= x11
/library
/libxinerama
232 REQUIRED_PACKAGES
+= library
/libvncserver
233 REQUIRED_PACKAGES
+= developer
/build
/onbld
234 REQUIRED_PACKAGES
+= developer
/object-file
236 # Auto-generated dependencies
237 REQUIRED_PACKAGES
+= $(GCC_RUNTIME_PKG
)
238 REQUIRED_PACKAGES
+= $(GXX_RUNTIME_PKG
)
239 REQUIRED_PACKAGES
+= $(OPENSSL_PKG
)
240 REQUIRED_PACKAGES
+= SUNWcs
241 REQUIRED_PACKAGES
+= compress
/xz
242 REQUIRED_PACKAGES
+= image
/library
/libpng16
243 REQUIRED_PACKAGES
+= library
/gsoap
244 REQUIRED_PACKAGES
+= library
/libvncserver
245 REQUIRED_PACKAGES
+= library
/libxml2
246 REQUIRED_PACKAGES
+= library
/qt6
247 REQUIRED_PACKAGES
+= shell/ksh93
248 REQUIRED_PACKAGES
+= system
/library
249 REQUIRED_PACKAGES
+= system
/library
/math
250 REQUIRED_PACKAGES
+= web
/curl
251 REQUIRED_PACKAGES
+= x11
/library
/libx11
252 REQUIRED_PACKAGES
+= x11
/library
/libxcb
253 REQUIRED_PACKAGES
+= x11
/library
/toolkit
/libxt