source: trunk/dports/fuse/osxfuse/Portfile @ 125929

Last change on this file since 125929 was 125929, checked in by cal@…, 5 years ago

osxfuse: fix livecheck, somewhat related to #45211, openmaintainer

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.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 125929 2014-09-29 20:50:54Z cal@macports.org $
3
4PortSystem          1.0
5
6name                osxfuse
7version             2.6.4
8revision            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     "[quotemeta [string toupper ${name}]] (\\d+(?:\\.\\d+)*)"
28
29# We will build user-space components for the specified arch, and
30# kernel modules for the kernel arch.
31set kernel_arch [exec uname -m]
32# If building for different kernel arch than our buildslaves use, force a build
33# from source. The binary package IDs don't encode the kernel arch.
34if {${kernel_arch} ne "x86_64"} {
35    archive_sites
36}
37
38distfiles
39set mp.dist {
40    osxfuse     7b0d8d3   {rmd160 05a8896c7cd738966da1f3f18e8a17723b140dff sha256 bba529834f61fe79be00b4a6298f40a86dd8170f91979c4eeaf9378a1ce067cd}
41    kext        c59029c   {rmd160 a19f4d8b0f4a4660b614e1716f21db749677444c sha256 77205fce0f289c3473d3621ca612cb33d86ebf4ea932712661c9527f91013bae}
42    framework   9fdde8a   {rmd160 4124b3e9c396ee41dfce35d480caff41936b8000 sha256 9dd705e05de0b346000853c08c143a15d73673684afcc9bbcf55e6c71b33fb87}
43    prefpane    8c3ea24   {rmd160 08376d5848025074b4a4feee3d5ed99bc456dfeb sha256 a6a4c5397d7faf9a3f068ddf409e8afc19292a03db0b094bbd144d5c64757118}
44    fuse        98b9960   {rmd160 589cbe0c819caded56dc4be64727580e1400fd9e sha256 f60205e19c2971228b78d180dc65cda2a6271a567229acdeb19567fcbcebb641}
45    support     1213520   {rmd160 1f774cd0d5273c02716a533463c1d374c793dfc1 sha256 57ccf15e451c132874664c00990c2df12d0dced32ba2cfe6bc6c1be863b663a9}
46}
47
48depends_build       port:autoconf \
49                    port:automake \
50                    port:libtool
51
52set mp.osxfuse_rev  [lindex ${mp.dist} [expr [lsearch ${mp.dist} osxfuse] + 1]]
53worksrcdir          osxfuse-osxfuse-${mp.osxfuse_rev}
54
55foreach { mp.comp mp.rev mp.chksum } ${mp.dist} {
56    set f ${mp.comp}-${mp.rev}.tar.gz
57    master_sites-append https://github.com/osxfuse/${mp.comp}/tarball/${mp.rev}/:${mp.comp}
58    distfiles-append    ${f}:${mp.comp}
59    checksums-append    ${f}
60    foreach {type chksum} ${mp.chksum} {
61        checksums-append ${type} ${chksum}
62    }
63}
64
65post-extract {
66    foreach { mp.comp mp.rev mp.chksum } ${mp.dist} {
67        if {${mp.comp} ne "osxfuse"} {
68            # Replace existing empty directory if it exists
69            file delete ${workpath}/${worksrcdir}/${mp.comp}
70            move ${workpath}/osxfuse-${mp.comp}-${mp.rev} ${workpath}/${worksrcdir}/${mp.comp}
71        }
72    }
73}
74
75patchfiles          patch-buildsystem.diff \
76                    patch-kext-location.diff
77
78post-patch {
79    # Perhaps the ports sandbox does not let us write to /tmp.
80    # For a quick and temporary fix use this reinplace.
81    file mkdir ${workpath}/tmp
82    reinplace "s,@@TMP@@,${workpath}/tmp,g" ${worksrcpath}/build.sh
83
84    # Only build the archs we want, not the hardcoded universal archs
85    reinplace -E "s,@@ARCHS@@,[get_canonical_archs],g" ${worksrcpath}/build.sh
86    reinplace -E "s,@@KERNELARCHS@@,${kernel_arch},g" ${worksrcpath}/build.sh
87
88    # Inject the destroot path as the buildsystem tries to write to the prefix directly
89    reinplace -E "s,@@DESTROOT@@,${destroot},g" ${worksrcpath}/build.sh
90
91    # Correct the location of the kext
92    reinplace -E "s,@@PREFIX@@,${prefix},g" ${worksrcpath}/kext/common/fuse_param.h
93}
94
95use_configure   no
96
97build.cmd       ./build.sh
98# Yes, they really named this target homebrew
99build.target    -t homebrew
100build.args      -f ${prefix}
101
102# The build step already does everything
103destroot {}
104
105# Move filesystem bundle into place
106post-destroot {
107    # Set proper permissions
108    fs-traverse f ${destroot}${prefix}/Library {
109        file attributes $f -owner root -group wheel
110    }
111    # Enable setuid on helper binary
112    file attributes ${destroot}${prefix}/Library/Filesystems/osxfusefs.fs/Support/load_osxfusefs -permissions 04755
113}
114destroot.violate_mtree yes
115
116notes {
117    When upgrading, unmount all FUSE filesystems and then unload the kernel extension.
118    Unloading can be done via: sudo kextunload -b com.github.osxfuse.filesystems.osxfusefs
119    Alternativley (or if this fails), just reboot your computer now.
120}
121
122# Could probably be supported by setting ARCHS correctly above
123universal_variant no
Note: See TracBrowser for help on using the repository browser.