Ticket #31180: Portfile

File Portfile, 2.6 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: Portfile 83173 2011-08-27 05:35:20Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                virtualbox-oracle-vm-virtualbox-extension-pack
7version             4.1.2
8categories          emulators
9maintainers         pixilla openmaintainer
10platforms           darwin
11description         Oracle VM VirtualBox Extension Pack
12long_description    ${description}
13license             PUEL
14
15homepage            http://www.virtualbox.org/
16master_sites        http://download.virtualbox.org/virtualbox/${version}/
17
18supported_archs     i386
19depends_run         port:virtualbox
20
21distname            Oracle_VM_VirtualBox_Extension_Pack-${version}-73507
22set name_extpack    Oracle_VM_VirtualBox_Extension_Pack
23checksums           rmd160  398b7267e3c7c4fd4d26a19066dd830d1b29456b \
24                    sha256  3bc5ad8d7082b6debeec24c40a86629bf0ad6313343532d0ad0fee4131e8f9fc
25
26worksrcdir          ${name}/${name_extpack}
27extract.suffix      .vbox-extpack
28extract.mkdir       yes
29
30use_configure       no
31
32set my_app_dir VirtualBox.app
33set my_lib_dir ${my_app_dir}/Contents/MacOS
34set my_ext_dir ${my_app_dir}/Contents/MacOS/ExtensionPacks
35build {
36    # The pre-built libraries use weird prefixes and Oracle recommends setting
37    # DYLD_LIBRARY_PATH to deal with this. I would rather fix the paths in the
38    # libraries at install time.
39    foreach {my_arch} {x86 amd64} {
40        foreach lib [glob -directory ${worksrcpath}/darwin.${my_arch} *.dylib*] {
41            system "install_name_tool -id ${applications_dir}/${my_ext_dir}/${name_extpack}/[strsed ${lib} /^.*\\///] ${lib}"
42           
43            # Then for each dependent dylib with a weird path that this dylib
44            # references, fix the reference to use ${lib_dir}.
45            foreach dep [exec otool -L ${lib}] {
46                if [string match "/Applications/${my_lib_dir}/*" ${dep}] {
47                    system "install_name_tool -change ${dep} ${applications_dir}/${my_lib_dir}/[strsed ${dep} /^.*\\///] ${lib}"
48                }
49            }
50        }
51    }
52}
53
54destroot {
55    xinstall -d -o root -g admin -m 755 ${destroot}${applications_dir}/${my_ext_dir}
56    copy ${worksrcpath} ${destroot}${applications_dir}/${my_ext_dir}
57    fs-traverse f ${destroot}${applications_dir} {
58        file attributes ${f} -owner "root" -group "admin"
59    }
60}
61
62livecheck.type      regex
63livecheck.url       ${homepage}
64livecheck.regex     "VirtualBox (\\d+\\.\\d+(?:\\.\\d+)?) released!"
65#http://download.virtualbox.org/virtualbox/4.1.2/Oracle_VM_VirtualBox_Extension_Pack-4.1.2-73507.vbox-extpack