VirtualBox

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

Last change on this file since 105343 was 105343, checked in by vboxsync, 5 months ago

Installer/darwin: Additional comment for 'mount_dmg' target. bugref:10724

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