VirtualBox

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

Last change on this file since 88725 was 88316, checked in by vboxsync, 4 years ago

Makefile.kmk, Installer/darwin: bugref:9532: macOS: Missed qsqlite plugin.

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