VirtualBox

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

Last change on this file since 100108 was 99957, checked in by vboxsync, 19 months ago

Installer/darwin: Include the ARM VMM library in the package if enabled, bugref:10463

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 50.3 KB
Line 
1# $Id: Makefile.kmk 99957 2023-05-24 11:44:04Z 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 \
205 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/* \
206 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/*.lproj/*) \
207 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)) \
208 $(if $(VBOX_WITH_FUSE_PACKING), $(VBOX_PATH_PACK_TMP)/Packages/OSXFuseCore.pkg) \
209 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
210 $(call MSG_TOOL,productbuild,,,$@)
211 @# Cleanup any previously failed attempts.
212 sudo rm -Rf \
213 $@ \
214 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.root \
215 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
216 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res
217 @# Correct directory permissions are important.
218 $(MKDIR) -p \
219 $(@D) \
220 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
221 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res \
222 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj
223 @# Do keyword replacement in the package info and description files.
224 $(SED) \
225 -e 's+@VBOX_VERSION_STRING@+$(VBOX_VERSION_STRING)+g' \
226 -e 's+@VBOX_VERSION_MAJOR@+$(VBOX_VERSION_MAJOR)+g' \
227 -e 's+@VBOX_VERSION_MINOR@+$(VBOX_VERSION_MINOR)+g' \
228 -e 's+@VBOX_VERSION_BUILD@+$(VBOX_VERSION_BUILD)+g' \
229 -e 's+@VBOX_VENDOR@+$(VBOX_VENDOR)+g' \
230 -e 's+@VBOX_PRODUCT@+$(VBOX_PRODUCT)+g' \
231 -e 's+@VBOX_C_YEAR@+$(VBOX_C_YEAR)+g' \
232 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Welcome.rtf \
233 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Welcome.rtf
234 @# Do keyword replacement in the distribution script.
235 $(SED) \
236 -e 's+@VBOX_TARGET_ARCH@+$(VBOX_DI_TARGET_ARCH)+g' \
237 -e 's+@VBOX_ARCH_LIST@+$(VBOX_DI_ARCH_LIST)+g' \
238 --output $(VBOX_PATH_PACK_TMP)/distribution.dist \
239 $(if $(VBOX_WITH_VBOXDRV), $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/distribution.dist, $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/distribution-driverless.dist)
240 @# Copy the resources.
241 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Conclusion.rtf $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Conclusion.rtf
242 $(SED) \
243 -e 's+@VBOX_VENDOR@+$(VBOX_VENDOR)+g' \
244 -e 's+@VBOX_PRODUCT@+$(VBOX_PRODUCT)+g' \
245 -e 's+@VBOX_C_YEAR@+$(VBOX_C_YEAR)+g' \
246 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/English.lproj/Localizable.strings \
247 $(VBOX_PATH_DI_SRC)/VirtualBox_mpkg/Localizable.strings
248 $(INSTALL) -m 0644 $(VBOX_BRAND_DARWIN_INSTALLER_BG) $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/background.tif
249 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
250 $(MKDIR) -p \
251 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj$(NLTAB) \
252 $(SED) \
253 -e 's+@VBOX_VERSION_STRING@+$(VBOX_VERSION_STRING)+g' \
254 -e 's+@VBOX_VERSION_MAJOR@+$(VBOX_VERSION_MAJOR)+g' \
255 -e 's+@VBOX_VERSION_MINOR@+$(VBOX_VERSION_MINOR)+g' \
256 -e 's+@VBOX_VERSION_BUILD@+$(VBOX_VERSION_BUILD)+g' \
257 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Welcome.rtf \
258 $(VBOX_BRAND_$(f)_VIRTUALBOX_WELCOME_RTF)$(NLTAB) \
259 $(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) \
260 $(SED) \
261 -e 's+@VBOX_VENDOR@+$(VBOX_VENDOR)+g' \
262 -e 's+@VBOX_PRODUCT@+$(VBOX_PRODUCT)+g' \
263 -e 's+@VBOX_C_YEAR@+$(VBOX_C_YEAR)+g' \
264 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res/$(VBOX_INSTALLER_$(f)_DARWIN_TARGET).lproj/Localizable.strings \
265 $(VBOX_BRAND_$(f)_VIRTUALBOX_LOCALIZABLE_STRINGS)$(NLTAB) \
266 )
267 @# Build the package.
268 $(VBOX_PRODUCTBUILD) \
269 --distribution $(VBOX_PATH_PACK_TMP)/distribution.dist \
270 --package-path $(VBOX_PATH_PACK_TMP)/Packages \
271 --resources $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res \
272 --identifier org.VirtualBox.mpkg.virtualbox \
273 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
274 $(if-expr defined(VBOX_MACOSX_INSTALLER_SIGN) && $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING)) == "",--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
275 $@
276ifdef VBOX_SIGNING_MODE
277 if $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
278 @# Sign the created pkg.
279 $(call VBOX_SIGN_PKG_FN,$@,org.VirtualBox.mpkg.virtualbox)
280 endif
281endif
282 @# Cleanup.
283 sudo rm -Rf \
284 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.root \
285 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.desc \
286 $(VBOX_PATH_PACK_TMP)/VirtualBox.dist.res
287
288
289ifdef VBOX_WITH_VBOXDRV
290 #
291 # The VirtualBox Kernel extensions.
292 #
293 VBOX_DI_KEXTS_UNIVERSAL = VBoxDrv VBoxNetFlt VBoxNetAdp
294 VBOX_DI_KEXTS = $(VBOX_DI_KEXTS_UNIVERSAL)
295
296 $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg: \
297 $(foreach kext,$(VBOX_DI_KEXTS_UNIVERSAL), $(call VBOX_DI_FN_DEP_BOTH,$(kext).kext/Contents/MacOS/$(kext))) \
298 $(foreach kext,$(VBOX_DI_KEXTS), $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist) \
299 $$(wildcard \
300 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/* \
301 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/*.lproj/*) \
302 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
303 $(VBOX_BRAND_$(f)_VBOXKEXTS_DESCRIPTION_PLIST) \
304 $(VBOX_BRAND_$(f)_VBOXKEXTS_README_HTML) \
305 $(VBOX_BRAND_$(f)_VBOXKEXTS_INSTALLATIONCHECK_STRINGS)) \
306 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
307 $(call MSG_TOOL,pkgbuild,,,$@)
308 @# Cleanup any previously failed attempts.
309 sudo rm -Rf \
310 $@ \
311 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
312 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
313 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
314 @# Correct directory permissions are important.
315 $(MKDIR) -p \
316 $(@D) \
317 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
318 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
319 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/English.lproj
320 $(MKDIR) -p -m 0755 \
321 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
322 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons \
323 $(foreach kext,$(VBOX_DI_KEXTS), \
324 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext \
325 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents \
326 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS )
327 @# Copy the launch daemon bits.
328 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/VirtualBoxStartup.sh $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons/
329 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/org.virtualbox.startup.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/LaunchDaemons/
330 @# Copy the common files (Info.plist).
331 $(foreach kext,$(VBOX_DI_KEXTS), \
332 $(NLTAB)$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(kext).kext/Contents/Info.plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/)
333 @# Copy the binaries and invoking lipo.
334 $(foreach kext,$(VBOX_DI_KEXTS), \
335 $(NLTAB)$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/$(kext).kext/Contents/MacOS/$(kext) $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS/)
336 @# Sign the kext bundles.
337 ifdef VBOX_SIGNING_MODE
338 $(foreach kext,$(VBOX_DI_KEXTS) \
339 ,$(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext/Contents/MacOS/$(kext),org.virtualbox.app.kext.$(kext)) )
340 $(foreach kext,$(VBOX_DI_KEXTS) \
341 ,$(NLTAB)$(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/$(kext).kext,org.virtualbox.app.kext.$(kext)) )
342 ## @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 )
343 endif
344 @# Set the correct owners.
345 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/
346 @# Do keyword replacement in the package info and description files.
347 $(SED) \
348 -e 's+@VBOX_VERSION_STRING@+$(VBOX_VERSION_STRING)+g' \
349 -e 's+@VBOX_VERSION_MAJOR@+$(VBOX_VERSION_MAJOR)+g' \
350 -e 's+@VBOX_VERSION_MINOR@+$(VBOX_VERSION_MINOR)+g' \
351 -e 's+@VBOX_VERSION_BUILD@+$(VBOX_VERSION_BUILD)+g' \
352 -e 's+@VBOX_VENDOR@+$(VBOX_VENDOR)+g' \
353 -e 's+@VBOX_PRODUCT@+$(VBOX_PRODUCT)+g' \
354 -e 's+@VBOX_C_YEAR@+$(VBOX_C_YEAR)+g' \
355 --output $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/PkgBuildComponent.plist \
356 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/PkgBuildComponent.plist
357 @# Copy the resources.
358 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VBoxKEXTs/postflight $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res/
359 @# Build the package.
360 $(VBOX_PKGBUILD) \
361 --root $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root/ \
362 --component-plist $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc/PkgBuildComponent.plist \
363 --script $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res \
364 --identifier org.virtualbox.pkg.vboxkexts \
365 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
366 --install-location "/Library/Application Support/VirtualBox" \
367 --ownership preserve \
368 $(if-expr defined(VBOX_MACOSX_INSTALLER_SIGN) && $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING)) == "",--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
369 $@
370 ifdef VBOX_SIGNING_MODE
371 if $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
372 @# Sign the created pkg.
373 $(call VBOX_SIGN_PKG_FN,$@,org.virtualbox.pkg.vboxkexts)
374 endif
375 endif
376 @# Cleanup
377 sudo chown -R "$(shell whoami)" \
378 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root
379 sudo rm -Rf \
380 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.root \
381 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.desc \
382 $(VBOX_PATH_PACK_TMP)/VBoxKEXTs.pkg.res
383endif # !VBOX_WITH_VBOXDRV
384
385
386#
387# Figure out which languages that we support and construct
388# .qm and .lproj lists for these.
389#
390include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
391ifdef VBOX_WITH_QTGUI
392 VBOX_INSTALL_LANG_FILES := $(foreach f,$(VBOX_APPROVED_GUI_LANGUAGES), VirtualBox_$(f).qm qt_$(f).qm)
393else
394 VBOX_INSTALL_LANG_FILES :=
395endif
396VBOX_INSTALL_LANG_LPROJ := $(addsuffix .lproj,$(VBOX_APPROVED_GUI_LANGUAGES))
397
398
399#
400# The VirtualBox Application.
401#
402
403VBOX_DI_VBAPP_PROGS_HARDENED = \
404 MacOS/VBoxHeadless \
405 MacOS/VBoxNetDHCP \
406 MacOS/VBoxNetNAT \
407 MacOS/VBoxVMMPreload
408ifdef VBOX_WITH_QTGUI
409 VBOX_DI_VBAPP_PROGS_HARDENED += \
410 Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM
411endif
412
413VBOX_DI_VBAPP_PROGS = \
414 MacOS/VBoxManage \
415 MacOS/VBoxSVC \
416 MacOS/VBoxXPCOMIPCD \
417 MacOS/VBoxNetAdpCtl \
418 MacOS/VBoxExtPackHelperApp \
419 $(if $(VBOX_WITH_FE_BUGREPORT),MacOS/VBoxBugReport) \
420 $(if $(VBOX_WITH_FE_BALLOONCTRL),MacOS/VBoxBalloonCtrl) \
421 $(if $(VBOX_WITH_FE_AUTOSTART),MacOS/VBoxAutostart) \
422 $(if $(VBOX_WITH_WEBSERVICES),MacOS/vboxwebsrv) \
423 $(if $(VBOX_WITH_DTRACE),MacOS/VBoxDTrace,) \
424 $(if $(VBOX_WITH_HOST_SHIPPING_AUDIO_TEST),MacOS/VBoxAudioTest,)
425ifdef VBOX_WITH_QTGUI
426 VBOX_DI_VBAPP_PROGS += \
427 MacOS/VirtualBox
428endif
429
430VBOX_DI_VBAPP_DYLIBS = \
431 MacOS/VBoxDD.dylib \
432 MacOS/VBoxDD2.dylib \
433 MacOS/VBoxDDU.dylib \
434 MacOS/VBoxRT.dylib \
435 $(if $(VBOX_WITH_LIBSSH),MacOS/VBoxLibSsh.dylib,) \
436 $(if $(VBOX_WITH_SHARED_FOLDERS),MacOS/VBoxSharedFolders.dylib,) \
437 $(if $(VBOX_WITH_SHARED_CLIPBOARD),MacOS/VBoxSharedClipboard.dylib,) \
438 $(if $(VBOX_WITH_DRAG_AND_DROP),MacOS/VBoxDragAndDropSvc.dylib,) \
439 $(if $(VBOX_WITH_GUEST_PROPS),MacOS/VBoxGuestPropSvc.dylib,) \
440 MacOS/VBoxHostChannel.dylib \
441 MacOS/VBoxVMM.dylib \
442 $(if $(VBOX_WITH_VIRT_ARMV8),MacOS/VBoxVMMArm.dylib,) \
443 MacOS/VBoxXPCOM.dylib \
444 MacOS/VBoxXPCOMC.dylib \
445 MacOS/components/VBoxC.dylib \
446 MacOS/components/VBoxSVCM.dylib \
447 MacOS/components/VBoxXPCOMIPCC.dylib \
448 MacOS/VBoxAuth.dylib \
449 MacOS/VBoxAuthSimple.dylib \
450 $(if $(VBOX_WITH_GUEST_CONTROL),MacOS/VBoxGuestControlSvc.dylib,)
451ifdef VBOX_WITH_QTGUI
452 VBOX_DI_VBAPP_DYLIBS += \
453 MacOS/UICommon.dylib
454 ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/libqtaccessiblewidgets.dylib),)
455 VBOX_DI_VBAPP_DYLIBS += \
456 MacOS/accessible/libqtaccessiblewidgets.dylib
457 endif
458endif
459if defined(VBOX_WITH_VRDP) && !defined(VBOX_WITH_EXTPACK_PUEL)
460 VBOX_DI_VBAPP_DYLIBS += \
461 MacOS/VBoxVRDP.dylib
462endif
463ifdef VBOX_WITH_DEBUGGER
464 VBOX_DI_VBAPP_DYLIBS += \
465 MacOS/DbgPlugInDiggers.dylib
466 if defined(VBOX_WITH_QTGUI) && defined(VBOX_WITH_DEBUGGER_GUI)
467 VBOX_DI_VBAPP_DYLIBS += \
468 MacOS/VBoxDbg.dylib
469 endif
470endif
471ifdef VBOX_WITH_HARDENING
472 VBOX_DI_VBAPP_DYLIBS += $(addprefix MacOS/,$(addsuffix .dylib,$(notdir $(VBOX_DI_VBAPP_PROGS_HARDENED))))
473endif
474if defined(VBOX_WITH_PYTHON) && "$(VBOX_DEF_MACOSX_VERSION_MIN)" vlt "10.13"
475 VBOX_DI_VBAPP_DYLIBS += \
476 MacOS/VBoxPython2_6.so
477endif
478if defined(VBOX_WITH_PYTHON)
479 VBOX_DI_VBAPP_DYLIBS += \
480 MacOS/VBoxPython2_7.so
481endif
482if defined(VBOX_WITH_PYTHON) \
483 && !defined(VBOX_WITHOUT_PYTHON_LIMITED_API) \
484 && exists "$(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/VBoxPython3.so"
485 VBOX_DI_VBAPP_DYLIBS += \
486 MacOS/VBoxPython3.so
487endif
488ifdef VBOX_WITH_VMSVGA3D
489 VBOX_DI_VBAPP_DYLIBS += \
490 MacOS/VBoxSVGA3D.dylib \
491 MacOS/VBoxSVGA3DObjC.dylib
492endif
493ifdef VBOX_WITH_DXVK
494 VBOX_DI_VBAPP_DYLIBS += \
495 MacOS/VBoxDxVk.dylib \
496 MacOS/libMoltenVK.dylib
497endif
498
499if defined(VBOX_WITH_JXPCOM)
500 VBOX_DI_VBAPP_DYLIBS += \
501 MacOS/libvboxjxpcom.jnilib
502endif
503
504if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64), $(VBOX_DI_VBAPP_DYLIBS.x86))
505 $(error Conflict.$(NLTAB)VBOX_DI_VBAPP_DYLIBS.amd64=$(VBOX_DI_VBAPP_DYLIBS.amd64)$(NLTAB)VBOX_DI_VBAPP_DYLIBS.x86 =$(VBOX_DI_VBAPP_DYLIBS.x86))
506endif
507if1of ($(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_DYLIBS.x86), $(VBOX_DI_VBAPP_DYLIBS))
508 $(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))
509endif
510
511VBOX_DI_VBAPP_UNIVERSAL_PROGS = \
512 $(if $(VBOX_WITH_VBOX_IMG)$(VBOX_WITH_TESTCASES),MacOS/vbox-img,) \
513 $(if $(VBOX_WITH_VBOXIMGMOUNT),MacOS/vboximg-mount,)
514ifdef VBOX_WITH_QTGUI
515 VBOX_DI_VBAPP_UNIVERSAL_PROGS += \
516 MacOS/vmstarter
517endif
518
519ifdef VBOX_WITH_R0_MODULES
520 VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS = \
521 MacOS/VMMR0.r0 \
522 MacOS/VBoxDDR0.r0
523else
524 VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS =
525endif
526
527ifdef VBOX_WITH_RAW_MODE
528 VBOX_DI_VBAPP_OTHER_BINS = \
529 MacOS/VMMRC.rc \
530 MacOS/VBoxDDRC.rc
531else
532 VBOX_DI_VBAPP_OTHER_BINS =
533endif
534
535VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES = \
536 Resources/virtualbox.icns \
537 Resources/virtualbox.png \
538 Resources/virtualbox-vbox.icns \
539 Resources/virtualbox-vbox-extpack.icns \
540 Resources/virtualbox-ovf.icns \
541 Resources/virtualbox-ova.icns \
542 Resources/virtualbox-vdi.icns \
543 Resources/virtualbox-vmdk.icns \
544 Resources/virtualbox-vhd.icns \
545 Resources/virtualbox-hdd.icns
546
547VBOX_DI_VBAPP_MISC_FILES = \
548 MacOS/components/VBoxXPCOMBase.xpt \
549 MacOS/components/VirtualBox_XPCOM.xpt
550ifdef VBOX_WITH_QTGUI # Yeah, the output w/o the qt gui is a bit useless. But we just want it building now.
551 VBOX_DI_VBAPP_MISC_FILES += \
552 Info.plist \
553 PkgInfo \
554 $(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES) \
555 Resources/VirtualBoxVM.app/Contents/Info.plist \
556 Resources/VirtualBoxVM.app/Contents/PkgInfo \
557 $(addprefix Resources/VirtualBoxVM.app/Contents/,$(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES)) \
558 Resources/vmstarter.app/Contents/Info.plist \
559 Resources/vmstarter.app/Contents/PkgInfo \
560 $(addprefix Resources/vmstarter.app/Contents/,$(VBOX_DI_VBAPP_DUPLICATED_RESOURCE_FILES))
561endif
562ifdef VBOX_WITH_DOCS_PACKING
563 VBOX_DI_VBAPP_MISC_FILES += \
564 MacOS/UserManual.pdf
565 ifdef VBOX_WITH_DOCS_QHELP_PACKING
566 VBOX_DI_VBAPP_MISC_FILES += \
567 MacOS/UserManual.qch \
568 MacOS/UserManual.qhc
569 endif
570endif
571ifdef VBOX_WITH_ADDITIONS_PACKING
572 ifneq ($(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso),)
573 VBOX_DI_VBAPP_MISC_FILES += \
574 MacOS/VBoxGuestAdditions.iso
575 endif
576endif
577ifdef VBOX_WITH_EFIFW_PACKING
578 VBOX_DI_VBAPP_MISC_FILES += \
579 MacOS/VBoxEFI32.fd \
580 MacOS/VBoxEFI64.fd
581endif
582VBOX_DI_VBAPP_SYMLINKS =
583ifdef VBOX_WITH_QTGUI
584 VBOX_DI_VBAPP_DYLIBS += \
585 $(foreach qtmod, $(VBOX_QT_MOD_NAMES), Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/$(qtmod)) \
586 plugins/platforms/libqcocoa$(SUFF_DLL) \
587 plugins/platforms/libqminimal$(SUFF_DLL) \
588 plugins/platforms/libqoffscreen$(SUFF_DLL) \
589 plugins/sqldrivers/libqsqlite$(SUFF_DLL) \
590 plugins/styles/libqmacstyle$(SUFF_DLL)
591 VBOX_DI_VBAPP_MISC_FILES += \
592 $(foreach qtmod, $(VBOX_QT_MOD_NAMES), Frameworks/$(qtmod).framework/Versions/$(VBOX_QT_VERSION_MAJOR)/Resources/Info.plist)
593 VBOX_DI_VBAPP_SYMLINKS += \
594 Resources/vmstarter.app/Contents/MacOS=>../../../MacOS/ \
595 $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \
596 ,Frameworks/$(qtmod).framework/Versions/Current=>$(VBOX_QT_VERSION_MAJOR) )
597endif
598ifdef VBOX_WITH_PYTHON
599 # Python XPCOM glue
600 VBOX_DI_VBAPP_PYTHON_FILES = \
601 $(VBOXINST_SDK_BINDINGS_XPCOM_PYTHON_FILES) \
602 $(VBOXINST_SDK_INSTALLER_PYTHON_FILES)
603endif
604ifdef VBOX_WITH_INTNET_SERVICE_IN_R3
605 VBOX_DI_VBAPP_PROGS += \
606 XPCServices/org.virtualbox.intnet.xpc/Contents/MacOS/VBoxIntNetSwitch
607 VBOX_DI_VBAPP_MISC_FILES += \
608 XPCServices/org.virtualbox.intnet.xpc/Contents/Info.plist
609 ifdef VBOX_WITH_QTGUI
610 VBOX_DI_VBAPP_SYMLINKS += \
611 Resources/VirtualBoxVM.app/Contents/XPCServices=>../../../XPCServices
612 endif
613endif
614
615VBOX_VIRTUALBOX_APP_ENTITLEMENTS := $(PATH_ROOT)/src/VBox/HostDrivers/Support/darwin/SUPR3HardenedEntitlements.plist
616VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS := $(PATH_ROOT)/src/VBox/HostDrivers/Support/darwin/SUPR3HardenedEntitlementsVM.plist
617
618##
619# Add application and team ID into entitlement file
620# $(evalcall def_vbox_entitlement_add_app_and_team_id)
621# @param 1 Source entitlement file.
622# @param 2 Target entitlement file.
623# @param 3 Application ID.
624# @param 4 Team ID.
625define def_vbox_entitlement_add_app_and_team_id =
626 $(2): $(1) $$(VBOX_DARWIN_INST_DEP_ON_MAKEFILE) | $$$$(dir $$$$@)
627 $$(QUIET)$$(SED) \
628 -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>' \
629 --output $$@ $$<
630endef
631
632if defined(VBOX_WITH_MACOS_HARDENED_RUNTIME) && defined(VBOX_SIGNING_MODE) && defined(VBOX_PROVISIONPROFILE_TEAM_ID)
633 ifdef VBOX_VIRTUALBOX_APP_ID
634 VBOX_VIRTUALBOX_APP_ENTITLEMENTS := $(VBOX_PATH_PACK_TMP)/SUPR3HardenedEntitlements.plist
635 $(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))
636 endif
637
638 ifdef VBOX_VIRTUALBOXVM_APP_ID
639 VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS := $(VBOX_PATH_PACK_TMP)/SUPR3HardenedEntitlementsVM.plist
640 $(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))
641 endif
642endif
643
644# (The dependencies are including way too much here because I'm lazy.)
645$(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg: \
646 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES), \
647 $(VBOX_BRAND_$(f)_VIRTUALBOX_DESCRIPTION_PLIST)) \
648 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
649 $(VBOX_DI_VBAPP_OTHER_BINS) $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_PROGS_HARDENED) $(VBOX_DI_VBAPP_MISC_FILES) \
650 ,$(call VBOX_DI_FN_DEP_BOTH,VirtualBox.app/Contents/$(f)) ) \
651 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.x86) $(VBOX_DI_VBAPP_MISC_FILES.x86) \
652 ,$(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/$(f)) ) \
653 $(foreach f, $(VBOX_DI_VBAPP_DYLIBS.amd64) $(VBOX_DI_VBAPP_MISC_FILES.amd64) \
654 ,$(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/$(f)) ) \
655 \
656 $(if $(VBOX_WITH_DOCS_PACKING),$(VBOX_ADD_MANUALS),) \
657 $(VBOX_BRAND_LICENSE_TXT) \
658 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*) \
659 $(wildcard $(VBOX_PATH_DI_SRC)/VirtualBox/*.lproj/*) \
660 $$(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/,$(VBOX_INSTALL_LANG_FILES)) \
661 \
662 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/*) \
663 $(filter-out Disabled, $(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/*)) \
664 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*) \
665 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/*) \
666 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*) \
667 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/Resources/*.lproj/*) \
668 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/*) \
669 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*) \
670 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/vmstarter.app/Contents/Resources/*.lproj/*) \
671 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/Resources/*.lproj/*) \
672 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/*) \
673 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/additions/*) \
674 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/components/*) \
675 $$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/*) \
676 $(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UnattendedTemplates/, $(VBOX_UNATTENDED_TEMPLATES)) \
677 $(if-expr defined(VBOX_WITH_PYTHON), $(addprefix $(VBOX_PATH_DIST)/, $(VBOX_DI_VBAPP_PYTHON_FILES)),) \
678 $(if-expr defined(VBOX_WITH_JXPCOM), $(addprefix $(VBOX_PATH_DIST)/, sdk/bindings/xpcom/java/vboxjxpcom.jar),) \
679 $(if-expr defined(VBOX_PROVISIONPROFILE_TEAM_ID),$(VBOX_PATH_DI_SRC)/VirtualBox/$(VBOX_PROVISIONPROFILE_TEAM_ID).provisionprofile,) \
680 $(if $(VBOX_WITH_WEBSERVICES),$(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist,) \
681 $(if $(VBOX_WITH_FE_BALLOONCTRL),$(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxballoonctrl.plist) \
682 $(if $(VBOX_WITH_FE_AUTOSTART),$(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxautostart.plist) \
683 $(if $(VBOX_WITH_FE_AUTOSTART),$(VBOX_PATH_DI_SRC)/VirtualBox/VBoxAutostartDarwin.sh) \
684 $(if-expr defined(VBOX_WITH_DTRACE), \
685 $(foreach f, $(VBOXINST_DTRACE_LIB_ARCH_FILES), \
686 $(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/MacOS/dtrace/lib/x86/$f) \
687 $(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/MacOS/dtrace/lib/amd64/$f)) \
688 $(foreach f, $(VBOXINST_DTRACE_TESTCASE_ARCH_FILES), \
689 $(call VBOX_DI_FN_DEP_32,VirtualBox.app/Contents/MacOS/dtrace/testcase/x86/$f) \
690 $(call VBOX_DI_FN_DEP_64,VirtualBox.app/Contents/MacOS/dtrace/testcase/amd64/$f)) \
691 $(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES)) \
692 ,) \
693 $(if-expr defined(VBOX_WITH_MACOS_HARDENED_RUNTIME) && defined(VBOX_SIGNING_MODE), \
694 $(VBOX_VIRTUALBOX_APP_ENTITLEMENTS) $(VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS),) \
695 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
696 $(call MSG_TOOL,pkgbuild,,,$@)
697 @# Cleanup any previously failed attempts.
698 sudo rm -Rf \
699 $@ \
700 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
701 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
702 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
703 @# Correct directory permissions are important.
704 $(MKDIR) -p \
705 $(@D) \
706 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
707 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
708 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/English.lproj
709 $(MKDIR) -p -m 0775 \
710 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications
711 $(MKDIR) -p -m 0755 $(sort \
712 $(VBOX_PATH_VBOX_APP_TMP)/Contents \
713 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS \
714 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/components \
715 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/nls \
716 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/accessible \
717 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources \
718 $(if-expr defined(VBOX_WITH_QTGUI), \
719 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app \
720 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app/Contents \
721 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/vmstarter.app \
722 $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/vmstarter.app/Contents,) \
723 $(if-expr defined(VBOX_WITH_PYTHON), \
724 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk \
725 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/installer \
726 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/installer/vboxapi \
727 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/ \
728 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom \
729 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python \
730 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python/xpcom \
731 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/client \
732 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/python/xpcom/server,) \
733 $(if-expr defined(VBOX_WITH_JXPCOM), \
734 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/sdk/bindings/xpcom/java,) \
735 $(addprefix $(VBOX_PATH_VBOX_APP_TMP)/Contents/,$(dir \
736 $(VBOX_DI_VBAPP_DYLIBS) \
737 $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) \
738 $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
739 $(VBOX_DI_VBAPP_OTHER_BINS) \
740 $(VBOX_DI_VBAPP_PROGS) \
741 $(VBOX_DI_VBAPP_PROGS_HARDENED) \
742 $(VBOX_DI_VBAPP_MISC_FILES) \
743 $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
744 $(VBOX_DI_VBAPP_MISC_FILES.$(KBUILD_TARGET_ARCH)) \
745 ))\
746 )
747# Create the .lproj language directories
748 $(MKDIR) -p -m 0755 \
749 $(addprefix $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/,$(VBOX_INSTALL_LANG_LPROJ))
750# Install all supported language files
751 $(foreach f, $(VBOX_INSTALL_LANG_FILES) \
752 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/nls/$(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/nls/$(f)$(NLTAB))
753ifdef VBOX_PROVISIONPROFILE_TEAM_ID
754 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/$(VBOX_PROVISIONPROFILE_TEAM_ID).provisionprofile $(VBOX_PATH_VBOX_APP_TMP)/Contents/embedded.provisionprofile
755endif
756ifdef VBOX_WITH_WEBSERVICES
757 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxwebsrv.plist $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
758endif
759ifdef VBOX_WITH_FE_BALLOONCTRL
760 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxballoonctrl.plist $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
761endif
762ifdef VBOX_WITH_FE_AUTOSTART
763 $(INSTALL) -m 0644 $(VBOX_PATH_DI_SRC)/VirtualBox/org.virtualbox.vboxautostart.plist $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
764 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/VBoxAutostartDarwin.sh $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/
765endif
766# Install the python bridge stuff
767ifdef VBOX_WITH_PYTHON
768 $(foreach f,$(VBOX_DI_VBAPP_PYTHON_FILES) \
769 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/$(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/$(f)$(NLTAB) )
770 $(INSTALL) -m 0755 $(PATH_ROOT)/src/VBox/Frontends/VBoxShell/vboxshell.py $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS
771endif
772# Install the java bridge stuff
773ifdef VBOX_WITH_JXPCOM
774 $(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
775endif
776# Copy misc files.
777 $(foreach f,$(VBOX_DI_VBAPP_MISC_FILES) \
778 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(f)$(NLTAB) )
779 $(INSTALL) -m 644 $(VBOX_BRAND_LICENSE_TXT) $(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/LICENSE
780ifdef VBOX_WITH_DOCS_PACKING
781 $(foreach f,$(VBOX_ADD_MANUALS) \
782 ,$(INSTALL) -m 0644 $(f) $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/$(NLTAB))
783endif
784 @# Create symlinks.
785 $(foreach symlink,$(VBOX_DI_VBAPP_SYMLINKS) $(VBOX_DI_VBAPP_SYMLINKS.$(KBUILD_TARGET_ARCH)) \
786 ,$(LN) -s $(word 2,$(subst =>, ,$(symlink))) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(word 1,$(subst =>, ,$(symlink)))$(NLTAB))
787 @# Copy the dylibs.
788 $(foreach dylib, $(VBOX_DI_VBAPP_DYLIBS) $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
789 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(dylib) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(dylib)$(NLTAB))
790 @# Copy the other binaries.
791 $(foreach otherbin, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS) \
792 ,$(INSTALL) -m 0644 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(otherbin)$(NLTAB))
793 @# Create/copy the universal executable binaries.
794 $(foreach otherbin, $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
795 ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(otherbin) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(otherbin)$(NLTAB))
796 @# Copy the binaries.
797 $(foreach prog, $(VBOX_DI_VBAPP_PROGS) $(VBOX_DI_VBAPP_PROGS_HARDENED) \
798 ,$(INSTALL) -m 0755 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/$(prog) $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(prog)$(NLTAB))
799ifdef VBOX_UNATTENDED_TEMPLATES
800 # Unattended installation template scripts.
801 $(MKDIR) -p -m 0755 -- $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/UnattendedTemplates
802 $(foreach file, $(VBOX_UNATTENDED_TEMPLATES) \
803 ,$(INSTALL) -m 0655 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UnattendedTemplates/$(file) \
804 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/UnattendedTemplates/$(file)$(NLTAB))
805endif
806ifdef VBOX_WITH_DTRACE
807 # DTrace library, testcases and scripts.
808 $(MKDIR) -p -m 0755 -- \
809 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/lib/$(KBUILD_TARGET_ARCH)/ \
810 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/testcase/$(KBUILD_TARGET_ARCH)/ \
811 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/scripts/
812 $(foreach file, $(addprefix lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
813 $(addprefix testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
814 $(addprefix scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES)) \
815 ,$(INSTALL) -m 0655 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/dtrace/$(file) \
816 $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/$(file)$(NLTAB))
817endif
818ifndef VBOX_WITH_QTGUI
819 # Hack alert! Just something to make pkgbuild happy.
820 $(APPEND) -tn "$(VBOX_PATH_VBOX_APP_TMP)/Contents/PkgInfo" "APPLVBOX"
821 $(APPEND) -tn "$(VBOX_PATH_VBOX_APP_TMP)/Contents/Info.plist" \
822 '<?xml version="1.0" encoding="UTF-8"?>' \
823 '<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' \
824 '<plist version="1.0">' \
825 '<dict>' \
826 ' <key>CFBundlePackageType</key> <string>APPL</string>' \
827 ' <key>CFBundleSignature</key> <string>VBOX</string>' \
828 ' <key>CFBundleDevelopmentRegion</key> <string>English</string>' \
829 ' <key>CFBundleIdentifier</key> <string>org.virtualbox.app.VBoxManage</string>' \
830 ' <key>CFBundleName</key> <string>VirtualBox</string>' \
831 ' <key>CFBundleExecutable</key> <string>VBoxManage</string>' \
832 ' <key>CFBundleVersion</key> <string>$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)</string>' \
833 ' <key>CFBundleShortVersionString</key> <string>$(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)</string>' \
834 ' <key>CFBundleGetInfoString</key> <string>$(VBOX_PRODUCT) Manager $(VBOX_VERSION_STRING), © 2007-$(VBOX_C_YEAR) $(VBOX_VENDOR)</string>' \
835 ' <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string>' \
836 '</dict>' \
837 '</plist>'
838endif
839 @# Sign the binaries and the application bundle.
840ifdef VBOX_SIGNING_MODE
841 ifdef VBOX_WITH_QTGUI
842 $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \
843 ,$(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)) )
844 $(foreach qtmod, $(VBOX_QT_MOD_NAMES) \
845 ,$(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)) )
846 endif
847 $(foreach dylib, \
848 $(VBOX_DI_VBAPP_DYLIBS) \
849 $(VBOX_DI_VBAPP_DYLIBS.$(KBUILD_TARGET_ARCH)) \
850 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(dylib),org.virtualbox.app.macos.$(notdir $(dylib))) )
851 $(foreach bin, $(VBOX_DI_VBAPP_UNIVERSAL_PROGS) \
852 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin))) )
853 $(foreach other, $(VBOX_DI_VBAPP_OTHER_UNIVERSAL_BINS) $(VBOX_DI_VBAPP_OTHER_BINS)\
854 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(other),org.virtualbox.app.macos.$(notdir $(other))) )
855 $(foreach bin, $(filter-out MacOS/VirtualBox,$(VBOX_DI_VBAPP_PROGS) $(if-expr !defined(VBOX_WITH_MACOS_HARDENED_RUNTIME),$(VBOX_DI_VBAPP_PROGS_HARDENED),)) \
856 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin))) )
857 $(foreach file, $(if-expr defined(VBOX_WITH_WEBSERVICES),MacOS/org.virtualbox.vboxwebsrv.plist,) \
858 $(if-expr defined(VBOX_WITH_FE_BALLOONCTRL),MacOS/org.virtualbox.vboxballoonctrl.plist,) \
859 $(if-expr defined(VBOX_WITH_FE_AUTOSTART),MacOS/org.virtualbox.vboxautostart.plist,) \
860 $(if-expr defined(VBOX_WITH_FE_AUTOSTART),MacOS/VBoxAutostartDarwin.sh,) \
861 $(if-expr defined(VBOX_WITH_PYTHON),$(addprefix MacOS/, $(VBOX_DI_VBAPP_PYTHON_FILES) vboxshell.py),) \
862 $(if-expr defined(VBOX_WITH_JXPCOM),MacOS/sdk/bindings/xpcom/java/vboxjxpcom.jar,) \
863 $(filter MacOS/%,$(VBOX_DI_VBAPP_MISC_FILES)) \
864 $(if-expr defined(VBOX_WITH_DOCS_PACKING),$(addprefix MacOS/,$(VBOX_ADD_MANUALS)),) \
865 $(if-expr defined(VBOX_WITH_DTRACE),\
866 $(addprefix MacOS/dtrace/lib/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_LIB_ARCH_FILES)) \
867 $(addprefix MacOS/dtrace/testcase/$(KBUILD_TARGET_ARCH)/,$(VBOXINST_DTRACE_TESTCASE_ARCH_FILES)) \
868 $(addprefix MacOS/dtrace/scripts/,$(VBOXINST_DTRACE_SCRIPTS_FILES)) ,) \
869 $(addprefix MacOS/nls/,$(VBOX_INSTALL_LANG_FILES)) \
870 , $(NLTAB)$(call VBOX_SIGN_FILE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(file),org.virtualbox.app.$(tolower $(subst $(SP),,$(subst /,.,$(file))))) )
871
872 ifdef VBOX_PROVISIONPROFILE_TEAM_ID
873 # $(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
874 endif
875 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app,,$(if-expr defined(VBOX_WITH_MACOS_HARDENED_RUNTIME)\
876 ,--entitlements="$(VBOX_VIRTUALBOX_APP_ENTITLEMENTS)",))
877 ifdef VBOX_WITH_QTGUI
878 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/vmstarter.app,,)
879 endif
880 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP),,--deep)
881 ifdef VBOX_WITH_MACOS_HARDENED_RUNTIME # HACK ALERT! --deep fries the entitlements, so redo w/o --deep now.
882 $(foreach bin, $(filter-out MacOS/VirtualBoxVM MacOS/VBoxHeadless,$(VBOX_DI_VBAPP_PROGS_HARDENED)) \
883 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin)), \
884 --entitlements="$(VBOX_VIRTUALBOX_APP_ENTITLEMENTS)"))
885 $(foreach bin, $(filter MacOS/VirtualBoxVM MacOS/VBoxHeadless,$(VBOX_DI_VBAPP_PROGS_HARDENED)) \
886 , $(NLTAB)$(call VBOX_SIGN_MACHO_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin),org.virtualbox.app.macos.$(notdir $(bin)), \
887 --entitlements="$(VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS)"))
888 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP)/Contents/Resources/VirtualBoxVM.app,,\
889 --entitlements="$(VBOX_VIRTUALBOXVM_APP_ENTITLEMENTS)",)
890 $(call VBOX_SIGN_BUNDLE_FN,$(VBOX_PATH_VBOX_APP_TMP),,\
891 --entitlements="$(VBOX_VIRTUALBOX_APP_ENTITLEMENTS)",)
892 $(foreach bin, $(VBOX_DI_VBAPP_PROGS_HARDENED) \
893 , $(NLTAB)codesign -d -v -v -v --entitlements :- $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin) )
894 $(foreach bin, $(VBOX_DI_VBAPP_PROGS) \
895 , $(NLTAB)codesign -d -v -v -v --entitlements :- $(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin) )
896 endif
897endif
898 @# Set the correct owner and set the set-user-ID-on-execution bit on the relevant executables.
899 sudo chown -R root:admin $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
900 sudo chmod u+s $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/VBoxNetAdpCtl
901ifdef VBOX_WITH_HARDENING
902 sudo chmod u+s $(foreach bin,$(VBOX_DI_VBAPP_PROGS_HARDENED),$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(bin))
903endif
904if 0 # Handy for testing the app bundle w/o having to reinstall all the time (just untar it into -C /Applications/)
905 $(RM) -f -- "$(PATH_OUT)/VirtualBox.app.tar.gz"
906 tar -czf "$(PATH_OUT)/VirtualBox.app.tar.gz" -C "$(VBOX_PATH_VBOX_APP_TMP)/.." VirtualBox.app
907endif
908 @# Do keyword replacement in the package info and description files.
909 $(SED) \
910 -e 's+@VBOX_VERSION_STRING@+$(VBOX_VERSION_STRING)+g' \
911 -e 's+@VBOX_VERSION_MAJOR@+$(VBOX_VERSION_MAJOR)+g' \
912 -e 's+@VBOX_VERSION_MINOR@+$(VBOX_VERSION_MINOR)+g' \
913 -e 's+@VBOX_VERSION_BUILD@+$(VBOX_VERSION_BUILD)+g' \
914 -e 's+@VBOX_VENDOR@+$(VBOX_VENDOR)+g' \
915 -e 's+@VBOX_PRODUCT@+$(VBOX_PRODUCT)+g' \
916 -e 's+@VBOX_C_YEAR@+$(VBOX_C_YEAR)+g' \
917 --output $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/PkgBuildComponent.plist \
918 $(VBOX_PATH_DI_SRC)/VirtualBox/PkgBuildComponent.plist
919 @# Copy the resources.
920 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/preflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/
921ifdef VBOX_WITH_HARDENING
922 $(INSTALL) -m 0755 $(VBOX_PATH_DI_SRC)/VirtualBox/postflight $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/
923else
924 $(SED) -s '/WITH_HARDENING/d' -o $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/postflight $(VBOX_PATH_DI_SRC)/VirtualBox/postflight
925 $(CHMOD) 0755 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res/postflight
926endif
927 ls -lR $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/
928 @# Build the package.
929 $(VBOX_PKGBUILD) \
930 --root $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root/Applications/ \
931 --component-plist $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc/PkgBuildComponent.plist \
932 --script $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res \
933 --identifier org.virtualbox.pkg.virtualbox \
934 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
935 --install-location /Applications/ \
936 --ownership preserve \
937 --preserve-xattr \
938 $(if-expr defined(VBOX_MACOSX_INSTALLER_SIGN) && $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING)) == "",--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
939 $@
940ifdef VBOX_SIGNING_MODE
941 if $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
942 @# Sign the created pkg.
943 $(call VBOX_SIGN_PKG_FN,$@,org.virtualbox.pkg.virtualbox)
944 endif
945endif
946 @# Cleanup
947 sudo chown -R "$(shell whoami)" \
948 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
949 sudo chmod -R a-s \
950 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root
951 sudo rm -Rf \
952 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.root \
953 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.desc \
954 $(VBOX_PATH_PACK_TMP)/VirtualBox.pkg.res
955
956#
957# The VirtualBox CLI wrapper scripts.
958#
959$(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg: \
960 $$(wildcard \
961 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/* \
962 $(VBOX_PATH_DI_SRC)/VirtualBoxCLI/*.lproj/*) \
963 $(foreach f,$(VBOX_INSTALLER_ADD_LANGUAGES) \
964 ,$(VBOX_BRAND_$(f)_VIRTUALBOXCLI_DESCRIPTION_PLIST)) \
965 $(VBOX_DARWIN_INST_DEP_ON_MAKEFILE)
966 $(call MSG_TOOL,pkgbuild,,,$@)
967 @# Cleanup any previously failed attempts.
968 sudo rm -Rf \
969 $@ \
970 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
971 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
972 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
973 @# Correct directory permissions are important.
974 $(MKDIR) -p \
975 $(@D) \
976 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
977 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res \
978 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res/English.lproj
979 $(MKDIR) -p -m 0755 \
980 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr \
981 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin
982 @# Generate the wrapper scripts.
983 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VirtualBox \
984 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VirtualBox "$$@"'
985 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VirtualBoxVM \
986 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/Resources/VirtualBoxVM.app/Contents/MacOS/VirtualBoxVM "$$@"'
987 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxManage \
988 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxManage "$$@"'
989 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxVRDP \
990 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
991 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxHeadless \
992 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxHeadless "$$@"'
993ifdef VBOX_WITH_WEBSERVICES
994 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/vboxwebsrv \
995 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/vboxwebsrv "$$@"'
996endif
997if defined(VBOX_WITH_VBOX_IMG) || defined(VBOX_WITH_TESTCASES)
998 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/vbox-img \
999 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/vbox-img "$$@"'
1000endif
1001ifdef VBOX_WITH_VBOXIMGMOUNT
1002 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/vboximg-mount \
1003 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/vboximg-mount "$$@"'
1004endif
1005ifdef VBOX_WITH_FE_BUGREPORT
1006 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxBugReport \
1007 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxBugReport "$$@"'
1008endif
1009ifdef VBOX_WITH_FE_BALLOONCTRL
1010 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxBalloonCtrl \
1011 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxBalloonCtrl "$$@"'
1012endif
1013ifdef VBOX_WITH_FE_AUTOSTART
1014 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxAutostart \
1015 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxAutostart "$$@"'
1016endif
1017ifdef VBOX_WITH_DTRACE
1018 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxDTrace \
1019 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxDTrace "$$@"'
1020endif
1021ifdef VBOX_WITH_HOST_SHIPPING_AUDIO_TEST
1022 $(APPEND) -tn $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/VBoxAudioTest \
1023 '#!/bin/bash' 'exec /Applications/VirtualBox.app/Contents/MacOS/VBoxAudioTest "$$@"'
1024endif
1025 @# Set the correct owners and file permissions.
1026 sudo chmod 0755 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin/*
1027 sudo chown root:admin $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root
1028 sudo chown -R root:wheel $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr
1029 @# Build the package.
1030 $(VBOX_PKGBUILD) \
1031 --root $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root/usr/local/bin \
1032 --identifier org.virtualbox.pkg.virtualboxcli \
1033 --version $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD) \
1034 --install-location /usr/local/bin \
1035 --ownership preserve \
1036 $(if-expr defined(VBOX_MACOSX_INSTALLER_SIGN) && $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING)) == "",--sign "$(VBOX_MACOSX_INSTALLER_SIGN)",) \
1037 $@
1038ifdef VBOX_SIGNING_MODE
1039 if $(intersects darwin all 1,$(VBOX_WITH_CORP_CODE_SIGNING))
1040 @# Sign the created pkg.
1041 $(call VBOX_SIGN_PKG_FN,$@,org.virtualbox.pkg.virtualboxcli)
1042 endif
1043endif
1044 @# Cleanup
1045 sudo chown -R "$(shell whoami)" \
1046 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root
1047 sudo rm -Rf \
1048 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.root \
1049 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.desc \
1050 $(VBOX_PATH_PACK_TMP)/VirtualBoxCLI.pkg.res
1051
1052ifdef VBOX_WITH_FUSE_PACKING
1053 #
1054 # The FUSE for macOS core package.
1055 #
1056 VBOX_PATH_FUSE_CORE_PKG ?= $(lastword $(sort $(wildcard $(KBUILD_DEVTOOLS_TRG)/osxfuse/v*)))/Core.pkg
1057 $(VBOX_PATH_PACK_TMP)/Packages/OSXFuseCore.pkg: \
1058 $(VBOX_PATH_FUSE_CORE_PKG)
1059 $(call MSG_TOOL,Preparing FUSE for macOS core package,,,$@)
1060 @# Cleanup any previously failed attempts.
1061 sudo rm -Rf $@
1062 $(MKDIR) -p $(@D)
1063 pkgutil --flatten $(VBOX_PATH_FUSE_CORE_PKG) $@
1064endif
1065
1066
1067#
1068# Aliases.
1069#
1070VBoxKEXTs.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VBoxKEXTs.pkg
1071VirtualBoxCLI.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VirtualBoxCLI.pkg
1072VirtualBox.pkg: $(VBOX_PATH_PACK_TMP)/Packages/VirtualBox.pkg
1073VirtualBox.mpkg: $(VBOX_PATH_PACK_TMP)/DiskImage/VirtualBox.pkg
1074VirtualBox.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