source: trunk/dports/fuse/osxfuse/Portfile

Last change on this file was 154308, checked in by dports@…, 13 months ago

osxfuse: update to v3.5.3

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 7.0 KB
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 154308 2016-10-27 01:52:09Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                osxfuse
7version             3.5.3
8set branch          [join [lrange [split ${version} .] 0 1] .]
9categories          fuse devel
10platforms           macosx
11license             BSD APSL
12maintainers         dports openmaintainer
13
14description         A FUSE-Compliant File System Implementation Mechanism \
15                    for Mac OS X
16long_description    FUSE for OS X implements a mechanism that makes it possible to implement \
17                    a fully functional file system in a user-space program on Mac OS X. It \
18                    aims to be API-compliant with the FUSE (File-system in USErspace) \
19                    mechanism that originated on Linux.  Therefore, many existing FUSE file \
20                    systems become readily usable on Mac OS X. This port provides the \
21                    user-space library and header files for building filesystems.
22
23homepage            http://osxfuse.github.io/
24
25livecheck.type      regex
26livecheck.url       ${homepage}
27livecheck.regex     "FUSE for macOS (\\d+(?:\\.\\d+)*)"
28
29# Use the published signed kext for OS 10.9 (Darwin 13) and later.
30# Don't even fetch and extract the dmg unnecessarily, since the commands don't
31# work on some earlier OS versions.
32if {${os.major} >= 13} {
33    set use_signed_kext    yes
34} else {
35    set use_signed_kext    no
36}
37
38# We will build user-space components for the specified arch, and
39# kernel modules for the kernel arch.
40set kernel_arch [exec uname -m]
41# If building for different kernel arch than our buildslaves use, force a build
42# from source. The binary package IDs don't encode the kernel arch.
43if {${kernel_arch} ne "x86_64"} {
44    archive_sites
45}
46
47distfiles
48set mp.dist {
49    osxfuse     4edf75f
50    kext        bad3919
51    framework   ae7d4de
52    prefpane    3481385
53    fuse        8c1ba89
54    support     e965716
55}
56
57depends_build       port:autoconf \
58                    port:automake \
59                    port:libtool
60
61set mp.osxfuse_rev  [lindex ${mp.dist} [expr [lsearch ${mp.dist} osxfuse] + 1]]
62worksrcdir          osxfuse-osxfuse-${mp.osxfuse_rev}
63
64foreach { mp.comp mp.rev } ${mp.dist} {
65    set f ${mp.comp}-${mp.rev}.tar.gz
66    master_sites-append https://github.com/osxfuse/${mp.comp}/tarball/${mp.rev}/:${mp.comp}
67    distfiles-append    ${f}:${mp.comp}
68}
69
70if { $use_signed_kext } {
71    master_sites-append https://github.com/osxfuse/osxfuse/releases/download/osxfuse-${version}
72    distfiles-append ${name}-${version}.dmg
73}
74
75checksums           osxfuse-4edf75f.tar.gz \
76                    rmd160  75d643a7f7aba9d8e5a6ca4f392d11c205004c74 \
77                    sha256  cd3cddd8d89315badd378c6b8b74e0151cb8d9a5f00815e00e83d80d9e241ecf \
78                    kext-bad3919.tar.gz \
79                    rmd160  cddaa500ab06a8933d6bed6626dac2b626ffbaa7 \
80                    sha256  2b870c2fc724c6aed684316d462c11ec95e28d7a6a3a3a18f91ce6afa2f70ded \
81                    framework-ae7d4de.tar.gz \
82                    rmd160  d0dc45d512cdb03987d2a8a90c7aba3a980145bc \
83                    sha256  0616b96fd63e9bdb522b6a3717296ff9bf7132f67bb2467f4fc028f5af3056b7 \
84                    prefpane-3481385.tar.gz \
85                    rmd160  fa8450c70b0ec4fae129973de3f44e56f946413b \
86                    sha256  202154e170d84ec7721619b9d95c9e5449b1c3e65c21547783e59a1424289554 \
87                    fuse-8c1ba89.tar.gz \
88                    rmd160  8034000932e831f8496ae97e583940d9bf80e0f4 \
89                    sha256  2975de98a615d184ba8c0bc98f88fd9f8509d51814e50d3f36a22554e856e9f5 \
90                    support-e965716.tar.gz \
91                    rmd160  32c5416675fff62fa09119a7ccd465fc00872055 \
92                    sha256  1676891805fb82fdd4b1385b6812cb067d6ad0df71caffc13319234d5bc65c43 \
93                    osxfuse-3.5.3.dmg \
94                    rmd160  2164b12e35c68d392c62eee88ff4945973e53308 \
95                    sha256  9d48cbfe360bead9e9fd31bc95e18a90f03be7c4be5b5c62acd7df98c8c0c80b
96
97# extract phase will just extract the dmg; post-extract will expand
98# the tarballs
99if { $use_signed_kext } {
100    use_dmg yes
101    extract.only ${name}-${version}.dmg
102}
103
104post-extract {
105    # Extract the pkg and the appropriate payload from the binary dmg
106    if { $use_signed_kext } {
107        system -W ${workpath}/${name}-${version} "pkgutil --expand 'FUSE for macOS.pkg' ${workpath}/pkg"
108        system -W ${workpath}/pkg/Core.pkg "gzip -dc Payload | cpio -id"
109    }
110
111    # Extract the source tarballs
112    foreach { mp.comp mp.rev } ${mp.dist} {
113        if { $use_signed_kext } {
114            system -W ${workpath} "tar -xvf ${distpath}/${mp.comp}-${mp.rev}.tar.gz"
115        }
116        if {${mp.comp} ne "osxfuse"} {
117            # Replace existing empty directory if it exists
118            file delete ${workpath}/${worksrcdir}/${mp.comp}
119            move ${workpath}/osxfuse-${mp.comp}-${mp.rev} ${workpath}/${worksrcdir}/${mp.comp}
120        }
121    }
122}
123
124use_configure   no
125
126build.cmd       ./build.sh -t packagemanager
127build.target    -a build
128build.args      -v 5 \
129                --build-directory="${workpath}" -- \
130                -a [join [get_canonical_archs] " -a "] \
131                --framework-prefix="${prefix}" \
132                --fsbundle-prefix="${prefix}" \
133                --library-prefix="${prefix}" 
134
135# Clear CPATH and LIBRARY_PATH because a ncurses include file
136# conflicts with the one in MacPorts. It doesn't matter much anyway
137# because osxfuse doesn't have any dependencies to link against.
138compiler.cpath
139compiler.library_path
140
141destroot.target -a install
142destroot.args   -v 5 --build-directory="${workpath}"
143destroot.destdir -- "${destroot}${prefix}"
144
145# Move filesystem bundle into place
146post-destroot {
147    # Set proper permissions
148    fs-traverse f ${destroot}${prefix}/Library {
149        file attributes $f -owner root -group wheel
150    }
151    # Enable setuid on helper binary
152    file attributes ${destroot}${prefix}/Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse -permissions 04755
153}
154
155
156# On Mavericks and Yosemite, replace the kext we just built with the
157# one from the binary distribution. This works around OS X's
158# unwillingness to load an unsigned kext (and our inability to sign
159# kexts). See #45521.
160#
161# Unlike newer versions, Mavericks does not require the kext to be
162# signed, but will display a warning if it's unsigned -- so use the
163# signed binary instead here too.
164if { $use_signed_kext } {
165    post-destroot {
166        delete ${destroot}${prefix}/Library/Filesystems/osxfuse.fs/Contents/Extensions
167        file copy ${workpath}/pkg/Core.pkg/Library/Filesystems/osxfuse.fs/Contents/Extensions \
168            ${destroot}${prefix}/Library/Filesystems/osxfuse.fs/Contents
169    }
170}
171
172destroot.violate_mtree yes
173
174notes {
175    When upgrading, unmount all FUSE filesystems and then unload the kernel extension.
176    Unloading can be done via: sudo kextunload -b com.github.osxfuse.filesystems.osxfuse
177    Alternatively (or if this fails), just reboot your computer now.
178}
179
180# Could probably be supported by setting ARCHS correctly above
181universal_variant no
Note: See TracBrowser for help on using the repository browser.