1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 |
---|
2 | # $Id$ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup qt4 1.0 |
---|
6 | |
---|
7 | name virtualbox |
---|
8 | version 4.1.2 |
---|
9 | categories emulators |
---|
10 | maintainers nomaintainer |
---|
11 | description open source virtualization technology from Oracle |
---|
12 | long_description \ |
---|
13 | VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for \ |
---|
14 | enterprise as well as home use. Not only is VirtualBox an extremely \ |
---|
15 | feature rich, high performance product for enterprise customers, it is \ |
---|
16 | also the only professional solution that is freely available as Open \ |
---|
17 | Source Software. |
---|
18 | license GPL-2 |
---|
19 | homepage http://www.virtualbox.org/ |
---|
20 | supported_archs i386 x86_64 |
---|
21 | universal_variant no |
---|
22 | platforms darwin |
---|
23 | |
---|
24 | master_sites http://download.virtualbox.org/virtualbox/${version}/ |
---|
25 | distname VirtualBox-${version} |
---|
26 | use_bzip2 yes |
---|
27 | |
---|
28 | checksums md5 945d2c94c15a4f47280be4b01b67e244 \ |
---|
29 | sha1 52e35e0400fb12a5277a6e126478bb8f53c3e46d \ |
---|
30 | rmd160 0004a00c968ee835083416022240e212903f394d |
---|
31 | |
---|
32 | depends_lib-append port:libidl \ |
---|
33 | path:lib/pkgconfig/libxml-2.0.pc:libxml2 \ |
---|
34 | path:lib/pkgconfig/libxslt.pc:libxslt \ |
---|
35 | path:lib/pkgconfig/openssl.pc:openssl \ |
---|
36 | path:lib/pkgconfig/sdl.pc:libsdl |
---|
37 | |
---|
38 | patchfiles patch-build.diff \ |
---|
39 | patch-startup.diff |
---|
40 | |
---|
41 | configure.pre_args-delete --prefix=${prefix} |
---|
42 | |
---|
43 | configure.args --disable-hardening \ |
---|
44 | --with-qt-dir=${prefix} \ |
---|
45 | --with-openssl-dir=${prefix} |
---|
46 | |
---|
47 | # VirtualBox uses kBuild. |
---|
48 | build.cmd ". env.sh && kmk" |
---|
49 | |
---|
50 | # This is the open source edition of VirtualBox. |
---|
51 | worksrcdir VirtualBox-${version}_OSE |
---|
52 | |
---|
53 | set kext_dir /Library/Extensions |
---|
54 | set startup_items_dir /Library/StartupItems |
---|
55 | |
---|
56 | post-patch { |
---|
57 | |
---|
58 | reinplace "s|@CONFIGURE\\.CC@|${configure.cc}|g" \ |
---|
59 | ${worksrcpath}/configure |
---|
60 | reinplace "s|@CONFIGURE\\.CXX@|${configure.cxx}|g" \ |
---|
61 | ${worksrcpath}/configure |
---|
62 | reinplace "s|@KEXT_DIR@|${prefix}${kext_dir}|g" \ |
---|
63 | ${worksrcpath}/src/VBox/Installer/darwin/VBoxStartupItems/VirtualBox/VirtualBox |
---|
64 | |
---|
65 | if {[variant_isset vde2]} { |
---|
66 | reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/include/VBox/VDEPlugSymDefs.h |
---|
67 | } |
---|
68 | } |
---|
69 | |
---|
70 | destroot { |
---|
71 | |
---|
72 | set release_dir [lindex [glob -- ${worksrcpath}/out/darwin.*/release/dist] 0] |
---|
73 | |
---|
74 | xinstall -m 755 -d ${destroot}${applications_dir} |
---|
75 | copy ${release_dir}/VirtualBox.app ${destroot}${applications_dir} |
---|
76 | |
---|
77 | # Set the owner and group to root:wheel, which is required for kernel extensions and possibly startup items. |
---|
78 | |
---|
79 | xinstall -m 755 -o root -g wheel -d ${destroot}${prefix}${kext_dir} |
---|
80 | |
---|
81 | foreach kext [glob -- ${release_dir}/*.kext] { |
---|
82 | copy ${kext} ${destroot}${prefix}${kext_dir} |
---|
83 | } |
---|
84 | |
---|
85 | xinstall -m 755 -o root -g wheel -d ${destroot}${prefix}${startup_items_dir} |
---|
86 | copy ${worksrcpath}/src/VBox/Installer/darwin/VBoxStartupItems/VirtualBox ${destroot}${prefix}${startup_items_dir} |
---|
87 | |
---|
88 | # Create proxies for binaries bundled with VirtualBox.app. |
---|
89 | |
---|
90 | foreach app_proxy [list VirtualBox VBoxManage VBoxHeadless] { |
---|
91 | |
---|
92 | set app_proxy_file [open ${destroot}${prefix}/bin/${app_proxy} w] |
---|
93 | |
---|
94 | puts $app_proxy_file "#!/usr/bin/env bash" |
---|
95 | puts $app_proxy_file "exec -- ${applications_dir}/VirtualBox.app/Contents/MacOS/${app_proxy} \"\$@\"" |
---|
96 | |
---|
97 | close $app_proxy_file |
---|
98 | |
---|
99 | file attributes ${destroot}${prefix}/bin/${app_proxy} -permissions "+x" |
---|
100 | } |
---|
101 | } |
---|
102 | |
---|
103 | variant vde2 description {Enable support for VDE} { |
---|
104 | |
---|
105 | depends_lib-append port:vde2 |
---|
106 | patchfiles-append patch-vde.diff |
---|
107 | configure.args-append --enable-vde |
---|
108 | } |
---|
109 | |
---|
110 | default_variants +vde2 |
---|
111 | |
---|
112 | startupitem.create yes |
---|
113 | startupitem.name VirtualBox |
---|
114 | startupitem.start "${prefix}${startup_items_dir}/VirtualBox/VirtualBox start" |
---|
115 | startupitem.stop "${prefix}${startup_items_dir}/VirtualBox/VirtualBox stop" |
---|
116 | startupitem.restart "${prefix}${startup_items_dir}/VirtualBox/VirtualBox restart" |
---|
117 | startupitem.pidfile none |
---|
118 | |
---|
119 | livecheck.type regex |
---|
120 | |
---|
121 | if {[lindex [split ${version} .] 2] == 0} { |
---|
122 | livecheck.version [join [lrange [split ${version} .] 0 1] .] |
---|
123 | } |
---|
124 | |
---|
125 | livecheck.url ${homepage} |
---|
126 | livecheck.regex "VirtualBox (\\d+\\.\\d+(?:\\.\\d+)?) released!" |
---|