--- Portfile.orig	2014-05-27 00:38:57.000000000 -0500
+++ Portfile	2014-05-27 01:01:18.000000000 -0500
@@ -1,5 +1,5 @@
 # -*- 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 120388 2014-05-26 17:08:22Z devans@macports.org $
+# $Id: Portfile 120310 2014-05-22 21:36:17Z cal@macports.org $
 
 PortSystem          1.0
 
@@ -26,9 +26,8 @@
 
 master_sites        ${homepage}download/
 
-checksums           \
-    rmd160 e89c075c353548740ab9e3de1d8e6ccea61823f6 \
-    sha256 d14b54cb04d81ba3b84ad41c5e68951d250b455d0862add1c987e3af9e2e174d
+checksums           rmd160 e89c075c353548740ab9e3de1d8e6ccea61823f6 \
+                    sha256 d14b54cb04d81ba3b84ad41c5e68951d250b455d0862add1c987e3af9e2e174d
 
 patchfiles          patch-Makefile.diff \
                     patch-config.mk.diff
@@ -53,6 +52,22 @@
 
 variant universal   {}
 
+platform darwin     {
+# Before 10.7 there's no getline() in stdio.h
+# http://stackoverflow.com/a/1117158/205907
+    if {${os.major} < 11} { 
+# Using CVS project implementation
+# http://www.opensource.apple.com/source/cvs/cvs-47/cvs/lib/getline.c?txt
+# http://www.opensource.apple.com/source/cvs/cvs-47/cvs/lib/getline.h?txt
+# http://www.opensource.apple.com/source/cvs/cvs-47/cvs/lib/getdelim.c?txt
+# http://www.opensource.apple.com/source/cvs/cvs-47/cvs/lib/getdelim.h?txt
+        patchfiles-append   patch-getline.h.diff \
+                            patch-getline.c.diff \
+                            patch-getdelim.h.diff \
+                            patch-getdelim.c.diff
+    }
+}
+
 build.args          PREFIX=${prefix}
 build.env           CC=${configure.cc} \
                     CXX=${configure.cxx} \
