VirtualBox

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

Last change on this file since 105374 was 105374, checked in by vboxsync, 4 months ago

Installer/darwin: Make sure to delete any old shadow storage for the disk image to prevent mounting the newly build disk image due to a mismatch. Logging nit. bugref:10724

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

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