VirtualBox

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

Last change on this file since 98278 was 98103, checked in by vboxsync, 2 years ago

Copyright year updates by scm.

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