--- /opt/local/var/macports/sources/svn.macports.org/trunk/dports/devel/qgit/Portfile	2015-01-12 12:43:09.000000000 +0100
+++ /opt/local/site-ports/devel/qgit/Portfile	2016-04-07 15:06:47.000000000 +0200
@@ -1,60 +1,70 @@
 # -*- 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
-# $Id: Portfile 126937 2014-10-17 21:55:23Z khindenburg@macports.org $
+# $Id: Portfile 120912 2014-06-11 13:10:52Z ciserlohn@macports.org $
 
 PortSystem          1.0
-PortGroup           qt4 1.0
+PortGroup           qt5 1.0
+PortGroup           cmake 1.0
+cmake.out_of_source yes
+
+fetch.type          git
+git.url             git://repo.or.cz/qgit4/redivivus.git
+git.branch          2d0c3b0a9138e8e14d7f2c147fa7267ff5e23282
 
 name                qgit
-version             2.5.20140910
+version             2.6
 categories          devel
-license             GPL-2
 maintainers         free.fr:ocroquette openmaintainer
-description         A Qt graphical interface to git repositories
-long_description    ${description}
-
-homepage            http://libre.tibirna.org/projects/qgit
-
-fetch.type          git
-git.url             git://repo.or.cz/qgit4/redivivus.git
-git.branch          c83cb5819443adf0e3b60d1ac3a63d9cbb22e124
+description         A QT graphical interface to git repositories
+long_description    A QT graphical interface to git repositories
 
+homepage            http://libre.tibirna.org/projects/qgit \
+                    http://repo.or.cz/qgit4/redivivus.git
+#master_sites        http://libre.tibirna.org/attachments/download/9/
+distname            ${name}-${version}
 platforms           darwin
 
-depends_lib-append  port:git
+#use_gz             yes
+worksrcdir          ${name}
 
-patchfiles          patch_src_qgit.cpp.diff
+depends_lib-append  port:git
 
-variant debug description "Build as both release and debug" {}
+patchfiles          patch_src_namespace_def.cpp.diff \
+                    patch_src_qgit.cpp.diff \
+				patch-cxxflags.diff
+platform darwin {
+	patchfiles-append \
+				patch-build-app-bundle.diff
+}
 
 post-patch {
-    # when not doing debug ...
-    if {![variant_isset debug]} {
-        # ... build just the release version
-        reinplace "s@debug_and_release@release@" ${worksrcpath}/qgit.pro
-        reinplace "s@debug_and_release@release@" ${worksrcpath}/src/src.pro
-    }
-    # nothing to do if +debug is specified; this is the default.
+    reinplace "s|@VERSION@|${version}|g" ${worksrcpath}/CMakeLists.txt
 }
 
-# --disable-dependency-tracking is not recognized.
-configure.universal_args-delete --disable-dependency-tracking
-
-pre-configure {
-    configure.args-append CONFIG+=\"${qt_arch_types}\"
+configure.args-append \
+				-DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON
+platform linux {
+    ui_msg ${configure.pre_args}
+    ui_msg ${configure.args}
+    configure.args-delete \
+			    -DCMAKE_INSTALL_RPATH="${prefix}/lib"
+    configure.args-append \
+			    -DCMAKE_PREFIX_PATH=${prefix} \
+			    -DCMAKE_INSTALL_RPATH="${qt_libs_dir}\;${prefix}/lib"
+    ui_msg ${configure.args}
 }
 
-configure.cmd       ${qt_qmake_cmd}
-configure.pre_args
-configure.post_args
-
-destroot {
-    xinstall -m 755 -d ${destroot}${qt_apps_dir}
-    copy ${worksrcpath}/bin/qgit.app ${destroot}${qt_apps_dir}
-
-    # Also link to ${prefix}/bin for easier access from the command line
-    # Especially useful since qgit is supposed to be started from
-    # the GIT repository location.
-    ln -s ${qt_apps_dir}/qgit.app/Contents/MacOS/qgit ${destroot}${prefix}/bin
+platform darwin {
+    destroot {
+        xinstall -m 755 -d ${destroot}${qt_apps_dir}
+        copy ${build.dir}/qgit.app ${destroot}${qt_apps_dir}
+
+        # Also link to ${prefix}/bin for easier access from the command line
+        # Especially useful since qgit is supposed to be started from
+        # the GIT repository location.
+        system "echo \"#!/bin/sh\nexport KDE_SESSION_VERSION=5\nexec \\\"${qt_apps_dir}/qgit.app/Contents/MacOS/qgit\\\" \\\"\\\$\@\\\"\" > ${destroot}${prefix}/bin/qgit"
+        system "chmod 755 ${destroot}${prefix}/bin/qgit"
+    }
 }
 
-livecheck.type   none
+#livecheck.url    http://libre.tibirna.org/projects/qgit/files
+#livecheck.regex  (\\d+(\\.\\d+)+)
