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