$OpenBSD: patch-setup_py,v 1.1 2016/01/05 13:21:49 ajacoutot Exp $
--- setup.py.orig	Fri Dec 12 12:31:11 2014
+++ setup.py	Mon Jan  4 10:40:32 2016
@@ -140,11 +140,12 @@ class inc_lib_dirs:
                 # darwin ports installation directories
                 aDir(L, "/opt/local/lib")
                 aDir(I, "/opt/local/include")
-            aDir(I, "/usr/local/include")
-            aDir(L, "/usr/local/lib")
+            aDir(I, "${LOCALBASE}/include")
+            aDir(L, "${LOCALBASE}/lib")
             aDir(I, "/usr/include")
             aDir(L, "/usr/lib")
-            aDir(I, "/usr/include/freetype2")
+            aDir(I, "${X11BASE}/include/freetype2")
+            aDir(L, "${X11BASE}/lib")
             prefix = sysconfig.get_config_var("prefix")
             if prefix:
                 aDir(L, pjoin(prefix, "lib"))
@@ -244,11 +245,7 @@ reportlab_files= [
         ]
 
 def get_fonts(PACKAGE_DIR, reportlab_files):
-    import sys, os, os.path, zipfile, io
-    if isPy3:
-        import urllib.request as ureq
-    else:
-        import urllib2 as ureq
+    import sys, os, os.path, zipfile
     rl_dir = PACKAGE_DIR['reportlab']
     if not [x for x in reportlab_files if not os.path.isfile(pjoin(rl_dir,x))]:
         infoline("Standard T1 font curves already downloaded")
@@ -257,12 +254,7 @@ def get_fonts(PACKAGE_DIR, reportlab_files):
         infoline('not downloading T1 font curve files')
         return
     try:
-        infoline("Downloading standard T1 font curves")
-
-        remotehandle = ureq.urlopen("http://www.reportlab.com/ftp/pfbfer-20070710.zip")
-        zipdata = io.BytesIO(remotehandle.read())
-        remotehandle.close()
-        archive = zipfile.ZipFile(zipdata)
+        archive = zipfile.ZipFile("${FULLDISTDIR}/${PFBFER}")
         dst = pjoin(rl_dir, 'fonts')
 
         for name in archive.namelist():
@@ -360,7 +352,7 @@ def main():
         if isla:
             LIBART_INC=None
         else:
-            LIBART_INC = list(sorted(glob.glob('/usr/include/libart-*/libart_lgpl/libart-features.h')))
+            LIBART_INC = list(sorted(glob.glob('${LOCALBASE}/include/libart-*/libart_lgpl/libart-features.h')))
         if LIBART_INC:
             def installed_libart_version(fn):
                 for l in open(fn, 'r').readlines():
