|
| 1 | +diff -r 9ecdf084933c setup.py |
| 2 | +--- a/setup.py Wed May 13 14:09:03 2015 +0100 |
| 3 | ++++ b/setup.py Fri May 22 10:14:29 2015 +0100 |
| 4 | +@@ -14,8 +14,8 @@ |
| 5 | + #no-download-t1-files=yes |
| 6 | + #ignore-system-libart=yes |
| 7 | + # if used on command line the config values are not used |
| 8 | +-dlt1 = not specialOption('--no-download-t1-files') |
| 9 | +-isla = specialOption('--ignore-system-libart') |
| 10 | ++dlt1 = False |
| 11 | ++isla = True |
| 12 | + |
| 13 | + try: |
| 14 | + import configparser |
| 15 | +@@ -121,39 +121,6 @@ |
| 16 | + else: |
| 17 | + P.insert(x, d) |
| 18 | + |
| 19 | +-class inc_lib_dirs: |
| 20 | +- L = None |
| 21 | +- I = None |
| 22 | +- def __call__(self): |
| 23 | +- if self.L is None: |
| 24 | +- L = [] |
| 25 | +- I = [] |
| 26 | +- if platform == "cygwin": |
| 27 | +- aDir(L, os.path.join("/usr/lib", "python%s" % sys.version[:3], "config")) |
| 28 | +- elif platform == "darwin": |
| 29 | +- # attempt to make sure we pick freetype2 over other versions |
| 30 | +- aDir(I, "/sw/include/freetype2") |
| 31 | +- aDir(I, "/sw/lib/freetype2/include") |
| 32 | +- # fink installation directories |
| 33 | +- aDir(L, "/sw/lib") |
| 34 | +- aDir(I, "/sw/include") |
| 35 | +- # darwin ports installation directories |
| 36 | +- aDir(L, "/opt/local/lib") |
| 37 | +- aDir(I, "/opt/local/include") |
| 38 | +- aDir(I, "/usr/local/include") |
| 39 | +- aDir(L, "/usr/local/lib") |
| 40 | +- aDir(I, "/usr/include") |
| 41 | +- aDir(L, "/usr/lib") |
| 42 | +- aDir(I, "/usr/include/freetype2") |
| 43 | +- prefix = sysconfig.get_config_var("prefix") |
| 44 | +- if prefix: |
| 45 | +- aDir(L, pjoin(prefix, "lib")) |
| 46 | +- aDir(I, pjoin(prefix, "include")) |
| 47 | +- self.L=L |
| 48 | +- self.I=I |
| 49 | +- return self.I,self.L |
| 50 | +-inc_lib_dirs=inc_lib_dirs() |
| 51 | +- |
| 52 | + def getVersionFromCCode(fn): |
| 53 | + import re |
| 54 | + tag = re.search(r'^#define\s+VERSION\s+"([^"]*)"',open(fn,'r').read(),re.M) |
| 55 | +@@ -244,11 +211,7 @@ |
| 56 | + ] |
| 57 | + |
| 58 | + def get_fonts(PACKAGE_DIR, reportlab_files): |
| 59 | +- import sys, os, os.path, zipfile, io |
| 60 | +- if isPy3: |
| 61 | +- import urllib.request as ureq |
| 62 | +- else: |
| 63 | +- import urllib2 as ureq |
| 64 | ++ import os, os.path |
| 65 | + rl_dir = PACKAGE_DIR['reportlab'] |
| 66 | + if not [x for x in reportlab_files if not os.path.isfile(pjoin(rl_dir,x))]: |
| 67 | + infoline("Standard T1 font curves already downloaded") |
| 68 | +@@ -257,6 +220,11 @@ |
| 69 | + infoline('not downloading T1 font curve files') |
| 70 | + return |
| 71 | + try: |
| 72 | ++ if isPy3: |
| 73 | ++ import urllib.request as ureq |
| 74 | ++ else: |
| 75 | ++ import urllib2 as ureq |
| 76 | ++ import zipfile, io |
| 77 | + infoline("Downloading standard T1 font curves") |
| 78 | + |
| 79 | + remotehandle = ureq.urlopen("http://www.reportlab.com/ftp/pfbfer-20070710.zip") |
| 80 | +@@ -448,7 +416,8 @@ |
| 81 | + FT_LIB_DIR=[FT_LIB_DIR] if FT_LIB_DIR else [] |
| 82 | + FT_INC_DIR=config('FREETYPE_PATHS','inc') |
| 83 | + FT_INC_DIR=[FT_INC_DIR] if FT_INC_DIR else [] |
| 84 | +- I,L=inc_lib_dirs() |
| 85 | ++ I=["_FT_INC_"] |
| 86 | ++ L=["_FT_LIB_"] |
| 87 | + ftv = None |
| 88 | + for d in I: |
| 89 | + if isfile(pjoin(d, "ft2build.h")): |
0 commit comments