VirtualBox

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

Last change on this file since 92326 was 89669, checked in by vboxsync, 4 years ago

Audio/ValKit: More guest/host installer tweaking for shipping VKAT (now as VBoxAudioTest, to not clutter up files / naming conventions). bugref:10008

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 48.3 KB
Line 
1# $Id: Makefile.kmk 89669 2021-06-14 08:57:18Z vboxsync $
2## @file
3# Install misc stuff and create dist packages for Mac OS X.
4#
5
6#
7# Copyright (C) 2006-2020 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
39VBOX_QT_VERSION_MAJOR = 5
40
41# Unset this to speed up things during makefile hacking.
42VBOX_DARWIN_INST_DEP_ON_MAKEFILE := $(MAKEFILE_CURRENT)
43
44# The location of the pkgbuild program.
45ifndef VBOX_PKGBUILD
46 VBOX_PKGBUILD := pkgbuild
47endif
48
49# The location of the productbuild program.
50ifndef VBOX_PRODUCTBUILD
51 VBOX_PRODUCTBUILD := productbuild
52endif
53
54# Where we do the packing (override this in LocalConfig.kmk if building on smbfs).
55ifndef VBOX_PATH_PACK_TMP
56 VBOX_PATH_PACK_TMP := $(VBOX_DI_OUT_DIR)
57endif
58
59# Shorthand for $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app
60VBOX_PATH_VBOX_APP_TMP := $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/VirtualBox.app
61
62
63#
64# Install the darwin docs/license.
65#
66INSTALLS += darwin-docs
67darwin-docs_INST = $(INST_DIST)
68darwin-docs_MODE = a+r,u+w
69darwin-docs_SOURCES = \
70 $(VBOX_BRAND_LICENSE_TXT)=>LICENSE
71
72
73#
74# The packing.
75#
76PACKING += $(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_STRING)-r$(VBOX_SVN_REV).dmg
77#OTHER_CLEAN = TODO
78
79
80include $(FILE_KBUILD_SUB_FOOTER)
81
82
83#
84# We're running commands as root here, take some care and assertion
85# a sane environment.
86#
87ifeq ($(strip $(VBOX_PATH_DIST)),)
88 $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST))
89endif
90ifeq ($(strip $(VBOX_PATH_DIST)),/)
91 $(error VBOX_PATH_DIST=$(VBOX_PATH_DIST))
92endif
93ifeq ($(strip $(VBOX_PATH_PACK_TMP)),)
94 $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP))
95endif
96ifeq ($(strip $(VBOX_PATH_PACK_TMP)),/)
97 $(error VBOX_PATH_PACK_TMP=$(VBOX_PATH_PACK_TMP))
98endif
99
100
101# Check for additional manuals
102VBOX_ADD_MANUALS := $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_$(f).pdf)
103
104VBOX_ADD_MANUAL_de_DE := $(filter $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_de_DE.pdf,$(VBOX_ADD_MANUALS))
105VBOX_ADD_MANUAL_fr_FR := $(filter $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual_fr_FR.pdf,$(VBOX_ADD_MANUALS))
106
107#
108# The disk image.
109#
110$(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_STRING)-r$(VBOX_SVN_REV).dmg: \
111 $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg \
112 $(VBOX_BRAND_DARWIN_DISKIMAGE_BG) \
113 $(VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE) \
114 $$(wildcard $(VBOX_PATH_DI_SRC)/DiskImage/*) \
115 $(if $(VBOX_WITH_DOCS_PACKING), \
116 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf \
117 $(VBOX_ADD_MANUALS)) \
118 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
119 $(call MSG_TOOL,hdiutil,,,$@)
120 @# Cleanup any previously failed attempts and various trash.
121 sudo rm -Rf $(VBOX_PATH_PACK_TMP)/DiskImage.tmp
122 $(MKDIR) -p $(VBOX_PATH_PACK_TMP)/DiskImage.tmp/
123 sudo mv $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg $(VBOX_PATH_PACK_TMP)/DiskImage.tmp/
124 sudo rm -Rf \
125 $@ \
126 $(VBOX_PATH_PACK_TMP)/DiskImage/
127 sudo mv $(VBOX_PATH_PACK_TMP)/DiskImage.tmp $(VBOX_PATH_PACK_TMP)/DiskImage
128 @# Remove .dmg packages from old depend builds
129 $(QUIET)$(RM) -f $(wildcard $(VBOX_PATH_DIST)/VirtualBox-*-r*.dmg)
130 @# Populate the image with uninstaller, readme, picture, and .VolumeIcon.icns. (TODO)
131 $(INSTALL) $(VBOX_PATH_DI_SRC)/DiskImage/VirtualBox_Uninstall.tool $(VBOX_PATH_PACK_TMP)/DiskImage/
132ifdef VBOX_SIGNING_MODE
133 $(call VBOX_SIGN_FILE_FN,$(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox_Uninstall.tool,org.virtualbox.dmg.uninstaller)
134endif
135ifeq (1,1)
136 @# Pedantic mode...
137 $(INSTALL) -m 644 $(VBOX_BRAND_DARWIN_DISKIMAGE_DS_STORE) $(VBOX_PATH_PACK_TMP)/DiskImage/.DS_Store
138 $(MKDIR) $(VBOX_PATH_PACK_TMP)/DiskImage/.background
139 $(INSTALL) -m 644 $(VBOX_BRAND_DARWIN_DISKIMAGE_BG) $(VBOX_PATH_PACK_TMP)/DiskImage/.background/vbox_folder.tiff
140 ifdef VBOX_WITH_BUNDLED_INSTALLER
141 $(if $(VBOX_WITH_DOCS_PACKING), \
142 $(INSTALL) -m 644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf $(VBOX_PATH_PACK_TMP)/DiskImage/User\ Manual.pdf$(NLTAB) \
143 $(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)) \
144 $(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)))
145 # Rename the main package
146 else
147 $(if $(VBOX_WITH_DOCS_PACKING), $(INSTALL) $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UserManual.pdf $(VBOX_PATH_PACK_TMP)/DiskImage/)
148 $(LN) -s /Applications/ $(VBOX_PATH_PACK_TMP)/DiskImage/Applications
149 endif
150endif
151 @# hdiutil of OS X 10.10 adds a .Trashes directory and some suggest this may upset the image size calculations (-5341).
152 $(MKDIR) -m 1333 $(VBOX_PATH_PACK_TMP)/DiskImage/.Trashes
153 @# Change the owners.
154 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/DiskImage
155 @# Create the image. We calculate the size our selves, adding 32MB (was 16MB) for fudging (min 13MB fudge needed on high sierra).
156 sudo hdiutil create -format UDBZ -volname "VirtualBox" -srcfolder "$(VBOX_PATH_PACK_TMP)/DiskImage" \
157 -size $(DOLLAR)((`sudo /usr/bin/du -sk "$(VBOX_PATH_PACK_TMP)/DiskImage/" | /usr/bin/cut -f1` + 32768))k \
158 "$@"
159 @# Change (back) the owner so it can be deleted by the user.
160 sudo chown "$(shell whoami)" "$@"
161 sudo chown -R "$(shell whoami)" $(VBOX_PATH_PACK_TMP)/DiskImage
162ifdef VBOX_SIGNING_MODE
163 ifndef VBOX_WITHOUT_SIGNED_DMG
164 @# Sign the created dmg.
165 $(call VBOX_SIGN_DMG_FN,$@,org.virtualbox.dmg)
166 if $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
167 @# Notarize the signed dmg (includes stapling).
168 $(call VBOX_NOTARIZE_FILE_FN,$@,org.virtualbox.VirtualBox.$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD).$(VBOX_SVN_REV))
169 endif
170 endif
171endif
172
173#
174# The meta-package.
175#
176$(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg: \
177 $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg \
178 $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg \
179 $(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg \
180 $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/* \
181 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/*.lproj/*) \
182 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)) \
183 $(if $(VBOX_WITH_FUSE_PACKING), $(VBOX_PATH_PACK_TMP)/Packages/OSXFuseCore.pkg) \
184 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
185 $(call MSG_TOOL,productbuild,,,$@)
186 @# Cleanup any previously failed attempts.
187 sudo rm -Rf \
188 $@ \
189 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.root \
190 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
191 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res
192 @# Correct directory permissions are important.
193 $(MKDIR) -p \
194 $(@D) \
195 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
196 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res \
197 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj
198 @# Do keyword replacement in the package info and description files.
199 $(SED) \
200 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
201 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
202 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
203 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
204 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
205 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
206 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
207 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Welcome.rtf \
208 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Welcome.rtf
209 @# Copy the resources.
210 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Conclusion.rtf $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Conclusion.rtf
211 $(SED) \
212 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
213 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
214 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
215 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Localizable.strings \
216 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Localizable.strings
217 $(INSTALL) -m 0644 $(VBOX_BRAND_DARWIN_INSTALLER_BG) $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/background.tif
218 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
219 $(MKDIR) -p \
220 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
221 $(SED) \
222 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
223 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
224 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
225 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
226 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Welcome.rtf \
227 $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)$(NLTAB) \
228 $(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) \
229 $(SED) \
230 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
231 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
232 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
233 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings \
234 $(VBOX_BRAND_$(f)_VIRTUALBOX_LOCALIZABLE_STRINGS)$(NLTAB) \
235 )
236 @# Build the package.
237 $(VBOX_PRODUCTBUILD) \
238 --distribution $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/distribution.dist \
239 --package-path $(VBOX_PATH_PACK_TMP)/Packages \
240 --resources $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res \
241 --identifier org.VirtualBox.mpkg.virtualbox \
242 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
243 $(if-expr defined(VBOX_MACOSX_INSTALLER_SIGN) && $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING)) == "",--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
244 $@
245ifdef VBOX_SIGNING_MODE
246 if $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
247 @# Sign the created pkg.
248 $(call VBOX_SIGN_PKG_FN,$@,org.VirtualBox.mpkg.virtualbox)
249 endif
250endif
251 @# Cleanup.
252 sudo rm -Rf \
253 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.root \
254 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
255 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res
256
257
258#
259# The VirtualBox Kernel extensions.
260#
261VBOX_DI_KEXTS_UNIVERSAL = VBoxDrv VBoxNetFlt VBoxNetAdp VBoxUSB
262VBOX_DI_KEXTS = $(VBOX_DI_KEXTS_UNIVERSAL)
263
264$(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg: \
265 $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), $(call VBOX_DI_FN_DEP_BOTH,$(kext).kext/Contents/MacOS/$(kext))) \
266 $(foreach kext,$(VBOX_DI_KEXTS), $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist) \
267 $$(wildcard $(VBOX_PATH_DI_SRC)/VBoxKEXTs/* \
268 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/*.lproj/*) \
269 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
270 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST) \
271 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML) \
272 $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS)) \
273 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
274 $(call MSG_TOOL,pkgbuild,,,$@)
275 @# Cleanup any previously failed attempts.
276 sudo rm -Rf \
277 $@ \
278 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
279 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
280 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
281 @# Correct directory permissions are important.
282 $(MKDIR) -p \
283 $(@D) \
284 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
285 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
286 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj
287 $(MKDIR) -p -m 0755 \
288 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
289 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons \
290 $(foreach kext,$(VBOX_DI_KEXTS), \
291 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext \
292 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents \
293 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS )
294 @# Copy the launch daemon bits.
295 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/VirtualBoxStartup.sh $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons/
296 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/org.virtualbox.startup.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons/
297 @# Copy the common files (Info.plist).
298 $(foreach kext,$(VBOX_DI_KEXTS), \
299 $(NLTAB)$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/)
300 @# Copy the binaries and invoking lipo.
301 $(foreach kext,$(VBOX_DI_KEXTS), \
302 $(NLTAB)$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/$(kext).kext/Contents/MacOS/$(kext) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS/)
303 @# Sign the kext bundles.
304ifdef VBOX_SIGNING_MODE
305 $(foreach kext,$(VBOX_DI_KEXTS) \
306 ,$(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS/$(kext),org.virtualbox.app.kext.$(kext)) )
307 $(foreach kext,$(VBOX_DI_KEXTS), \
308 $(NLTAB)$(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext,org.virtualbox.app.kext.$(kext)) )
309## @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 )
310endif
311 @# Set the correct owners.
312 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/
313 @# Do keyword replacement in the package info and description files.
314 $(SED) \
315 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
316 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
317 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
318 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
319 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
320 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
321 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
322 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/PkgBuildComponent.plist \
323 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/PkgBuildComponent.plist
324 @# Copy the resources.
325 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/postflight $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/
326 @# Build the package.
327 $(VBOX_PKGBUILD) \
328 --root $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/ \
329 --component-plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/PkgBuildComponent.plist \
330 --script $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
331 --identifier org.virtualbox.pkg.vboxkexts \
332 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
333 --install-location "/Library/Application Support/VirtualBox" \
334 --ownership preserve \
335 $(if-expr defined(VBOX_MACOSX_INSTALLER_SIGN) && $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING)) == "",--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
336 $@
337ifdef VBOX_SIGNING_MODE
338 if $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
339 @# Sign the created pkg.
340 $(call VBOX_SIGN_PKG_FN,$@,org.virtualbox.pkg.vboxkexts)
341 endif
342endif
343 @# Cleanup
344 sudo chown -R "$(shell whoami)" \
345 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root
346 sudo rm -Rf \
347 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
348 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
349 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
350
351
352#
353# Figure out which languages that we support and construct
354# .qm and .lproj lists for these.
355#
356include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
357ifdef VBOX_WITH_QTGUI
358 VBOX_INSTALL_LANG_FILES := $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES), VirtualBox_$(f).qm qt_$(f).qm)
359else
360 VBOX_INSTALL_LANG_FILES :=
361endif
362VBOX_INSTALL_LANG_LPROJ := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES))
363
364
365#
366# The VirtualBox Application.
367#
368
369VBOX_DI_VBAPP_PROGS_HARDENED = \
370 MacOS/VBoxHeadless \
371 MacOS/VBoxNetDHCP \
372 MacOS/VBoxNetNAT \
373 MacOS/VBoxVMMPreload
374ifdef VBOX_WITH_QTGUI
375 VBOX_DI_VBAPP_PROGS_HARDENED += \
376 Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM
377endif
378
379VBOX_DI_VBAPP_PROGS = \
380 MacOS/VBoxManage \
381 MacOS/VBoxSVC \
382 MacOS/VBoxXPCOMIPCD \
383 MacOS/VBoxNetAdpCtl \
384 MacOS/VBoxExtPackHelperApp \
385 MacOS/VBoxBugReport \
386 MacOS/VBoxBalloonCtrl \
387 MacOS/VBoxAutostart \
388 $(if $(VBOX_WITH_WEBSERVICES),MacOS/vboxwebsrv) \
389 $(if $(VBOX_WITH_DTRACE),MacOS/VBoxDTrace,) \
390 $(if $(VBOX_WITH_HOST_SHIPPING_AUDIO_TEST),MacOS/VBoxAudioTest,)
391ifdef VBOX_WITH_QTGUI
392 VBOX_DI_VBAPP_PROGS += \
393 MacOS/VirtualBox
394endif
395
396VBOX_DI_VBAPP_DYLIBS = \
397 MacOS/VBoxDD.dylib \
398 MacOS/VBoxDD2.dylib \
399 MacOS/VBoxDDU.dylib \
400 MacOS/VBoxRT.dylib \
401 $(if $(VBOX_WITH_SHARED_FOLDERS),MacOS/VBoxSharedFolders.dylib,) \
402 $(if $(VBOX_WITH_SHARED_CLIPBOARD),MacOS/VBoxSharedClipboard.dylib,) \
403 $(if $(VBOX_WITH_DRAG_AND_DROP),MacOS/VBoxDragAndDropSvc.dylib,) \
404 $(if $(VBOX_WITH_GUEST_PROPS),MacOS/VBoxGuestPropSvc.dylib,) \
405 MacOS/VBoxHostChannel.dylib \
406 MacOS/VBoxVMM.dylib \
407 MacOS/VBoxXPCOM.dylib \
408 MacOS/VBoxXPCOMC.dylib \
409 MacOS/components/VBoxC.dylib \
410 MacOS/components/VBoxSVCM.dylib \
411 MacOS/components/VBoxXPCOMIPCC.dylib \
412 MacOS/VBoxAuth.dylib \
413 MacOS/VBoxAuthSimple.dylib \
414 $(if $(VBOX_WITH_GUEST_CONTROL),MacOS/VBoxGuestControlSvc.dylib,)
415ifdef VBOX_WITH_QTGUI
416 VBOX_DI_VBAPP_DYLIBS += \
417 MacOS/UICommon.dylib
418 ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/libqtaccessiblewidgets.dylib),)
419 VBOX_DI_VBAPP_DYLIBS += \
420 MacOS/accessible/libqtaccessiblewidgets.dylib
421 endif
422endif
423if defined(VBOX_WITH_VRDP) && !defined(VBOX_WITH_EXTPACK_PUEL)
424 VBOX_DI_VBAPP_DYLIBS += \
425 MacOS/VBoxVRDP.dylib
426endif
427ifdef VBOX_WITH_DEBUGGER
428 VBOX_DI_VBAPP_DYLIBS += \
429 MacOS/DbgPlugInDiggers.dylib
430 if defined(VBOX_WITH_QTGUI) && defined(VBOX_WITH_DEBUGGER_GUI)
431 VBOX_DI_VBAPP_DYLIBS += \
432 MacOS/VBoxDbg.dylib
433 endif
434endif
435ifdef VBOX_WITH_HARDENING
436 VBOX_DI_VBAPP_DYLIBS += $(addprefix MacOS/,$(addsuffix .dylib,$(notdir $(VBOX_DI_VBAPP_PROGS_HARDENED))))
437endif
438ifdef VBOX_WITH_HDDPARALLELS_INSTALL
439 VBOX_DI_VBAPP_DYLIBS += \
440 MacOS/VBoxHDDParallels.dylib
441endif
442if defined(VBOX_WITH_PYTHON) && !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6) && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vlt "10.13"
443 VBOX_DI_VBAPP_DYLIBS += \
444 MacOS/VBoxPython2_6.so
445endif
446if defined(VBOX_WITH_PYTHON) && !defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_7)
447 VBOX_DI_VBAPP_DYLIBS += \
448 MacOS/VBoxPython2_7.so
449endif
450ifdef VBOX_WITH_VMSVGA3D
451 VBOX_DI_VBAPP_DYLIBS += \
452 MacOS/VBoxSVGA3D.dylib \
453 MacOS/VBoxSVGA3DObjC.dylib
454endif
455
456ifdef VBOX_WITH_PYTHON
457 VBOX_DI_VBAPP_DYLIBS.x86 += \
458 MacOS/VBoxPython2_5.so \
459 $(if-expr defined(VBOX_WITH_MAC_OS_X_10_4_SUPPORT),MacOS/VBoxPython2_3.so,)
460endif
461
462VBOX_DI_VBAPP_DYLIBS.amd64 :=
463if defined(VBOX_WITH_PYTHON) && defined(VBOX_WITHOUT_VBOXPYTHON_FOR_OSX_10_6) && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vlt "10.13"
464 VBOX_DI_VBAPP_DYLIBS.amd64 += \
465 MacOS/VBoxPython2_6.so
466endif
467
468if defined(VBOX_WITH_JXPCOM)
469 VBOX_DI_VBAPP_DYLIBS += \
470 MacOS/libvboxjxpcom.jnilib
471endif
472
473if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64), $(VBOX_DI_VBAPP_DYLIBS.x86))
474 $(error Conflict.$(NLTAB)VBOX_DI_VBAPP_DYLIBS.amd64=$(VBOX_DI_VBAPP_DYLIBS.amd64)$(NLTAB)VBOX_DI_VBAPP_DYLIBS.x86 =$(VBOX_DI_VBAPP_DYLIBS.x86))
475endif
476if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_DYLIBS.x86),$(VBOX_DI_VBAPP_DYLIBS))
477 $(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))
478endif
479
480VBOX_DI_VBAPP_UNIVERSAL_PROGS = \
481 $(if $(VBOX_WITH_VBOX_IMG)$(VBOX_WITH_TESTCASES),MacOS/vbox-img,) \
482 $(if $(VBOX_WITH_VBOXIMGMOUNT),MacOS/vboximg-mount,)
483ifdef VBOX_WITH_QTGUI
484 VBOX_DI_VBAPP_UNIVERSAL_PROGS += \
485 MacOS/vmstarter
486endif
487
488VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS = \
489 MacOS/VMMR0.r0 \
490 MacOS/VBoxDDR0.r0
491
492ifdef VBOX_WITH_RAW_MODE
493 VBOX_DI_VBAPP_OTHER_BINS = \
494 MacOS/VMMRC.rc \
495 MacOS/VBoxDDRC.rc
496else
497 VBOX_DI_VBAPP_OTHER_BINS =
498endif
499
500VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES = \
501 Resources/virtualbox.icns \
502 Resources/virtualbox.png \
503 Resources/virtualbox-vbox.icns \
504 Resources/virtualbox-vbox-extpack.icns \
505 Resources/virtualbox-ovf.icns \
506 Resources/virtualbox-ova.icns \
507 Resources/virtualbox-vdi.icns \
508 Resources/virtualbox-vmdk.icns \
509 Resources/virtualbox-vhd.icns \
510 Resources/virtualbox-hdd.icns
511
512VBOX_DI_VBAPP_MISC_FILES = \
513 MacOS/components/VBoxXPCOMBase.xpt \
514 MacOS/components/VirtualBox_XPCOM.xpt
515ifdef VBOX_WITH_QTGUI # Yeah, the output w/o the qt gui is a bit useless. But we just want it building now.
516 VBOX_DI_VBAPP_MISC_FILES += \
517 Info.plist \
518 PkgInfo \
519 $(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES) \
520 Resources/VirtualBoxVM.app/Contents/Info.plist \
521 Resources/VirtualBoxVM.app/Contents/PkgInfo \
522 $(addprefix Resources/VirtualBoxVM.app/Contents/,$(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES)) \
523 Resources/vmstarter.app/Contents/Info.plist \
524 Resources/vmstarter.app/Contents/PkgInfo \
525 $(addprefix Resources/vmstarter.app/Contents/,$(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES))
526endif
527ifdef VBOX_WITH_DOCS_PACKING
528 VBOX_DI_VBAPP_MISC_FILES += \
529 MacOS/UserManual.pdf
530endif
531ifdef VBOX_WITH_ADDITIONS_PACKING
532 ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso),)
533 VBOX_DI_VBAPP_MISC_FILES += \
534 MacOS/VBoxGuestAdditions.iso
535 endif
536endif
537ifdef VBOX_WITH_EFIFW_PACKING
538 VBOX_DI_VBAPP_MISC_FILES += \
539 MacOS/VBoxEFI32.fd \
540 MacOS/VBoxEFI64.fd
541endif
542VBOX_DI_VBAPP_SYMLINKS =
543ifdef VBOX_WITH_QTGUI
544 VBOX_DI_VBAPP_DYLIBS += \
545 $(foreach qtmod, $(VBOX_QT_MOD_NAMES), Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod)) \
546 plugins/platforms/libqcocoa$(SUFF_DLL) \
547 plugins/platforms/libqminimal$(SUFF_DLL) \
548 plugins/platforms/libqoffscreen$(SUFF_DLL) \
549 plugins/sqldrivers/libqsqlite$(SUFF_DLL) \
550 plugins/styles/libqmacstyle$(SUFF_DLL)
551 VBOX_DI_VBAPP_MISC_FILES += \
552 $(foreach qtmod, $(VBOX_QT_MOD_NAMES), Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/Resources/Info.plist)
553 VBOX_DI_VBAPP_SYMLINKS += \
554 Resources/vmstarter.app/Contents/MacOS=>../../../MacOS/ \
555 $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \
556 ,Frameworks/$(qtmod).framework/Versions/Current=>$(VBOX_QT_VERSION_MAJOR) )
557endif
558ifdef VBOX_WITH_PYTHON
559 # Python XPCOM glue
560 VBOX_DI_VBAPP_PYTHON_FILES = \
561 $(VBOXINST_SDK_BINDINGS_XPCOM_PYTHON_FILES) \
562 $(VBOXINST_SDK_INSTALLER_PYTHON_FILES)
563endif
564
565VBOX_VIRTUALBOX_APP_ENTITLEMENTS := $(PATH_ROOT)/src/VBox/HostDrivers/Support/darwin/SUPR3HardenedEntitlements.plist
566VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS := $(PATH_ROOT)/src/VBox/HostDrivers/Support/darwin/SUPR3HardenedEntitlementsVM.plist
567
568##
569# Add application and team ID into entitlement file
570# $(evalcall def_vbox_entitlement_add_app_and_team_id)
571# @param 1 Source entitlement file.
572# @param 2 Target entitlement file.
573# @param 3 Application ID.
574# @param 4 Team ID.
575define def_vbox_entitlement_add_app_and_team_id =
576$(2): $(1) $$(VBOX_DARWIN_INST_DEP_ON_MAKEFILE) | $$$$(dir $$$$@)
577 $$(QUIET)$$(SED) \
578 -e '/^<dict>$$$$/a \ <key>com.apple.application-identifier</key>\n <string>$(strip $(4)).$(strip $(3))</string>\n <key>com.apple.developer.team-identifier</key>\n <string>$(strip $(4))</string>' \
579 --output $$@ $$<
580endef
581
582if defined(VBOX_WITH_MACOS_HARDENED_RUNTIME) && defined(VBOX_SIGNING_MODE) && defined(VBOX_PROVISIONPROFILE_TEAM_ID)
583 ifdef VBOX_VIRTUALBOX_APP_ID
584 VBOX_VIRTUALBOX_APP_ENTITLEMENTS := $(VBOX_PATH_PACK_TMP)/SUPR3HardenedEntitlements.plist
585$(evalcall2 def_vbox_entitlement_add_app_and_team_id,$(PATH_ROOT)/src/VBox/HostDrivers/Support/darwin/SUPR3HardenedEntitlements.plist,$(VBOX_VIRTUALBOX_APP_ENTITLEMENTS),$(VBOX_VIRTUALBOX_APP_ID),$(VBOX_PROVISIONPROFILE_TEAM_ID))
586 endif
587
588 ifdef VBOX_VIRTUALBOXVM_APP_ID
589 VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS := $(VBOX_PATH_PACK_TMP)/SUPR3HardenedEntitlementsVM.plist
590$(evalcall2 def_vbox_entitlement_add_app_and_team_id,$(PATH_ROOT)/src/VBox/HostDrivers/Support/darwin/SUPR3HardenedEntitlementsVM.plist,$(VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS),$(VBOX_VIRTUALBOXVM_APP_ID),$(VBOX_PROVISIONPROFILE_TEAM_ID))
591 endif
592endif
593
594# (The dependencies are including way too much here because I'm lazy.)
595$(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg: \
596 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
597 $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST)) \
598 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
599 $(VBOX_DI_VBAPP_OTHER_BINS) $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_PROGS_HARDENED) $(VBOX_DI_VBAPP_MISC_FILES) \
600 ,$(call VBOX_DI_FN_DEP_BOTH,VirtualBox.app/Contents/$(f)) ) \
601 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86)\
602 ,$(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/$(f)) ) \
603 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64)\
604 ,$(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/$(f)) ) \
605 \
606 $(if $(VBOX_WITH_DOCS_PACKING),$(VBOX_ADD_MANUALS),) \
607 $(VBOX_BRAND_LICENSE_TXT) \
608 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*) \
609 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*.lproj/*) \
610 $$(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/,$(VBOX_INSTALL_LANG_FILES)) \
611 \
612 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/*) \
613 $(filter-out Disabled, $(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/*)) \
614 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*) \
615 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/*) \
616 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*) \
617 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*.lproj/*) \
618 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/*) \
619 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*) \
620 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*.lproj/*) \
621 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*.lproj/*) \
622 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/*) \
623 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/additions/*) \
624 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/components/*) \
625 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/*) \
626 $(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UnattendedTemplates/, $(VBOX_UNATTENDED_TEMPLATES)) \
627 $(if-expr defined(VBOX_WITH_PYTHON), $(addprefix $(VBOX_PATH_DIST)/, $(VBOX_DI_VBAPP_PYTHON_FILES)),) \
628 $(if-expr defined(VBOX_WITH_JXPCOM), $(addprefix $(VBOX_PATH_DIST)/, sdk/bindings/xpcom/java/vboxjxpcom.jar),) \
629 $(if-expr defined(VBOX_PROVISIONPROFILE_TEAM_ID),$(VBOX_PATH_DI_SRC)/VirtualBox/$(VBOX_PROVISIONPROFILE_TEAM_ID).provisionprofile,) \
630 $(if $(VBOX_WITH_WEBSERVICES),$(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist,) \
631 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxballoonctrl.plist \
632 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxautostart.plist \
633 $(VBOX_PATH_DI_SRC)/VirtualBox/VBoxAutostartDarwin.sh \
634 $(if-expr defined(VBOX_WITH_DTRACE), \
635 $(foreach f, $(VBOXINST_DTRACE_LIB_ARCH_FILES), \
636 $(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/MacOS/dtrace/lib/x86/$f) \
637 $(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/MacOS/dtrace/lib/amd64/$f)) \
638 $(foreach f, $(VBOXINST_DTRACE_TESTCASE_ARCH_FILES), \
639 $(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/MacOS/dtrace/testcase/x86/$f) \
640 $(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/MacOS/dtrace/testcase/amd64/$f)) \
641 $(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES)) \
642 ,) \
643 $(if-expr defined(VBOX_WITH_MACOS_HARDENED_RUNTIME) && defined(VBOX_SIGNING_MODE), \
644 $(VBOX_VIRTUALBOX_APP_ENTITLEMENTS) $(VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS),) \
645 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
646 $(call MSG_TOOL,pkgbuild,,,$@)
647 @# Cleanup any previously failed attempts.
648 sudo rm -Rf \
649 $@ \
650 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
651 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
652 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
653 @# Correct directory permissions are important.
654 $(MKDIR) -p \
655 $(@D) \
656 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
657 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
658 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/English.lproj
659 $(MKDIR) -p -m 0775 \
660 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications
661 $(MKDIR) -p -m 0755 $(sort \
662 $(VBOX_PATH_VBOX_APP_TMP)/Contents \
663 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS \
664 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/components \
665 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/nls \
666 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/accessible \
667 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources \
668 $(if-expr defined(VBOX_WITH_QTGUI), \
669 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app \
670 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app/Contents \
671 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/vmstarter.app \
672 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/vmstarter.app/Contents,) \
673 $(if-expr defined(VBOX_WITH_PYTHON), \
674 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk \
675 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/installer \
676 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/installer/vboxapi \
677 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/ \
678 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom \
679 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python \
680 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python/xpcom \
681 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/client \
682 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/server,) \
683 $(if-expr defined(VBOX_WITH_JXPCOM), \
684 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/java,) \
685 $(addprefix $(VBOX_PATH_VBOX_APP_TMP)/Contents/,$(dir \
686 $(VBOX_DI_VBAPP_DYLIBS) \
687 $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \
688 $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
689 $(VBOX_DI_VBAPP_OTHER_BINS) \
690 $(VBOX_DI_VBAPP_PROGS) \
691 $(VBOX_DI_VBAPP_PROGS_HARDENED) \
692 $(VBOX_DI_VBAPP_MISC_FILES) \
693 $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
694 $(VBOX_DI_VBAPP_MISC_FILES.$(KBUILD_TARGET_ARCH)) \
695 ))\
696 )
697# Create the .lproj language directories
698 $(MKDIR) -p -m 0755 \
699 $(addprefix $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/,$(VBOX_INSTALL_LANG_LPROJ))
700# Install all supported language files
701 $(foreach f, $(VBOX_INSTALL_LANG_FILES) \
702 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/$(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/nls/$(f)$(NLTAB))
703ifdef VBOX_PROVISIONPROFILE_TEAM_ID
704 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/$(VBOX_PROVISIONPROFILE_TEAM_ID).provisionprofile $(VBOX_PATH_VBOX_APP_TMP)/Contents/embedded.provisionprofile
705endif
706ifdef VBOX_WITH_WEBSERVICES
707 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
708endif
709 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxballoonctrl.plist $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
710 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxautostart.plist $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
711 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/VBoxAutostartDarwin.sh $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
712# Install the python bridge stuff
713ifdef VBOX_WITH_PYTHON
714 $(foreach f,$(VBOX_DI_VBAPP_PYTHON_FILES) \
715 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/$(f)$(NLTAB) )
716 $(INSTALL) -m 0755 $(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS
717endif
718# Install the java bridge stuff
719ifdef VBOX_WITH_JXPCOM
720 $(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
721endif
722# Copy misc files.
723 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES) \
724 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(f)$(NLTAB) )
725 $(INSTALL) -m 644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/LICENSE
726ifdef VBOX_WITH_DOCS_PACKING
727 $(foreach f,$(VBOX_ADD_MANUALS) \
728 ,$(INSTALL) -m 0644 $(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/$(NLTAB))
729endif
730 @# Create symlinks.
731 $(foreach symlink,$(VBOX_DI_VBAPP_SYMLINKS) $(VBOX_DI_VBAPP_SYMLINKS.$(KBUILD_TARGET_ARCH)) \
732 ,$(LN) -s $(word 2,$(subst =>, ,$(symlink))) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(word 1,$(subst =>, ,$(symlink)))$(NLTAB))
733 @# Copy the dylibs.
734 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
735 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(dylib)$(NLTAB))
736 @# Copy the other binaries.
737 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS) \
738 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(otherbin)$(NLTAB))
739 @# Create/copy the universal executable binaries.
740 $(foreach otherbin, $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
741 ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(otherbin)$(NLTAB))
742 @# Copy the binaries.
743 $(foreach prog, $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_PROGS_HARDENED) \
744 ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(prog) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(prog)$(NLTAB))
745ifdef VBOX_UNATTENDED_TEMPLATES
746# Unattended installation template scripts.
747 $(MKDIR) -p -m 0755 -- $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/UnattendedTemplates
748 $(foreach file, $(VBOX_UNATTENDED_TEMPLATES) \
749 ,$(INSTALL) -m 0655 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UnattendedTemplates/$(file) \
750 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/UnattendedTemplates/$(file)$(NLTAB))
751endif
752ifdef VBOX_WITH_DTRACE
753# DTrace library, testcases and scripts.
754 $(MKDIR) -p -m 0755 -- \
755 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/lib/$(KBUILD_TARGET_ARCH)/ \
756 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/testcase/$(KBUILD_TARGET_ARCH)/ \
757 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/scripts/
758 $(foreach file, $(addprefix lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
759 $(addprefix testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
760 $(addprefix scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES)) \
761 ,$(INSTALL) -m 0655 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/dtrace/$(file) \
762 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/$(file)$(NLTAB))
763endif
764ifndef VBOX_WITH_QTGUI
765# Hack alert! Just something to make pkgbuild happy.
766 $(APPEND) -tn "$(VBOX_PATH_VBOX_APP_TMP)/Contents/PkgInfo" "APPLVBOX"
767 $(APPEND) -tn "$(VBOX_PATH_VBOX_APP_TMP)/Contents/Info.plist" \
768 '<?xml version="1.0" encoding="UTF-8"?>' \
769 '<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' \
770 '<plist version="1.0">' \
771 '<dict>' \
772 ' <key>CFBundlePackageType</key> <string>APPL</string>' \
773 ' <key>CFBundleSignature</key> <string>VBOX</string>' \
774 ' <key>CFBundleDevelopmentRegion</key> <string>English</string>' \
775 ' <key>CFBundleIdentifier</key> <string>org.virtualbox.app.VBoxManage</string>' \
776 ' <key>CFBundleName</key> <string>VirtualBox</string>' \
777 ' <key>CFBundleExecutable</key> <string>VBoxManage</string>' \
778 ' <key>CFBundleVersion</key> <string>$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)</string>' \
779 ' <key>CFBundleShortVersionString</key> <string>$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)</string>' \
780 ' <key>CFBundleGetInfoString</key> <string>$(VBOX_PRODUCT) Manager $(VBOX_VERSION_STRING), © 2007-$(VBOX_C_YEAR) $(VBOX_VENDOR)</string>' \
781 ' <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string>' \
782 '</dict>' \
783 '</plist>'
784endif
785 @# Sign the binaries and the application bundle.
786ifdef VBOX_SIGNING_MODE
787 ifdef VBOX_WITH_QTGUI
788 $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \
789 ,$(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod),org.virtualbox.app.frameworks.$(qtmod)) )
790 $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \
791 ,$(NLTAB)$(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR),org.virtualbox.app.frameworks.$(qtmod)) )
792 endif
793 $(foreach dylib, \
794 $(VBOX_DI_VBAPP_DYLIBS) \
795 $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
796 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(dylib),org.virtualbox.app.macos.$(notdir $(dylib))) )
797 $(foreach bin, $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
798 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin))) )
799 $(foreach other, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS)\
800 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(other),org.virtualbox.app.macos.$(notdir $(other))) )
801 $(foreach bin, $(filter-out MacOS/VirtualBox,$(VBOX_DI_VBAPP_PROGS) $(if-expr !defined(VBOX_WITH_MACOS_HARDENED_RUNTIME),$(VBOX_DI_VBAPP_PROGS_HARDENED),)) \
802 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin))) )
803 $(foreach file, $(if-expr defined(VBOX_WITH_WEBSERVICES),MacOS/org.virtualbox.vboxwebsrv.plist,) \
804 MacOS/org.virtualbox.vboxballoonctrl.plist \
805 MacOS/org.virtualbox.vboxautostart.plist \
806 MacOS/VBoxAutostartDarwin.sh \
807 $(if-expr defined(VBOX_WITH_PYTHON),$(addprefix MacOS/, $(VBOX_DI_VBAPP_PYTHON_FILES) vboxshell.py),) \
808 $(if-expr defined(VBOX_WITH_JXPCOM),MacOS/sdk/bindings/xpcom/java/vboxjxpcom.jar,) \
809 $(filter MacOS/%,$(VBOX_DI_VBAPP_MISC_FILES)) \
810 $(if-expr defined(VBOX_WITH_DOCS_PACKING),$(addprefix MacOS/,$(VBOX_ADD_MANUALS)),) \
811 $(if-expr defined(VBOX_WITH_DTRACE),\
812 $(addprefix MacOS/dtrace/lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
813 $(addprefix MacOS/dtrace/testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
814 $(addprefix MacOS/dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES)) ,) \
815 $(addprefix MacOS/nls/,$(VBOX_INSTALL_LANG_FILES)) \
816 , $(NLTAB)$(call VBOX_SIGN_FILE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(file),org.virtualbox.app.$(tolower $(subst $(SP),,$(subst /,.,$(file))))) )
817
818ifdef VBOX_PROVISIONPROFILE_TEAM_ID
819# $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/$(VBOX_PROVISIONPROFILE_TEAM_ID).provisionprofile $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app/Contents/embedded.provisionprofile
820endif
821 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app,,$(if-expr defined(VBOX_WITH_MACOS_HARDENED_RUNTIME)\
822 ,--entitlements="$(VBOX_VIRTUALBOX_APP_ENTITLEMENTS)",))
823 ifdef VBOX_WITH_QTGUI
824 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/vmstarter.app,,)
825 endif
826 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP),,--deep)
827 ifdef VBOX_WITH_MACOS_HARDENED_RUNTIME # HACK ALERT! --deep fries the entitlements, so redo w/o --deep now.
828 $(foreach bin, $(filter-out MacOS/VirtualBoxVM MacOS/VBoxHeadless,$(VBOX_DI_VBAPP_PROGS_HARDENED)) \
829 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin)), \
830 --entitlements="$(VBOX_VIRTUALBOX_APP_ENTITLEMENTS)"))
831 $(foreach bin, $(filter MacOS/VirtualBoxVM MacOS/VBoxHeadless,$(VBOX_DI_VBAPP_PROGS_HARDENED)) \
832 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin)), \
833 --entitlements="$(VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS)"))
834 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app,,\
835 --entitlements="$(VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS)",)
836 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP),,\
837 --entitlements="$(VBOX_VIRTUALBOX_APP_ENTITLEMENTS)",)
838 $(foreach bin, $(VBOX_DI_VBAPP_PROGS_HARDENED) \
839 , $(NLTAB)codesign -d -v -v -v --entitlements :- $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin) )
840 $(foreach bin, $(VBOX_DI_VBAPP_PROGS) \
841 , $(NLTAB)codesign -d -v -v -v --entitlements :- $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin) )
842 endif
843endif
844 @# Set the correct owner and set the set-user-ID-on-execution bit on the relevant executables.
845 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
846 sudo chmod u+s $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/VBoxNetAdpCtl
847ifdef VBOX_WITH_HARDENING
848 sudo chmod u+s $(foreach bin,$(VBOX_DI_VBAPP_PROGS_HARDENED),$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin))
849endif
850if 0 # Handy for testing the app bundle w/o having to reinstall all the time (just untar it into -C /Applications/)
851 $(RM) -f -- "$(PATH_OUT)/VirtualBox.app.tar.gz"
852 tar -czf "$(PATH_OUT)/VirtualBox.app.tar.gz" -C "$(VBOX_PATH_VBOX_APP_TMP)/.." VirtualBox.app
853endif
854 @# Do keyword replacement in the package info and description files.
855 $(SED) \
856 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
857 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
858 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
859 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
860 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
861 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
862 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
863 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/PkgBuildComponent.plist \
864 $(VBOX_PATH_DI_SRC)/VirtualBox/PkgBuildComponent.plist
865 @# Copy the resources.
866 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/preflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/
867ifdef VBOX_WITH_HARDENING
868 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/postflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/
869else
870 $(SED) -s '/WITH_HARDENING/d' -o $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/postflight $(VBOX_PATH_DI_SRC)/VirtualBox/postflight
871 $(CHMOD) 0755 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/postflight
872endif
873 ls -lR $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/
874 @# Build the package.
875 $(VBOX_PKGBUILD) \
876 --root $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/ \
877 --component-plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/PkgBuildComponent.plist \
878 --script $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
879 --identifier org.virtualbox.pkg.virtualbox \
880 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
881 --install-location /Applications/ \
882 --ownership preserve \
883 --preserve-xattr \
884 $(if-expr defined(VBOX_MACOSX_INSTALLER_SIGN) && $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING)) == "",--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
885 $@
886ifdef VBOX_SIGNING_MODE
887 if $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
888 @# Sign the created pkg.
889 $(call VBOX_SIGN_PKG_FN,$@,org.virtualbox.pkg.virtualbox)
890 endif
891endif
892 @# Cleanup
893 sudo chown -R "$(shell whoami)" \
894 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
895 sudo chmod -R a-s \
896 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
897 sudo rm -Rf \
898 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
899 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
900 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
901
902#
903# The VirtualBox CLI wrapper scripts.
904#
905$(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg: \
906 $$(wildcard $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/* \
907 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/*.lproj/*) \
908 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
909 ,$(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST)) \
910 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
911 $(call MSG_TOOL,pkgbuild,,,$@)
912 @# Cleanup any previously failed attempts.
913 sudo rm -Rf \
914 $@ \
915 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
916 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
917 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
918 @# Correct directory permissions are important.
919 $(MKDIR) -p \
920 $(@D) \
921 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
922 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \
923 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/English.lproj
924 $(MKDIR) -p -m 0755 \
925 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr \
926 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin
927 @# Generate the wrapper scripts.
928 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VirtualBox \
929 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VirtualBox "$$@"'
930 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VirtualBoxVM \
931 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM "$$@"'
932 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxManage \
933 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxManage "$$@"'
934 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxVRDP \
935 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
936 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxHeadless \
937 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
938ifdef VBOX_WITH_WEBSERVICES
939 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/vboxwebsrv \
940 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv "$$@"'
941endif
942if defined(VBOX_WITH_VBOX_IMG) || defined(VBOX_WITH_TESTCASES)
943 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/vbox-img \
944 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/vbox-img "$$@"'
945endif
946if defined(VBOX_WITH_VBOXIMGMOUNT)
947 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/vboximg-mount \
948 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/vboximg-mount "$$@"'
949endif
950 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxBugReport \
951 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxBugReport "$$@"'
952 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxBalloonCtrl \
953 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxBalloonCtrl "$$@"'
954 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxAutostart \
955 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart "$$@"'
956ifdef VBOX_WITH_DTRACE
957 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxDTrace \
958 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxDTrace "$$@"'
959endif
960ifdef VBOX_WITH_HOST_SHIPPING_AUDIO_TEST
961 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxAudioTest \
962 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxAudioTest "$$@"'
963endif
964 @# Set the correct owners and file permissions.
965 sudo chmod 0755 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/*
966 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root
967 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr
968 @# Build the package.
969 $(VBOX_PKGBUILD) \
970 --root $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin \
971 --identifier org.virtualbox.pkg.virtualboxcli \
972 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
973 --install-location /usr/local/bin \
974 --ownership preserve \
975 $(if-expr defined(VBOX_MACOSX_INSTALLER_SIGN) && $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING)) == "",--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
976 $@
977ifdef VBOX_SIGNING_MODE
978 if $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
979 @# Sign the created pkg.
980 $(call VBOX_SIGN_PKG_FN,$@,org.virtualbox.pkg.virtualboxcli)
981 endif
982endif
983 @# Cleanup
984 sudo chown -R "$(shell whoami)" \
985 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root
986 sudo rm -Rf \
987 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
988 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
989 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
990
991ifdef VBOX_WITH_FUSE_PACKING
992#
993# The FUSE for macOS core package.
994#
995VBOX_PATH_FUSE_CORE_PKG ?= $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_TRG)/osxfuse/v*)))/Core.pkg
996$(VBOX_PATH_PACK_TMP)/Packages/OSXFuseCore.pkg: \
997 $(VBOX_PATH_FUSE_CORE_PKG)
998 $(call MSG_TOOL,Preparing FUSE for macOS core package,,,$@)
999 @# Cleanup any previously failed attempts.
1000 sudo rm -Rf $@
1001 $(MKDIR) -p $(@D)
1002 pkgutil --flatten $(VBOX_PATH_FUSE_CORE_PKG) $@
1003endif
1004
1005
1006#
1007# Aliases.
1008#
1009VBoxKEXTs.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg
1010VirtualBoxCLI.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg
1011VirtualBox.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg
1012VirtualBox.mpkg: $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg
1013VirtualBox.dmg: $(VBOX_PATH_DIST)/VirtualBox-$(VBOX_VERSION_STRING)-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