VirtualBox

source: vbox/trunk/src/VBox/Installer/darwin/Makefile.kmk@ 59628

Last change on this file since 59628 was 59472, checked in by vboxsync, 9 years ago

FE/Qt: Qt5 migration (part 74): Preparing Qt5 tool: VBOX_QT4_MOD => VBOX_QT_MOD.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 41.3 KB
Line 
1# $Id: Makefile.kmk 59472 2016-01-26 11:54:57Z vboxsync $
2## @file
3# Install misc stuff and create dist packages for Mac OS X.
4#
5
6#
7# Copyright (C) 2006-2015 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21
22#
23# Globals
24#
25VBOX_PATH_DI_SRC := $(PATH_SUB_CURRENT)
26VBOX_DI_OUT_DIR := $(PATH_TARGET)/Installer/darwin
27BLDDIRS += $(VBOX_DI_OUT_DIR)
28
29VBOX_DI_FN_DEP_BOTH = $(VBOX_PATH_DIST)/$1
30ifeq ($(KBUILD_TARGET_ARCH),x86)
31 VBOX_DI_FN_DEP_32 = $(VBOX_PATH_DIST)/$1
32 VBOX_DI_FN_DEP_64 =
33else
34 VBOX_DI_FN_DEP_64 = $(VBOX_PATH_DIST)/$1
35 VBOX_DI_FN_DEP_32 =
36endif
37VBOX_PATH_DIST_OTHER = $(error VBOX_PATH_DIST_OTHER used in a non-combined package deal)
38
39# Unset this to speed up things during makefile hacking.
40VBOX_DARWIN_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
41
42# The location of the pkgbuild program.
43ifndef VBOX_PKGBUILD
44 VBOX_PKGBUILD := pkgbuild
45endif
46
47# The location of the productbuild program.
48ifndef VBOX_PRODUCTBUILD
49 VBOX_PRODUCTBUILD := productbuild
50endif
51
52# Where we do the packing (override this in LocalConfig.kmk if building on smbfs).
53ifndef VBOX_PATH_PACK_TMP
54 VBOX_PATH_PACK_TMP := $(VBOX_DI_OUT_DIR)
55endif
56
57# Shorthand for $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app
58VBOX_PATH_VBOX_APP_TMP := $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app
59
60
61#
62# Install the darwin docs/license.
63#
64INSTALLS += darwin-docs
65darwin-docs_INST = $(INST_DIST)
66darwin-docs_MODE = a+r,u+w
67darwin-docs_SOURCES = \
68 $(VBOX_BRAND_LICENSE_TXT)=>LICENSE
69
70
71#
72# The packing.
73#
74PACKING += $(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)-r$(VBOX_SVN_REV).dmg
75#OTHER_CLEAN = TODO
76
77
78include $(FILE_KBUILD_SUB_FOOTER)
79
80
81#
82# We're running commands as root here, take some care and assertion
83# a sane environment.
84#
85ifeq ($(strip $(VBOX_PATH_DIST)),)
86 $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST))
87endif
88ifeq ($(strip $(VBOX_PATH_DIST)),/)
89 $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST))
90endif
91ifeq ($(strip $(VBOX_PATH_PACK_TMP)),)
92 $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP))
93endif
94ifeq ($(strip $(VBOX_PATH_PACK_TMP)),/)
95 $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP))
96endif
97
98
99# Check for additional manuals
100VBOX_ADD_MANUALS := $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_$(f).pdf)
101
102VBOX_ADD_MANUAL_de_DE := $(filter $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_de_DE.pdf,$(VBOX_ADD_MANUALS))
103VBOX_ADD_MANUAL_fr_FR := $(filter $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_fr_FR.pdf,$(VBOX_ADD_MANUALS))
104
105#
106# The disk image.
107#
108$(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)-r$(VBOX_SVN_REV).dmg: \
109 $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg \
110 $(VBOX_BRAND_DARWIN_DISKIMAGE_BG) \
111 $(VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE) \
112 $$(wildcard $(VBOX_PATH_DI_SRC)/DiskImage/*) \
113 $(if $(VBOX_WITH_DOCS_PACKING), \
114 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf \
115 $(VBOX_ADD_MANUALS)) \
116 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
117 $(call MSG_TOOL,hdiutil,,,$@)
118 @# Cleanup any previously failed attempts and various trash.
119 sudo rm -Rf $(VBOX_PATH_PACK_TMP)/DiskImage.tmp
120 $(MKDIR) -p $(VBOX_PATH_PACK_TMP)/DiskImage.tmp/
121 sudo mv $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg $(VBOX_PATH_PACK_TMP)/DiskImage.tmp/
122 sudo rm -Rf \
123 $@ \
124 $(VBOX_PATH_PACK_TMP)/DiskImage/
125 sudo mv $(VBOX_PATH_PACK_TMP)/DiskImage.tmp $(VBOX_PATH_PACK_TMP)/DiskImage
126 @# Remove .dmg packages from old depend builds
127 $(QUIET)$(RM) -f $(wildcard $(VBOX_PATH_DIST)/VirtualBox-*-r*.dmg)
128 @# Populate the image with uninstaller, readme, picture, and .VolumeIcon.icns. (TODO)
129 $(INSTALL) $(VBOX_PATH_DI_SRC)/DiskImage/VirtualBox_Uninstall.tool $(VBOX_PATH_PACK_TMP)/DiskImage/
130if defined(VBOX_SIGNING_MODE) && defined(VBOX_NOT_OSX_105)
131 $(call VBOX_SIGN_FILE_FN,$(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox_Uninstall.tool,org.virtualbox.dmg.uninstaller)
132endif
133ifeq (1,1)
134 @# Pedantic mode...
135 $(INSTALL) -m 644 $(VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE) $(VBOX_PATH_PACK_TMP)/DiskImage/.DS_Store
136 $(MKDIR) $(VBOX_PATH_PACK_TMP)/DiskImage/.background
137 $(INSTALL) -m 644 $(VBOX_BRAND_DARWIN_DISKIMAGE_BG) $(VBOX_PATH_PACK_TMP)/DiskImage/.background/vbox_folder.tiff
138 ifdef VBOX_WITH_BUNDLED_INSTALLER
139 $(if $(VBOX_WITH_DOCS_PACKING), \
140 $(INSTALL) -m 644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf $(VBOX_PATH_PACK_TMP)/DiskImage/User\ Manual.pdf$(NLTAB) \
141 $(if $(VBOX_ADD_MANUAL_de_DE),$(INSTALL) -m 644 $(VBOX_ADD_MANUAL_de_DE) "$(VBOX_PATH_PACK_TMP)/DiskImage/$(VBOX_BRAND_de_DE_MANUAL_NAME).pdf"$(NLTAB)) \
142 $(if $(VBOX_ADD_MANUAL_fr_FR),$(INSTALL) -m 644 $(VBOX_ADD_MANUAL_fr_FR) "$(VBOX_PATH_PACK_TMP)/DiskImage/$(VBOX_BRAND_fr_FR_MANUAL_NAME).pdf"$(NLTAB)))
143 # Rename the main package
144 else
145 $(if $(VBOX_WITH_DOCS_PACKING), $(INSTALL) $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf $(VBOX_PATH_PACK_TMP)/DiskImage/)
146 $(LN) -s /Applications/ $(VBOX_PATH_PACK_TMP)/DiskImage/Applications
147 endif
148endif
149 @# hdiutil of OS X 10.10 adds a .Trashes directory and some suggest this may upset the image size calculations (-5341).
150 $(MKDIR) -m 1333 $(VBOX_PATH_PACK_TMP)/DiskImage/.Trashes
151 @# Change the owners.
152 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/DiskImage
153 @# Create the image. We calculate the size our selves, adding 8MB for fudging (it's about 100-120MB atm).
154 sudo hdiutil create -format UDBZ -volname "VirtualBox" -srcfolder "$(VBOX_PATH_PACK_TMP)/DiskImage" \
155 -size $(DOLLAR)((`/usr/bin/du -d 0 -k "$(VBOX_PATH_PACK_TMP)/DiskImage/" | /usr/bin/cut -f1` + 8192))k \
156 "$@"
157 @# Change (back) the owner so it can be deleted by the user.
158 sudo chown "$(shell whoami)" "$@"
159 sudo chown -R "$(shell whoami)" $(VBOX_PATH_PACK_TMP)/DiskImage
160
161#
162# The meta-package.
163#
164$(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg: \
165 $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg \
166 $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg \
167 $(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg \
168 $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/* \
169 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/*.lproj/*) \
170 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)) \
171 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
172 $(call MSG_TOOL,productbuild,,,$@)
173 @# Cleanup any previously failed attempts.
174 sudo rm -Rf \
175 $@ \
176 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.root \
177 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
178 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res
179 @# Correct directory permissions are important.
180 $(MKDIR) -p \
181 $(@D) \
182 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
183 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res \
184 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj
185 @# Do keyword replacement in the package info and description files.
186 $(SED) \
187 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
188 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
189 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
190 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
191 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
192 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
193 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
194 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Welcome.rtf \
195 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Welcome.rtf
196 @# Copy the resources.
197 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Conclusion.rtf $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Conclusion.rtf
198 $(SED) \
199 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
200 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
201 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
202 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Localizable.strings \
203 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Localizable.strings
204 $(INSTALL) -m 0644 $(VBOX_BRAND_DARWIN_INSTALLER_BG) $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/background.tif
205 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
206 $(MKDIR) -p \
207 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
208 $(SED) \
209 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
210 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
211 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
212 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
213 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Welcome.rtf \
214 $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)$(NLTAB) \
215 $(INSTALL) -m 0644 $(VBOX_BRAND_$(f)_VIRTUALBOX_CONCLUSION_RTF) $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Conclusion.rtf$(NLTAB) \
216 $(SED) \
217 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
218 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
219 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
220 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings \
221 $(VBOX_BRAND_$(f)_VIRTUALBOX_LOCALIZABLE_STRINGS)$(NLTAB) \
222 )
223 @# Build the package.
224 $(VBOX_PRODUCTBUILD) \
225 --distribution $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/distribution.dist \
226 --package-path $(VBOX_PATH_PACK_TMP)/Packages \
227 --resources $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res \
228 --identifier org.VirtualBox.mpkg.virtualbox \
229 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
230 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
231 $@
232 @# Cleanup.
233 sudo rm -Rf \
234 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.root \
235 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
236 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res
237
238
239#
240# The VirtualBox Kernel extensions.
241#
242VBOX_DI_KEXTS_UNIVERSAL = VBoxDrv VBoxNetFlt VBoxNetAdp VBoxUSB
243VBOX_DI_KEXTS = $(VBOX_DI_KEXTS_UNIVERSAL)
244
245$(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg: \
246 $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), $(call VBOX_DI_FN_DEP_BOTH,$(kext).kext/Contents/MacOS/$(kext))) \
247 $(foreach kext,$(VBOX_DI_KEXTS), $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist) \
248 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxKEXTs/* \
249 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/*.lproj/*) \
250 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
251 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST) \
252 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML) \
253 $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS)) \
254 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
255 $(call MSG_TOOL,pkgbuild,,,$@)
256 @# Cleanup any previously failed attempts.
257 sudo rm -Rf \
258 $@ \
259 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
260 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
261 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
262 @# Correct directory permissions are important.
263 $(MKDIR) -p \
264 $(@D) \
265 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
266 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
267 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj
268 $(MKDIR) -p -m 0755 \
269 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
270 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons \
271 $(foreach kext,$(VBOX_DI_KEXTS), \
272 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext \
273 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents \
274 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS )
275 @# Copy the launch daemon bits.
276 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/VirtualBoxStartup.sh $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons/
277 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/org.virtualbox.startup.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons/
278 @# Copy the common files (Info.plist).
279 $(foreach kext,$(VBOX_DI_KEXTS), \
280 $(NLTAB)$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/)
281 @# Copy the binaries and invoking lipo.
282 $(foreach kext,$(VBOX_DI_KEXTS), \
283 $(NLTAB)$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/$(kext).kext/Contents/MacOS/$(kext) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS/)
284 @# Signed the kext bundles.
285ifdef VBOX_SIGNING_MODE
286 $(foreach kext,$(VBOX_DI_KEXTS) \
287 ,$(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS/$(kext),org.virtualbox.app.kext.$(kext)) )
288 $(foreach kext,$(VBOX_DI_KEXTS), \
289 $(NLTAB)$(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext,org.virtualbox.app.kext.$(kext)) )
290## @TODO check why this fails on the build box: $(foreach kext,$(VBOX_DI_KEXTS), $(NLTAB)codesign --verify --verbose=1 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext )
291endif
292 @# Set the correct owners.
293 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/
294 @# Do keyword replacement in the package info and description files.
295 $(SED) \
296 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
297 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
298 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
299 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
300 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
301 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
302 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
303 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/PkgBuildComponent.plist \
304 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/PkgBuildComponent.plist
305 @# Copy the resources.
306 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/postflight $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/
307 @# Build the package.
308 $(VBOX_PKGBUILD) \
309 --root $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/ \
310 --component-plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/PkgBuildComponent.plist \
311 --script $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
312 --identifier org.virtualbox.pkg.vboxkexts \
313 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
314 --install-location "/Library/Application Support/VirtualBox" \
315 --ownership preserve \
316 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
317 $@
318 @# Cleanup
319 sudo chown -R "$(shell whoami)" \
320 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root
321 sudo rm -Rf \
322 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
323 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
324 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
325
326
327#
328# Figure out which languages that we support and construct
329# .qm and .lproj lists for these.
330#
331include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
332VBOX_INSTALL_LANG_FILES := $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES), VirtualBox_$(f).qm qt_$(f).qm)
333VBOX_INSTALL_LANG_LPROJ := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES))
334
335
336#
337# The VirtualBox Application.
338#
339
340VBOX_DI_VBAPP_DYLIBS = \
341 $(foreach qtmod, $(VBOX_QT_MOD_NAMES), Frameworks/$(qtmod).framework/Versions/4/$(qtmod)) \
342 MacOS/VBoxDD.dylib \
343 MacOS/VBoxDD2.dylib \
344 MacOS/VBoxDDU.dylib \
345 MacOS/VBoxREM.dylib \
346 MacOS/VBoxRT.dylib \
347 $(if $(VBOX_WITH_SHARED_FOLDERS),MacOS/VBoxSharedFolders.dylib,) \
348 $(if $(VBOX_WITH_SHARED_CLIPBOARD),MacOS/VBoxSharedClipboard.dylib,) \
349 $(if $(VBOX_WITH_DRAG_AND_DROP),MacOS/VBoxDragAndDropSvc.dylib,) \
350 $(if $(VBOX_WITH_GUEST_PROPS),MacOS/VBoxGuestPropSvc.dylib,) \
351 MacOS/VBoxHostChannel.dylib \
352 MacOS/VBoxVMM.dylib \
353 MacOS/VBoxXPCOM.dylib \
354 MacOS/VBoxXPCOMC.dylib \
355 MacOS/components/VBoxC.dylib \
356 MacOS/components/VBoxSVCM.dylib \
357 MacOS/components/VBoxXPCOMIPCC.dylib \
358 MacOS/VBoxAuth.dylib \
359 MacOS/VBoxAuthSimple.dylib \
360 $(if $(VBOX_WITH_GUEST_CONTROL),MacOS/VBoxGuestControlSvc.dylib,)
361ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/libqtaccessiblewidgets.dylib),)
362 VBOX_DI_VBAPP_DYLIBS += \
363 MacOS/accessible/libqtaccessiblewidgets.dylib
364endif
365if defined(VBOX_WITH_VRDP) && !defined(VBOX_WITH_EXTPACK_PUEL)
366 VBOX_DI_VBAPP_DYLIBS += \
367 MacOS/VBoxVRDP.dylib
368endif
369ifdef VBOX_WITH_CROGL
370 VBOX_DI_VBAPP_DYLIBS += \
371 MacOS/VBoxOGLhostcrutil.dylib \
372 MacOS/VBoxOGLhosterrorspu.dylib \
373 MacOS/VBoxOGLrenderspu.dylib \
374 MacOS/VBoxSharedCrOpenGL.dylib
375
376 ifdef VBOX_WITH_CR_DISPLAY_LISTS
377 VBOX_DI_VBAPP_DYLIBS += \
378 MacOS/VBoxOGLexpandospu.dylib
379 endif
380endif
381ifdef VBOX_WITH_DEBUGGER_GUI
382 VBOX_DI_VBAPP_DYLIBS += \
383 MacOS/VBoxDbg.dylib \
384 MacOS/DbgPlugInDiggers.dylib
385endif
386ifdef VBOX_WITH_HARDENING
387 VBOX_DI_VBAPP_DYLIBS += \
388 MacOS/VirtualBox.dylib \
389 MacOS/VBoxNetDHCP.dylib \
390 MacOS/VBoxNetNAT.dylib \
391 MacOS/VBoxHeadless.dylib
392endif
393ifdef VBOX_WITH_HDDPARALLELS_INSTALL
394 VBOX_DI_VBAPP_DYLIBS += \
395 MacOS/VBoxHDDParallels.dylib
396endif
397if defined(VBOX_WITH_PYTHON) && !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6)
398 VBOX_DI_VBAPP_DYLIBS += \
399 MacOS/VBoxPython2_6.so
400endif
401if defined(VBOX_WITH_PYTHON) && !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7)
402 VBOX_DI_VBAPP_DYLIBS += \
403 MacOS/VBoxPython2_7.so
404endif
405ifdef VBOX_WITH_VMSVGA3D
406 VBOX_DI_VBAPP_DYLIBS += \
407 MacOS/VBoxSVGA3D.dylib \
408 MacOS/VBoxSVGA3DObjC.dylib
409endif
410
411VBOX_DI_VBAPP_DYLIBS.x86 := \
412 MacOS/VBoxREM32.dylib \
413 MacOS/VBoxREM64.dylib
414ifdef VBOX_WITH_PYTHON
415 VBOX_DI_VBAPP_DYLIBS.x86 += \
416 MacOS/VBoxPython2_5.so \
417 $(if-expr defined(VBOX_WITH_MAC_OS_X_10_4_SUPPORT),MacOS/VBoxPython2_3.so,)
418endif
419
420VBOX_DI_VBAPP_DYLIBS.amd64 :=
421if defined(VBOX_WITH_PYTHON) && defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6)
422 VBOX_DI_VBAPP_DYLIBS.amd64 += \
423 MacOS/VBoxPython2_6.so
424endif
425
426if defined(VBOX_WITH_JXPCOM)
427 VBOX_DI_VBAPP_DYLIBS += \
428 MacOS/libvboxjxpcom.jnilib
429endif
430
431if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64), $(VBOX_DI_VBAPP_DYLIBS.x86))
432 $(error Conflict.$(NLTAB)VBOX_DI_VBAPP_DYLIBS.amd64=$(VBOX_DI_VBAPP_DYLIBS.amd64)$(NLTAB)VBOX_DI_VBAPP_DYLIBS.x86 =$(VBOX_DI_VBAPP_DYLIBS.x86))
433endif
434if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_DYLIBS.x86),$(VBOX_DI_VBAPP_DYLIBS))
435 $(error Conflict.$(NLTAB)VBOX_DI_VBAPP_DYLIBS.amd64=$(VBOX_DI_VBAPP_DYLIBS.amd64)$(NLTAB)VBOX_DI_VBAPP_DYLIBS.x86 =$(VBOX_DI_VBAPP_DYLIBS.x86)$(NLTAB)VBOX_DI_VBAPP_DYLIBS=$(VBOX_DI_VBAPP_DYLIBS))
436endif
437
438VBOX_DI_VBAPP_PROGS = \
439 MacOS/VBoxManage \
440 MacOS/VBoxSVC \
441 MacOS/VBoxHeadless \
442 MacOS/VBoxXPCOMIPCD \
443 MacOS/VBoxNetAdpCtl \
444 MacOS/VBoxNetDHCP \
445 MacOS/VBoxNetNAT \
446 MacOS/VBoxExtPackHelperApp \
447 MacOS/VBoxBalloonCtrl \
448 MacOS/VBoxAutostart \
449 MacOS/VirtualBoxVM \
450 $(if $(VBOX_WITH_WEBSERVICES),MacOS/vboxwebsrv) \
451 MacOS/VirtualBox \
452 $(if $(VBOX_WITH_DTRACE),MacOS/VBoxDTrace,)
453
454VBOX_DI_VBAPP_UNIVERSAL_PROGS = \
455 MacOS/vmstarter \
456 $(if $(VBOX_WITH_VBOX_IMG)$(VBOX_WITH_TESTCASES),MacOS/vbox-img,)
457
458VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS = \
459 MacOS/VMMR0.r0 \
460 MacOS/VBoxDDR0.r0 \
461 MacOS/VBoxDD2R0.r0
462
463ifdef VBOX_WITH_RAW_MODE
464 VBOX_DI_VBAPP_OTHER_BINS = \
465 MacOS/VMMRC.rc \
466 MacOS/VBoxDDRC.rc \
467 MacOS/VBoxDD2RC.rc
468else
469 VBOX_DI_VBAPP_OTHER_BINS =
470endif
471
472VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES = \
473 Resources/virtualbox.icns \
474 Resources/virtualbox.png \
475 Resources/virtualbox-vbox.icns \
476 Resources/virtualbox-vbox-extpack.icns \
477 Resources/virtualbox-ovf.icns \
478 Resources/virtualbox-ova.icns \
479 Resources/virtualbox-vdi.icns \
480 Resources/virtualbox-vmdk.icns \
481 Resources/virtualbox-vhd.icns \
482 Resources/virtualbox-hdd.icns
483
484VBOX_DI_VBAPP_MISC_FILES = \
485 Info.plist \
486 PkgInfo \
487 $(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES) \
488 MacOS/components/VBoxXPCOMBase.xpt \
489 MacOS/components/VirtualBox_XPCOM.xpt \
490 Resources/VirtualBoxVM.app/Contents/Info.plist \
491 Resources/VirtualBoxVM.app/Contents/PkgInfo \
492 $(addprefix Resources/VirtualBoxVM.app/Contents/,$(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES)) \
493 Resources/vmstarter.app/Contents/Info.plist \
494 Resources/vmstarter.app/Contents/PkgInfo \
495 $(addprefix Resources/vmstarter.app/Contents/,$(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES))
496ifdef VBOX_WITH_DOCS_PACKING
497VBOX_DI_VBAPP_MISC_FILES += \
498 MacOS/UserManual.pdf
499endif
500ifdef VBOX_WITH_ADDITIONS_PACKING
501 ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso),)
502 VBOX_DI_VBAPP_MISC_FILES += \
503 MacOS/VBoxGuestAdditions.iso
504 endif
505endif
506ifdef VBOX_WITH_EFIFW_PACKING
507VBOX_DI_VBAPP_MISC_FILES += \
508 MacOS/VBoxEFI32.fd \
509 MacOS/VBoxEFI64.fd
510endif
511VBOX_DI_VBAPP_MISC_FILES += \
512 Frameworks/QtGui$(VBOX_QT_INFIX).framework/Versions/4/Resources/qt_menu.nib/classes.nib \
513 Frameworks/QtGui$(VBOX_QT_INFIX).framework/Versions/4/Resources/qt_menu.nib/info.nib \
514 Frameworks/QtGui$(VBOX_QT_INFIX).framework/Versions/4/Resources/qt_menu.nib/keyedobjects.nib \
515 $(foreach qtmod, $(VBOX_QT_MOD_NAMES), Frameworks/$(qtmod).framework/Versions/4/Resources/Info.plist)
516
517VBOX_DI_VBAPP_SYMLINKS = \
518 Resources/VirtualBoxVM.app/Contents/MacOS=>../../../MacOS/ \
519 Resources/vmstarter.app/Contents/MacOS=>../../../MacOS/ \
520 $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \
521 ,Frameworks/$(qtmod).framework/Versions/Current=>4 )
522ifndef VBOX_NOT_OSX_105
523VBOX_DI_VBAPP_SYMLINKS += $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \
524 ,Frameworks/$(qtmod).framework/$(qtmod)=>Versions/4/$(qtmod) \
525 Frameworks/$(qtmod).framework/Resources=>Versions/4/Resources/ )
526endif
527
528ifdef VBOX_WITH_PYTHON
529 # Python XPCOM glue
530 VBOX_DI_VBAPP_PYTHON_FILES = \
531 $(VBOXINST_SDK_BINDINGS_XPCOM_PYTHON_FILES) \
532 $(VBOXINST_SDK_INSTALLER_PYTHON_FILES)
533endif
534
535
536# (The dependencies are including way too much here because I'm lazy.)
537$(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg: \
538 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
539 $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST)) \
540 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) $(VBOX_DI_VBAPP_OTHER_BINS) $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_MISC_FILES)\
541 ,$(call VBOX_DI_FN_DEP_BOTH,VirtualBox.app/Contents/$(f)) ) \
542 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86)\
543 ,$(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/$(f)) ) \
544 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64)\
545 ,$(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/$(f)) ) \
546 \
547 $(if $(VBOX_WITH_DOCS_PACKING),$(VBOX_ADD_MANUALS),) \
548 $(VBOX_BRAND_LICENSE_TXT) \
549 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*) \
550 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*.lproj/*) \
551 $$(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/,$(VBOX_INSTALL_LANG_FILES)) \
552 \
553 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/*) \
554 $(filter-out Disabled, $(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/*)) \
555 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*) \
556 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/*) \
557 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*) \
558 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*.lproj/*) \
559 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/*) \
560 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*) \
561 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*.lproj/*) \
562 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*.lproj/*) \
563 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/*) \
564 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/additions/*) \
565 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/components/*) \
566 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/*) \
567 $(if-expr defined(VBOX_WITH_PYTHON), $(addprefix $(VBOX_PATH_DIST)/, $(VBOX_DI_VBAPP_PYTHON_FILES)),) \
568 $(if-expr defined(VBOX_WITH_JXPCOM), $(addprefix $(VBOX_PATH_DIST)/, sdk/bindings/xpcom/java/vboxjxpcom.jar),) \
569 $(if $(VBOX_WITH_WEBSERVICES),$(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist,) \
570 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxballoonctrl.plist \
571 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxautostart.plist \
572 $(VBOX_PATH_DI_SRC)/VirtualBox/VBoxAutostartDarwin.sh \
573 $(if-expr defined(VBOX_WITH_DTRACE), \
574 $(foreach f, $(VBOXINST_DTRACE_LIB_ARCH_FILES), \
575 $(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/MacOS/dtrace/lib/x86/$f) \
576 $(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/MacOS/dtrace/lib/amd64/$f)) \
577 $(foreach f, $(VBOXINST_DTRACE_TESTCASE_ARCH_FILES), \
578 $(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/MacOS/dtrace/testcase/x86/$f) \
579 $(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/MacOS/dtrace/testcase/amd64/$f)) \
580 $(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES)) \
581 ,) \
582 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
583 $(call MSG_TOOL,pkgbuild,,,$@)
584 @# Cleanup any previously failed attempts.
585 sudo rm -Rf \
586 $@ \
587 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
588 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
589 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
590 @# Correct directory permissions are important.
591 $(MKDIR) -p \
592 $(@D) \
593 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
594 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
595 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/English.lproj
596 $(MKDIR) -p -m 0775 \
597 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications
598 $(MKDIR) -p -m 0755 $(sort \
599 $(VBOX_PATH_VBOX_APP_TMP)/Contents \
600 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS \
601 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/components \
602 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/nls \
603 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/accessible \
604 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources \
605 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app \
606 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app/Contents \
607 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/vmstarter.app \
608 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/vmstarter.app/Contents \
609 $(if-expr defined(VBOX_WITH_PYTHON), \
610 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk \
611 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/installer \
612 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/installer/vboxapi \
613 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/ \
614 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom \
615 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python \
616 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python/xpcom \
617 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/client \
618 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/server,) \
619 $(if-expr defined(VBOX_WITH_JXPCOM), \
620 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/java,) \
621 $(addprefix $(VBOX_PATH_VBOX_APP_TMP)/Contents/,$(dir \
622 $(VBOX_DI_VBAPP_DYLIBS) \
623 $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \
624 $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
625 $(VBOX_DI_VBAPP_OTHER_BINS) \
626 $(VBOX_DI_VBAPP_PROGS) \
627 $(VBOX_DI_VBAPP_MISC_FILES) \
628 $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
629 $(VBOX_DI_VBAPP_MISC_FILES.$(KBUILD_TARGET_ARCH)) \
630 ))\
631 )
632# Create the .lproj language directories
633 $(MKDIR) -p -m 0755 \
634 $(addprefix $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/,$(VBOX_INSTALL_LANG_LPROJ))
635# Install all supported language files
636 $(foreach f, $(VBOX_INSTALL_LANG_FILES) \
637 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/$(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/nls/$(f)$(NLTAB))
638ifdef VBOX_WITH_WEBSERVICES
639 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
640endif
641 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxballoonctrl.plist $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
642 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxautostart.plist $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
643 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/VBoxAutostartDarwin.sh $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
644# Install the python bridge stuff
645ifdef VBOX_WITH_PYTHON
646 $(foreach f,$(VBOX_DI_VBAPP_PYTHON_FILES) \
647 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/$(f)$(NLTAB) )
648 $(INSTALL) -m 0755 $(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS
649endif
650# Install the java bridge stuff
651ifdef VBOX_WITH_JXPCOM
652 $(INSTALL) -m 0755 $(VBOX_PATH_DIST)/sdk/bindings/xpcom/java/vboxjxpcom.jar $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/java/vboxjxpcom.jar
653endif
654# Copy misc files.
655 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES) \
656 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(f)$(NLTAB) )
657 $(INSTALL) -m 644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/LICENSE
658ifdef VBOX_WITH_DOCS_PACKING
659 $(foreach f,$(VBOX_ADD_MANUALS) \
660 ,$(INSTALL) -m 0644 $(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/$(NLTAB))
661endif
662 @# Create symlinks.
663 $(foreach symlink,$(VBOX_DI_VBAPP_SYMLINKS) $(VBOX_DI_VBAPP_SYMLINKS.$(KBUILD_TARGET_ARCH)) \
664 ,$(LN) -s $(word 2,$(subst =>, ,$(symlink))) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(word 1,$(subst =>, ,$(symlink)))$(NLTAB))
665 @# Copy the dylibs.
666 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
667 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(dylib)$(NLTAB))
668 @# Copy the other binaries.
669 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS) \
670 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(otherbin)$(NLTAB))
671 @# Create/copy the universal executable binaries.
672 $(foreach otherbin, $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
673 ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(otherbin)$(NLTAB))
674 @# Copy the binaries.
675 $(foreach prog, $(VBOX_DI_VBAPP_PROGS) \
676 ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(prog) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(prog)$(NLTAB))
677#ifdef VBOX_WITH_HARDENING - disabled temporarily
678if 1
679 @# We cannot use @executable_path together with setuid binaries, dyld gets upset about it. So, fix Qt libs and users.
680 $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \
681 ,install_name_tool -id /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
682 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod)$(NLTAB) )
683 $(foreach f, \
684 $(VBOX_DI_VBAPP_DYLIBS) \
685 $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
686 $(VBOX_DI_VBAPP_PROGS) \
687 ,install_name_tool \
688 $(foreach qtmod, $(VBOX_QT_MOD_NAMES), \
689 -change @executable_path/../Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
690 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
691 -change $(VBOX_PATH_QT)/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
692 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
693 -change $(PATH_SDK_QT4)/$(qtmod).framework/Versions/4/$(qtmod) \
694 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
695 -change $(qtmod).framework/Versions/4/$(qtmod) \
696 /Applications/VirtualBox.app/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod) \
697 ) \
698 $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(f)$(NLTAB) )
699endif
700ifdef VBOX_WITH_DTRACE
701 @# DTrace library, testcases and scripts.
702 $(MKDIR) -p -m 0755 -- \
703 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/lib/$(KBUILD_TARGET_ARCH)/ \
704 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/testcase/$(KBUILD_TARGET_ARCH)/ \
705 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/scripts/
706 $(foreach file, $(addprefix lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
707 $(addprefix testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
708 $(addprefix scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES)) \
709 ,$(INSTALL) -m 0655 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/dtrace/$(file) \
710 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/$(file)$(NLTAB))
711endif
712
713 @# Signed the binaries and the application bundle.
714ifdef VBOX_SIGNING_MODE
715 $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \
716 ,$(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Frameworks/$(qtmod).framework/Versions/4/$(qtmod),org.virtualbox.app.frameworks.$(qtmod)) )
717 $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \
718 ,$(NLTAB)$(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Frameworks/$(qtmod).framework/Versions/4,org.virtualbox.app.frameworks.$(qtmod)) )
719 $(foreach dylib, \
720 $(VBOX_DI_VBAPP_DYLIBS) \
721 $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
722 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(dylib),org.virtualbox.app.macos.$(notdir $(dylib))) )
723 $(foreach bin, $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
724 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin))) )
725 ifdef VBOX_NOT_OSX_105 ## @todo Move as much stuff out of MacOS/ as possible!!
726 $(foreach other, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS)\
727 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(other),org.virtualbox.app.macos.$(notdir $(other))) )
728 $(foreach bin, $(filter-out MacOS/VirtualBox,$(VBOX_DI_VBAPP_PROGS)) \
729 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin))) )
730 $(foreach file, $(if-expr defined(VBOX_WITH_WEBSERVICES),MacOS/org.virtualbox.vboxwebsrv.plist,) \
731 MacOS/org.virtualbox.vboxballoonctrl.plist \
732 MacOS/org.virtualbox.vboxautostart.plist \
733 MacOS/VBoxAutostartDarwin.sh \
734 $(if-expr defined(VBOX_WITH_PYTHON),$(addprefix MacOS/, $(VBOX_DI_VBAPP_PYTHON_FILES) vboxshell.py),) \
735 $(if-expr defined(VBOX_WITH_JXPCOM),MacOS/sdk/bindings/xpcom/java/vboxjxpcom.jar,) \
736 $(filter MacOS/%,$(VBOX_DI_VBAPP_MISC_FILES)) \
737 $(if-expr defined(VBOX_WITH_DOCS_PACKING),$(addprefix MacOS/,$(VBOX_ADD_MANUALS)),) \
738 $(if-expr defined(VBOX_WITH_DTRACE),\
739 $(addprefix MacOS/dtrace/lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
740 $(addprefix MacOS/dtrace/testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
741 $(addprefix MacOS/dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES)) ,) \
742 $(addprefix MacOS/nls/,$(VBOX_INSTALL_LANG_FILES)) \
743 , $(NLTAB)$(call VBOX_SIGN_FILE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(file),org.virtualbox.app.$(tolower $(subst $(SP),,$(subst /,.,$(file))))) )
744
745 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app,,)
746 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/vmstarter.app,,)
747 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP),,--deep)
748 else
749 $(foreach other, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS) \
750 , $(NLTAB)$(call VBOX_SIGN_VMM_MOD_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(other),org.virtualbox.app.macos.$(notdir $(other))) )
751 $(foreach bin, $(VBOX_DI_VBAPP_PROGS) \
752 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin))) )
753 endif
754endif
755 @# Set the correct owner and set the set-user-ID-on-execution bit on the relevant executables.
756 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
757 sudo chmod u+s $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/VBoxNetAdpCtl
758ifdef VBOX_WITH_HARDENING
759 sudo chmod u+s \
760 $(foreach bin,VBoxHeadless VirtualBox VirtualBoxVM VBoxNetDHCP VBoxNetNAT,\
761 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/$(bin))
762endif
763 @# Do keyword replacement in the package info and description files.
764 $(SED) \
765 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
766 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
767 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
768 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
769 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
770 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
771 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
772 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/PkgBuildComponent.plist \
773 $(VBOX_PATH_DI_SRC)/VirtualBox/PkgBuildComponent.plist
774 @# Copy the resources.
775 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/preflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/
776ifdef VBOX_WITH_HARDENING
777 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/postflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/
778else
779 $(SED) -s '/WITH_HARDENING/d' -o $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/postflight $(VBOX_PATH_DI_SRC)/VirtualBox/postflight
780 $(CHMOD) 0755 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/postflight
781endif
782 @# Build the package.
783 $(VBOX_PKGBUILD) \
784 --root $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/ \
785 --component-plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/PkgBuildComponent.plist \
786 --script $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
787 --identifier org.virtualbox.pkg.virtualbox \
788 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
789 --install-location /Applications/ \
790 --ownership preserve \
791 $(if-expr defined(VBOX_NOT_OSX_105),--preserve-xattr,) \
792 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
793 $@
794 @# Cleanup
795 sudo chown -R "$(shell whoami)" \
796 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
797 sudo chmod -R a-s \
798 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
799 sudo rm -Rf \
800 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
801 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
802 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
803
804#
805# The VirtualBox CLI wrapper scripts.
806#
807$(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg: \
808 $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/* \
809 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/*.lproj/*) \
810 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
811 ,$(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST)) \
812 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
813 $(call MSG_TOOL,pkgbuild,,,$@)
814 @# Cleanup any previously failed attempts.
815 sudo rm -Rf \
816 $@ \
817 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
818 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
819 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
820 @# Correct directory permissions are important.
821 $(MKDIR) -p \
822 $(@D) \
823 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
824 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \
825 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/English.lproj
826 $(MKDIR) -p -m 0755 \
827 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr \
828 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin
829 @# Generate the wrapper scripts.
830 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VirtualBox \
831 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VirtualBox "$$@"'
832 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxManage \
833 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxManage "$$@"'
834 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxVRDP \
835 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
836 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxHeadless \
837 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
838ifdef VBOX_WITH_WEBSERVICES
839 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/vboxwebsrv \
840 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv "$$@"'
841endif
842if defined(VBOX_WITH_VBOX_IMG) || defined(VBOX_WITH_TESTCASES)
843 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/vbox-img \
844 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/vbox-img "$$@"'
845endif
846 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxBalloonCtrl \
847 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxBalloonCtrl "$$@"'
848 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxAutostart \
849 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart "$$@"'
850ifdef VBOX_WITH_DTRACE
851 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxDTrace \
852 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxDTrace "$$@"'
853endif
854 @# Set the correct owners and file permissions.
855 sudo chmod 0755 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/*
856 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root
857 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr
858 @# Build the package.
859 $(VBOX_PKGBUILD) \
860 --root $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin \
861 --identifier org.virtualbox.pkg.virtualboxcli \
862 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
863 --install-location /usr/local/bin \
864 --ownership preserve \
865 $(if $(VBOX_MACOSX_INSTALLER_SIGN),--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
866 $@
867 @# Cleanup
868 sudo chown -R "$(shell whoami)" \
869 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root
870 sudo rm -Rf \
871 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
872 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
873 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
874
875
876#
877# Aliases.
878#
879VBoxKEXTs.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg
880VirtualBoxCLI.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg
881VirtualBox.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg
882VirtualBox.mpkg: $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg
883VirtualBox.dmg: $(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)-r$(VBOX_SVN_REV).dmg
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette