Index: dports/fuse/osxfuse/Portfile
===================================================================
--- dports/fuse/osxfuse/Portfile	(revision 145577)
+++ dports/fuse/osxfuse/Portfile	(working copy)
@@ -4,8 +4,7 @@
 PortSystem          1.0
 
 name                osxfuse
-version             2.8.2
-set branch          [join [lrange [split ${version} .] 0 1] .]
+version             3.1.0
 categories          fuse devel
 platforms           macosx
 license             BSD APSL
@@ -46,12 +45,12 @@
 
 distfiles
 set mp.dist {
-    osxfuse     bf71481
-    kext        b6b3cbe
-    framework   2ab904a
-    prefpane    8ad486b
-    fuse        98b9960
-    support     664d8ba
+    osxfuse     6cfb2b6
+    kext        2a0383e
+    framework   b5d552d
+    prefpane    a135b78
+    fuse        06f648c
+    support     faf1f6f
 }
 
 depends_build       port:autoconf \
@@ -69,30 +68,31 @@
 
 if { $use_signed_kext } {
     master_sites-append sourceforge
+    master_sites-append https://github.com/osxfuse/osxfuse/releases/download/osxfuse-${version}
     distfiles-append ${name}-${version}.dmg
 }
 
-checksums           osxfuse-bf71481.tar.gz \
-                    rmd160  121cc22174e19ecb32c6b61552c007c327be26b7 \
-                    sha256  b0cdfb642d2b2ed5b30d561803c875913eb27ec86a440601101d4e468eaa17c4 \
-                    kext-b6b3cbe.tar.gz \
-                    rmd160  07e2aca43b53dad2104f8306db42e082e75351ef \
-                    sha256  7f776c43ad15e0b1916d6ebea3d56c0b4f7c7b0beb81f28fe380099759bd2349 \
-                    framework-2ab904a.tar.gz \
-                    rmd160  af79296880d18d8f8a27803e348ff6429280f0e7 \
-                    sha256  1591c26d0d01311007105ab3789d43abc6e824aaee681aef8b601413dafea65e \
-                    prefpane-8ad486b.tar.gz \
-                    rmd160  c157ff7907743ab66e1ecb03106deb816aeffb70 \
-                    sha256  d1b6233640c77d124c7c7e97c5bc370fa8ade8b041b127b6bbc1ae4a44b8bad4 \
-                    fuse-98b9960.tar.gz \
-                    rmd160  589cbe0c819caded56dc4be64727580e1400fd9e \
-                    sha256  f60205e19c2971228b78d180dc65cda2a6271a567229acdeb19567fcbcebb641 \
-                    support-664d8ba.tar.gz \
-                    rmd160  d4c578037996dc5959eb8aa2097ff1ccf4f7b619 \
-                    sha256  84e64541e5ad1baeb70a513960349edad736da1e1ad83ef889d938a571086c58 \
-                    osxfuse-2.8.2.dmg \
-                    rmd160  eaf94873fe650584a68fd011bb6bb6195a373e91 \
-                    sha256  c0cc4066642136fdd4f5fead10bed2e495f636f86f451deee85dbb5aa95fa7fa
+checksums           osxfuse-6cfb2b6.tar.gz \
+                    rmd160  10ddf7da77ae5d23ad6aae727880bf8bcae2b24c \
+                    sha256  f011bc152c49ddfa63089b6635244f130470f7f89ac3cfec37bf4e2860188f25 \
+                    kext-2a0383e.tar.gz \
+                    rmd160  b85530d85f5d679b1808979a7678cb7bac64491f \
+                    sha256  49f5ba4ade7dae85e477c00d652f92caec02774c7f7db1f16c6dfd42edd638e6 \
+                    framework-b5d552d.tar.gz \
+                    rmd160  94a98dea2474790d8d45ef9e69fa3fbc954417f0 \
+                    sha256  f4da3963574f59febc59f691c560dc90489b2d5587a4114754b977426f1b6d10 \
+                    prefpane-a135b78.tar.gz \
+                    rmd160  6001d585764454e6fe244b8bb40f5e3ce1d4f24d \
+                    sha256  f75e9a12ee0fdc48d78921335ceba08572954228bb690f999e3d77d06131f178 \
+                    fuse-06f648c.tar.gz \
+                    rmd160  1fd618360a273ca14d8de6657102818d13e9cfcb \
+                    sha256  d76e58bf88e595ada73698e8adcdf0dd4018835cfa81670f96b80429a8a07810 \
+                    support-faf1f6f.tar.gz \
+                    rmd160  95f1817f30946cd86cce82735d344d25e594ed3d \
+                    sha256  8d20b9ac55bb913e757a042d349551bf30119df6af9aebcdcd2eafcd90b2af84 \
+                    osxfuse-3.1.0.dmg \
+                    rmd160  34419520f7fcaea090ee7ef13b2e6491892b8745 \
+                    sha256  903128f6ff873e2c00c742e1ec0cac6b21a5cfac27d56ed092b27e34bf1bb007
 
 # extract phase will just extract the dmg; post-extract will expand
 # the tarballs
@@ -104,8 +104,8 @@
 post-extract {
     # Extract the pkg and the appropriate payload from the binary dmg
     if { $use_signed_kext } {
-        system -W ${workpath}/${name}-${version} "pkgutil --expand 'Install OSXFUSE ${branch}.pkg' ${workpath}/pkg"
-        system -W ${workpath}/pkg/10.9/OSXFUSECore.pkg "gzip -dc Payload | cpio -id"
+        system -W ${workpath}/${name}-${version} "pkgutil --expand 'FUSE for OS X' ${workpath}/pkg"
+        system -W ${workpath}/pkg/Core.pkg "gzip -dc Payload | cpio -id"
     }
 
     # Extract the source tarballs
@@ -121,32 +121,19 @@
     }
 }
 
-patchfiles          patch-buildsystem.diff \
-                    patch-kext-location.diff \
-                    patch-xcode-7.2.diff
-
-post-patch {
-    reinplace "s,@@TMP@@,${workpath}/.tmp,g" ${worksrcpath}/build.sh
-
-    # Only build the archs we want, not the hardcoded universal archs
-    reinplace -E "s,@@ARCHS@@,[get_canonical_archs],g" ${worksrcpath}/build.sh
-
-    # Inject the destroot path as the buildsystem tries to write to the prefix directly
-    reinplace -E "s,@@DESTROOT@@,${destroot},g" ${worksrcpath}/build.sh
-
-    # Correct the location of the kext
-    reinplace -E "s,@@PREFIX@@,${prefix},g" ${worksrcpath}/kext/common/fuse_param.h
-}
-
 use_configure   no
 
-build.cmd       ./build.sh
-# Yes, they really named this target homebrew
-build.target    -t homebrew
-build.args      -f ${prefix}
+build.cmd       ./build.sh -t packagemanager
+build.target    -a build
+build.args      --build-directory="${workpath}" --\
+                -a [join [get_canonical_archs] " -a "]\
+                --framework-prefix="${prefix}"\
+                --fsbundle-prefix="${prefix}"\
+                --library-prefix="${prefix}"
 
-# The build step already does everything
-destroot {}
+destroot.target -a install
+destroot.args   --build-directory="${workpath}"
+destroot.destdir -- "${destroot}${prefix}"
 
 # Move filesystem bundle into place
 post-destroot {
@@ -155,7 +142,7 @@
         file attributes $f -owner root -group wheel
     }
     # Enable setuid on helper binary
-    file attributes ${destroot}${prefix}/Library/Filesystems/osxfusefs.fs/Support/load_osxfusefs -permissions 04755
+    file attributes ${destroot}${prefix}/Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse -permissions 04755
 }
 
 
@@ -169,11 +156,9 @@
 # signed binary instead here too.
 if { $use_signed_kext } {
     post-destroot {
-        delete ${destroot}${prefix}/Library/Filesystems/osxfusefs.fs/Support/osxfusefs.kext \
-            ${destroot}${prefix}/Library/Filesystems/osxfusefs.fs/Support/osxfusefs.kext.dSYM
-        
-        file copy ${workpath}/pkg/10.9/OSXFUSECore.pkg/Library/Filesystems/osxfusefs.fs/Support/osxfusefs.kext \
-            ${destroot}${prefix}/Library/Filesystems/osxfusefs.fs/Support
+        delete ${destroot}${prefix}/Library/Filesystems/osxfuse.fs/Contents/Extensions/${macosx_deployment_target}/osxfuse.kext
+        file copy ${workpath}/pkg/Core.pkg/Library/Filesystems/osxfuse.fs/Contents/Extensions/10.9/osxfuse.kext\
+            ${destroot}${prefix}/Library/Filesystems/osxfuse.fs/Contents/Extensions/${macosx_deployment_target}
     }
 }
 
@@ -181,7 +166,7 @@
 
 notes {
     When upgrading, unmount all FUSE filesystems and then unload the kernel extension.
-    Unloading can be done via: sudo kextunload -b com.github.osxfuse.filesystems.osxfusefs
+    Unloading can be done via: sudo kextunload -b com.github.osxfuse.filesystems.osxfuse
     Alternatively (or if this fails), just reboot your computer now.
 }
 
Index: dports/fuse/osxfuse/files/patch-buildsystem.diff
===================================================================
--- dports/fuse/osxfuse/files/patch-buildsystem.diff	(revision 145577)
+++ dports/fuse/osxfuse/files/patch-buildsystem.diff	(working copy)
@@ -1,73 +0,0 @@
---- build.sh.orig	2014-06-09 15:41:49.000000000 -0500
-+++ build.sh	2014-10-16 21:26:27.000000000 -0500
-@@ -12,7 +12,7 @@
- # Beware: GNU libtool cannot handle directory names containing whitespace.
- #         Therefore, do not set M_CONF_TMPDIR to such a directory.
- #
--readonly M_CONF_TMPDIR=/tmp
-+readonly M_CONF_TMPDIR=@@TMP@@
- readonly M_PLISTSIGNER_TEST_KEY="`dirname $0`/prefpane/autoinstaller/TestKeys/private_key.der"
- 
- # Other constants
-@@ -104,37 +104,37 @@
- declare M_XCODE_VERSION_REQUIRED=""
- 
- # SDK 10.5
--readonly M_SDK_105_ARCHS="ppc ppc64 i386 x86_64"
-+readonly M_SDK_105_ARCHS="@@ARCHS@@"
- declare M_SDK_105=""
- declare M_SDK_105_XCODE=""
- declare M_SDK_105_COMPILER=""
- 
- # SDK 10.6
--readonly M_SDK_106_ARCHS="i386 x86_64"
-+readonly M_SDK_106_ARCHS="@@ARCHS@@"
- declare M_SDK_106=""
- declare M_SDK_106_XCODE=""
- declare M_SDK_106_COMPILER=""
- 
- # SDK 10.7
--readonly M_SDK_107_ARCHS="i386 x86_64"
-+readonly M_SDK_107_ARCHS="@@ARCHS@@"
- declare M_SDK_107=""
- declare M_SDK_107_XCODE=""
- declare M_SDK_107_COMPILER=""
- 
- # SDK 10.8
--readonly M_SDK_108_ARCHS="i386 x86_64"
-+readonly M_SDK_108_ARCHS="@@ARCHS@@"
- declare M_SDK_108=""
- declare M_SDK_108_XCODE=""
- declare M_SDK_108_COMPILER=""
- 
- # SDK 10.9
--readonly M_SDK_109_ARCHS="i386 x86_64"
-+readonly M_SDK_109_ARCHS="@@ARCHS@@"
- declare M_SDK_109=""
- declare M_SDK_109_XCODE=""
- declare M_SDK_109_COMPILER=""
- 
- # SDK 10.10
--readonly M_SDK_1010_ARCHS="i386 x86_64"
-+readonly M_SDK_1010_ARCHS="@@ARCHS@@"
- declare M_SDK_1010=""
- declare M_SDK_1010_XCODE=""
- declare M_SDK_1010_COMPILER=""
-@@ -1880,7 +1880,7 @@
- 
-     local ms_osxfuse_out="$M_CONF_TMPDIR/osxfuse-homebrew-$ms_os_version-$ms_osxfuse_version"
-     local ms_osxfuse_build="$ms_osxfuse_out/build/"
--    local ms_osxfuse_root="$m_prefix"
-+    local ms_osxfuse_root="@@DESTROOT@@$m_prefix"
- 
-     if [ -e "$ms_osxfuse_out" ]
-     then
-@@ -1984,7 +1984,7 @@
-     xcrun make -j4 >$m_stdout 2>$m_stderr
-     m_exit_on_error "make failed while compiling the OSXFUSE library."
- 
--    xcrun make install >$m_stdout 2>$m_stderr
-+    xcrun make install DESTDIR="@@DESTROOT@@" >$m_stdout 2>$m_stderr
-     m_exit_on_error "cannot prepare library build for installation."
- 
-     for f in "$ms_osxfuse_root"/lib/libosxfuse_i64*.dylib; do
Index: dports/fuse/osxfuse/files/patch-kext-location.diff
===================================================================
--- dports/fuse/osxfuse/files/patch-kext-location.diff	(revision 145577)
+++ dports/fuse/osxfuse/files/patch-kext-location.diff	(working copy)
@@ -1,11 +0,0 @@
---- kext/common/fuse_param.h.orig	2013-12-22 18:50:41.000000000 +0100
-+++ kext/common/fuse_param.h	2013-12-22 18:50:44.000000000 +0100
-@@ -59,7 +59,7 @@
- 
- /* Paths */
- 
--#define OSXFUSE_BUNDLE_PATH "/Library/Filesystems/osxfusefs.fs"
-+#define OSXFUSE_BUNDLE_PATH "@@PREFIX@@/Library/Filesystems/osxfusefs.fs"
- #define OSXFUSE_KEXT        OSXFUSE_BUNDLE_PATH "/Support/osxfusefs.kext"
- #define OSXFUSE_LOAD_PROG   OSXFUSE_BUNDLE_PATH "/Support/load_osxfusefs"
- #define OSXFUSE_MOUNT_PROG  OSXFUSE_BUNDLE_PATH "/Support/mount_osxfusefs"
Index: dports/fuse/osxfuse/files/patch-xcode-7.2.diff
===================================================================
--- dports/fuse/osxfuse/files/patch-xcode-7.2.diff	(revision 145577)
+++ dports/fuse/osxfuse/files/patch-xcode-7.2.diff	(working copy)
@@ -1,44 +0,0 @@
-Upstream-Status: Inappropriate (Upstream has refactored their build system and this patch would no longer apply)
---- build.sh.orig	2015-12-11 15:04:10.000000000 +0100
-+++ build.sh	2015-12-11 15:04:41.000000000 +0100
-@@ -117,6 +117,9 @@
- declare M_XCODE71=""
- declare M_XCODE71_VERSION=7.1
- readonly M_XCODE71_COMPILER="com.apple.compilers.llvm.clang.1_0"
-+declare M_XCODE72=""
-+declare M_XCODE72_VERSION=7.2
-+readonly M_XCODE72_COMPILER="com.apple.compilers.llvm.clang.1_0"
- 
- declare M_ACTUAL_PLATFORM=""
- declare M_PLATFORMS=""
-@@ -2652,6 +2655,14 @@
-                     M_XCODE71_VERSION=$m_xcode_version
-                 fi
-                 ;;
-+            7.2*)
-+                m_version_compare $M_XCODE72_VERSION $m_xcode_version
-+                if [[ $? != 2 ]]
-+                then
-+                    M_XCODE72="$m_xcode_root"
-+                    M_XCODE72_VERSION=$m_xcode_version
-+                fi
-+                ;;
-             *)
-                 m_log "skip unsupported Xcode version in '$m_xcode_root'."
-                 ;;
-@@ -2929,6 +2940,15 @@
-         M_SDK_1011_COMPILER="$M_XCODE71_COMPILER"
-         m_platform_realistic_add "10.11"
-     fi
-+    if [[ -n "$M_XCODE72" ]]
-+    then
-+        m_xcode_latest="$M_XCODE72"
-+
-+        M_SDK_1011="$M_XCODE72/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk"
-+        M_SDK_1011_XCODE="$M_XCODE72"
-+        M_SDK_1011_COMPILER="$M_XCODE72_COMPILER"
-+        m_platform_realistic_add "10.11"
-+    fi
- 
-     m_read_input "$@"
- 
