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-OSE |
---|
8 | version 4.0.10 |
---|
9 | categories emulators |
---|
10 | maintainers nomaintainer |
---|
11 | description open source virtualization technology from Oracle |
---|
12 | long_description VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for \ |
---|
13 | enterprise as well as home use. Not only is VirtualBox an extremely \ |
---|
14 | feature rich, high performance product for enterprise customers, it is \ |
---|
15 | also the only professional solution that is freely available as Open \ |
---|
16 | Source Software. |
---|
17 | license GPL-2 |
---|
18 | homepage http://www.virtualbox.org/ |
---|
19 | supported_archs i386 x86_64 |
---|
20 | universal_variant no |
---|
21 | platforms darwin |
---|
22 | |
---|
23 | master_sites http://download.virtualbox.org/virtualbox/${version}/ |
---|
24 | distname VirtualBox-${version} |
---|
25 | use_bzip2 yes |
---|
26 | |
---|
27 | checksums sha1 eeb01e1cd814778f35abbd0b39ef725edbffb386 \ |
---|
28 | rmd160 125aaea11ece10b5270f96795efcbc5190f538bb |
---|
29 | |
---|
30 | depends_lib-append port:libidl \ |
---|
31 | path:lib/pkgconfig/libxml-2.0.pc:libxml2 \ |
---|
32 | path:lib/pkgconfig/libxslt.pc:libxslt \ |
---|
33 | path:lib/pkgconfig/openssl.pc:openssl \ |
---|
34 | path:lib/pkgconfig/sdl.pc:libsdl \ |
---|
35 | port:py26-curl |
---|
36 | |
---|
37 | depends_build-append \ |
---|
38 | port:doxygen \ |
---|
39 | port:texlive |
---|
40 | |
---|
41 | patchfiles patch-build.diff \ |
---|
42 | patch-configure.diff \ |
---|
43 | patch-startup.diff |
---|
44 | |
---|
45 | # This is the open source edition of VirtualBox. |
---|
46 | worksrcdir VirtualBox-${version}_OSE |
---|
47 | |
---|
48 | set kext_dir /Library/Extensions |
---|
49 | set startup_items_dir /Library/StartupItems |
---|
50 | |
---|
51 | if {[variant_isset universal]} { |
---|
52 | set archflags ${configure.universal_cflags} |
---|
53 | } else { |
---|
54 | set archflags ${configure.cc_archflags} |
---|
55 | } |
---|
56 | |
---|
57 | post-patch { |
---|
58 | reinplace "s|@KEXT_DIR@|${prefix}${kext_dir}|g" \ |
---|
59 | ${worksrcpath}/src/VBox/Installer/darwin/VBoxStartupItems/VirtualBox/VirtualBox |
---|
60 | reinplace "s|@CONFIGURE\\.CC@|${configure.cc}|g" \ |
---|
61 | ${worksrcpath}/configure |
---|
62 | reinplace "s|@CONFIGURE\\.CXX@|${configure.cxx}|g" \ |
---|
63 | ${worksrcpath}/configure |
---|
64 | |
---|
65 | if {[variant_isset vde2]} { |
---|
66 | reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/include/VBox/VDEPlugSymDefs.h |
---|
67 | } |
---|
68 | } |
---|
69 | |
---|
70 | configure.args --disable-hardening \ |
---|
71 | --with-qt-dir=${prefix} \ |
---|
72 | --with-openssl-dir=${prefix} |
---|
73 | |
---|
74 | configure.pre_args-delete \ |
---|
75 | --prefix=${prefix} |
---|
76 | |
---|
77 | configure.universal_args-delete \ |
---|
78 | --disable-dependency-tracking |
---|
79 | |
---|
80 | build.env-append CC=${configure.cc} \ |
---|
81 | CXX=${configure.cxx} \ |
---|
82 | CFLAGS="${configure.cflags} ${archflags}" \ |
---|
83 | CXXFLAGS="${configure.cxxflags} ${archflags}" \ |
---|
84 | LDFLAGS="[join ${configure.ldflags}] ${archflags}" |
---|
85 | |
---|
86 | # VirtualBox uses kBuild. |
---|
87 | build.cmd ". env.sh && kmk" |
---|
88 | |
---|
89 | destroot { |
---|
90 | |
---|
91 | set release_dir [lindex [glob -- ${worksrcpath}/out/darwin.*/release/dist] 0] |
---|
92 | |
---|
93 | xinstall -m 755 -d ${destroot}${applications_dir} |
---|
94 | copy ${release_dir}/VirtualBox.app ${destroot}${applications_dir} |
---|
95 | |
---|
96 | # Set the owner and group to root:wheel, which is required for kernel extensions and possibly startup items. |
---|
97 | |
---|
98 | xinstall -m 755 -o root -g wheel -d ${destroot}${prefix}${kext_dir} |
---|
99 | |
---|
100 | foreach kext [glob -- ${release_dir}/*.kext] { |
---|
101 | copy ${kext} ${destroot}${prefix}${kext_dir} |
---|
102 | } |
---|
103 | |
---|
104 | xinstall -m 755 -o root -g wheel -d ${destroot}${prefix}${startup_items_dir} |
---|
105 | copy ${worksrcpath}/src/VBox/Installer/darwin/VBoxStartupItems/VirtualBox ${destroot}${prefix}${startup_items_dir} |
---|
106 | |
---|
107 | # Create proxies for binaries bundled with VirtualBox.app. |
---|
108 | |
---|
109 | foreach app_proxy [list VirtualBox VBoxManage VBoxHeadless] { |
---|
110 | |
---|
111 | set app_proxy_file [open ${destroot}${prefix}/bin/${app_proxy} w] |
---|
112 | |
---|
113 | puts $app_proxy_file "#!/usr/bin/env bash" |
---|
114 | puts $app_proxy_file "exec -- ${applications_dir}/VirtualBox.app/Contents/MacOS/${app_proxy} \"\$@\"" |
---|
115 | |
---|
116 | close $app_proxy_file |
---|
117 | |
---|
118 | file attributes ${destroot}${prefix}/bin/${app_proxy} -permissions "+x" |
---|
119 | } |
---|
120 | } |
---|
121 | |
---|
122 | pre-deactivate { |
---|
123 | system "${prefix}${startup_items_dir}/VirtualBox/VirtualBox stop" |
---|
124 | } |
---|
125 | |
---|
126 | variant vde2 description {Enable support for VDE} { |
---|
127 | depends_lib-append port:vde2 |
---|
128 | patchfiles-append patch-vde.diff |
---|
129 | configure.args-append --enable-vde |
---|
130 | } |
---|
131 | |
---|
132 | variant universal description {Build for multiple architectures} { |
---|
133 | } |
---|
134 | |
---|
135 | default_variants +vde2 |
---|
136 | |
---|
137 | startupitem.create yes |
---|
138 | startupitem.name VirtualBox |
---|
139 | startupitem.start "${prefix}${startup_items_dir}/VirtualBox/VirtualBox start" |
---|
140 | startupitem.stop "${prefix}${startup_items_dir}/VirtualBox/VirtualBox stop" |
---|
141 | startupitem.restart "${prefix}${startup_items_dir}/VirtualBox/VirtualBox restart" |
---|
142 | startupitem.pidfile none |
---|
143 | |
---|
144 | livecheck.type regex |
---|
145 | livecheck.url ${homepage} |
---|
146 | livecheck.regex "VirtualBox (\\d+\\.\\d+(\\.\\d+)?) released!" |
---|