Index: Portfile
===================================================================
--- Portfile	(revision 143469)
+++ Portfile	(working copy)
@@ -1,16 +1,17 @@
 # -*- 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
 
 PortSystem          1.0
-PortGroup           cmake   1.0
+PortGroup           cmake   1.1
+PortGroup           compiler_blacklist_versions 1.0
+PortGroup           cxx11   1.1
 PortGroup           github  1.0
 PortGroup           qt5     1.0
 
+github.setup        qgis QGIS 3_0_0 final-
 name                qgis3
-set commit          36bf093
-github.setup        qgis QGIS ${commit}
-version             2.99.20180124
+version             [string map {_ .} ${github.version}]
 categories          gis
-maintainers         vince
+maintainers         {vince @Veence}
 description         QGIS 3 is a user-friendly GIS based on Qt 5
 long_description    QGIS is an open-source alternative to ArcGIS or other commercial GIS.\
                     It can be used as a standalone GIS, or also as frontend to other,\
@@ -20,18 +21,12 @@
 platforms           darwin
 license             GPL-2+
 
-use_parallel_build  no
 homepage            http://www.qgis.org/
 
-patchfiles          patch-app_info_plist_in.diff \
-                    patch-CMakelists_txt.diff \
-                    patch-FindPyQt5_py.diff
+checksums           rmd160  f72016dbf0c5d7ad34393713f1372be379fe3bbc \
+                    sha256  c54d5deb739532aee858d049deaa45edff34c0a56ce2d6556250d86be6f4d2e7 \
+                    size    111733389
 
-checksums           rmd160  d53c504d41960b547e407e1922e1c1b3d876629a \
-                    sha256  17fa868f00f30184431e219f41fcb785d818e5ba89678dc9ec2ad9630c83237f
-
-worksrcdir          QGIS-${commit}
-
 depends_lib-append  port:libiconv \
                     port:expat \
                     port:libtasn1 \
@@ -61,9 +56,9 @@
                     port:bison \
                     port:ld64 
 
-post-extract {
-    system -W ${worksrcpath} "mkdir build"
-}
+patchfiles          patch-app_info_plist_in.diff \
+                    patch-CMakelists_txt.diff \
+                    patch-FindPyQt5_py.diff
 
 post-patch {
     reinplace -E "s|@PREFIX@|${prefix}|g" \
@@ -75,13 +70,11 @@
     # Handle QGIS Fix #11399 which doesn’t seem to work anymore
     reinplace -E "s|#ifdef Q_OS_MAC$|#if 0|" \
         ${worksrcpath}/src/app/layout/qgslayoutdesignerdialog.cpp
-
-    # Handle legacy OS/XCode
-    if {[vercmp $xcodeversion 4.6.3] <= 0} {
-        configure.compiler  llvm-gcc-4.2
-    }
 }
 
+compiler.blacklist      {clang < 500}
+
+cmake.install_prefix    ${applications_dir}
 # Plug-ins
 configure.args-append  "-DWITH_GRASS=OFF"
 configure.args-append  "-DWITH_GRASS7=OFF"
@@ -198,22 +191,19 @@
 variant grass               description "Build Grass 7 plugin" {
 
     depends_lib-append      port:grass7
+    global grass_version
+    set grass_version       7.4.0
+    post-patch {
+        reinplace "s|@GRASS_VERSION@|${grass_version}|g" \
+            ${worksrcpath}/mac/app.info.plist.in
+    }
     configure.args-delete  "-DWITH_GRASS7=OFF"
     configure.args-append  "-DWITH_GRASS7=ON"
-    configure.args-append   \
-                "-DGRASS_PREFIX7=${prefix}/share/grass-7.2.2"
+    configure.args-append   -DGRASS_PREFIX7=${prefix}/share/grass-${grass_version}
 }
 
-# Configure steps
-
-configure.dir               ${worksrcpath}/build
-configure.cmd               cmake ..
-
-configure.args-append  "-DCMAKE_CXX_COMPILER=${configure.cxx}"
-configure.args-append  "-DCMAKE_C_COMPILER=${configure.cc}"
 configure.args-append  "-DEXPAT_INCLUDE_DIR=${prefix}/include"
 configure.args-append  "-DEXPAT_LIBRARY=${prefix}/lib/libexpat.dylib"
-configure.args-append  "-DCMAKE_INSTALL_PREFIX=${applications_dir}"
 configure.args-append  "-DQGIS_MACAPP_BUNDLE=0"
 configure.args-append  "-DGDAL_CONFIG=${prefix}/bin/gdal-config"
 configure.args-append  "-DGDAL_INCLUDE_DIR=${prefix}/include"
@@ -227,15 +217,8 @@
 configure.args-append  "-DSPATIALITE_LIBRARY=${prefix}/lib/libspatialite.dylib"
 configure.args-append  "-DSPATIALITE_INCLUDE_DIR=${prefix}/include"
 configure.args-append  "-DSPATIALINDEX_LIBRARY=${prefix}/lib/libspatialindex.dylib"
-#configure.args-append  "-DCMAKE_BUILD_TYPE=DEBUG"
-configure.args-append  "-DCMAKE_BUILD_TYPE=RELEASE"
 
 post-destroot {
     # qgis_bench app doesn’t link properly. Who uses this anyway????
     delete ${destroot}${applications_dir}/Qgis3.app/Contents/MacOS/bin/qgis_bench.app
 }
-
-use_parallel_build          yes
-#build.dir                   ${worksrcpath}/build
-cmake.out_of_source         yes
-destroot.target             install
