Ticket #28469: pixilla-Portfile

File pixilla-Portfile, 5.1 KB (added by pixilla (Bradley Giesbrecht), 13 years ago)
Line 
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
4PortSystem          1.0
5PortGroup           qt4 1.0
6
7name                VirtualBox-OSE
8version             4.0.10
9categories          emulators
10maintainers         nomaintainer
11description         open source virtualization technology from Oracle
12long_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.
17license             GPL-2
18homepage            http://www.virtualbox.org/
19supported_archs     i386 x86_64
20universal_variant   no
21platforms           darwin
22
23master_sites        http://download.virtualbox.org/virtualbox/${version}/
24distname            VirtualBox-${version}
25use_bzip2           yes
26
27checksums           sha1    eeb01e1cd814778f35abbd0b39ef725edbffb386 \
28                    rmd160  125aaea11ece10b5270f96795efcbc5190f538bb
29
30depends_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
37depends_build-append \
38                    port:doxygen \
39                    port:texlive
40
41patchfiles          patch-build.diff \
42                    patch-configure.diff \
43                    patch-startup.diff
44
45# This is the open source edition of VirtualBox.
46worksrcdir          VirtualBox-${version}_OSE
47
48set kext_dir /Library/Extensions
49set startup_items_dir /Library/StartupItems
50
51if {[variant_isset universal]} {
52    set archflags ${configure.universal_cflags}
53} else {
54    set archflags ${configure.cc_archflags}
55}
56
57post-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
70configure.args      --disable-hardening \
71                    --with-qt-dir=${prefix} \
72                    --with-openssl-dir=${prefix}
73
74configure.pre_args-delete \
75                    --prefix=${prefix}
76
77configure.universal_args-delete \
78                    --disable-dependency-tracking
79
80build.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.
87build.cmd               ". env.sh && kmk"
88
89destroot {
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
122pre-deactivate {
123    system "${prefix}${startup_items_dir}/VirtualBox/VirtualBox stop"
124}
125
126variant 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
132variant universal description {Build for multiple architectures} {
133}
134
135default_variants    +vde2
136
137startupitem.create  yes
138startupitem.name    VirtualBox
139startupitem.start   "${prefix}${startup_items_dir}/VirtualBox/VirtualBox start"
140startupitem.stop    "${prefix}${startup_items_dir}/VirtualBox/VirtualBox stop"
141startupitem.restart "${prefix}${startup_items_dir}/VirtualBox/VirtualBox restart"
142startupitem.pidfile none
143
144livecheck.type      regex
145livecheck.url       ${homepage}
146livecheck.regex     "VirtualBox (\\d+\\.\\d+(\\.\\d+)?) released!"