version 1.1.1.2, 2014/06/15 19:53:33
|
version 1.1.1.2.2.1, 2014/06/15 20:01:54
|
Line 67 xml_includes=""
|
Line 67 xml_includes=""
|
for dir in includes_dir: |
for dir in includes_dir: |
if not missing(dir + "/libxml2/libxml/tree.h"): |
if not missing(dir + "/libxml2/libxml/tree.h"): |
xml_includes=dir + "/libxml2" |
xml_includes=dir + "/libxml2" |
break; | break; |
|
|
if xml_includes == "": |
if xml_includes == "": |
print("failed to find headers for libxml2: update includes_dir") |
print("failed to find headers for libxml2: update includes_dir") |
Line 77 iconv_includes=""
|
Line 77 iconv_includes=""
|
for dir in includes_dir: |
for dir in includes_dir: |
if not missing(dir + "/iconv.h"): |
if not missing(dir + "/iconv.h"): |
iconv_includes=dir |
iconv_includes=dir |
break; | break; |
|
|
if iconv_includes == "": |
if iconv_includes == "": |
print("failed to find headers for libiconv: update includes_dir") |
print("failed to find headers for libiconv: update includes_dir") |
Line 90 os.path.join(ROOT,'lib'),
|
Line 90 os.path.join(ROOT,'lib'),
|
|
|
xml_files = ["libxml2-api.xml", "libxml2-python-api.xml", |
xml_files = ["libxml2-api.xml", "libxml2-python-api.xml", |
"libxml.c", "libxml.py", "libxml_wrap.h", "types.c", |
"libxml.c", "libxml.py", "libxml_wrap.h", "types.c", |
"xmlgenerator.py", "README", "TODO", "drv_libxml2.py"] | "xmlgenerator.py", "README", "TODO", "drv_libxml2.py"] |
|
|
xslt_files = ["libxslt-api.xml", "libxslt-python-api.xml", |
xslt_files = ["libxslt-api.xml", "libxslt-python-api.xml", |
"libxslt.c", "libxsl.py", "libxslt_wrap.h", |
"libxslt.c", "libxsl.py", "libxslt_wrap.h", |
"xsltgenerator.py"] | "xsltgenerator.py"] |
|
|
if missing("libxml2-py.c") or missing("libxml2.py"): |
if missing("libxml2-py.c") or missing("libxml2.py"): |
try: |
try: |
try: | try: |
import xmlgenerator | import xmlgenerator |
except: | except: |
import generator | import generator |
except: |
except: |
print("failed to find and generate stubs for libxml2, aborting ...") | print("failed to find and generate stubs for libxml2, aborting ...") |
print(sys.exc_info()[0], sys.exc_info()[1]) | print(sys.exc_info()[0], sys.exc_info()[1]) |
sys.exit(1) | sys.exit(1) |
|
|
head = open("libxml.py", "r") |
head = open("libxml.py", "r") |
generated = open("libxml2class.py", "r") |
generated = open("libxml2class.py", "r") |
Line 116 if missing("libxml2-py.c") or missing("libxml2.py"):
|
Line 116 if missing("libxml2-py.c") or missing("libxml2.py"):
|
else: |
else: |
result.write(line) |
result.write(line) |
for line in generated.readlines(): |
for line in generated.readlines(): |
result.write(line) | result.write(line) |
head.close() |
head.close() |
generated.close() |
generated.close() |
result.close() |
result.close() |
Line 126 if missing("libxslt-py.c") or missing("libxslt.py"):
|
Line 126 if missing("libxslt-py.c") or missing("libxslt.py"):
|
if missing("xsltgenerator.py") or missing("libxslt-api.xml"): |
if missing("xsltgenerator.py") or missing("libxslt-api.xml"): |
print("libxslt stub generator not found, libxslt not built") |
print("libxslt stub generator not found, libxslt not built") |
else: |
else: |
try: | try: |
import xsltgenerator | import xsltgenerator |
except: | except: |
print("failed to generate stubs for libxslt, aborting ...") | print("failed to generate stubs for libxslt, aborting ...") |
print(sys.exc_info()[0], sys.exc_info()[1]) | print(sys.exc_info()[0], sys.exc_info()[1]) |
else: | else: |
head = open("libxsl.py", "r") | head = open("libxsl.py", "r") |
generated = open("libxsltclass.py", "r") | generated = open("libxsltclass.py", "r") |
result = open("libxslt.py", "w") | result = open("libxslt.py", "w") |
for line in head.readlines(): | for line in head.readlines(): |
if WITHDLLS: |
if WITHDLLS: |
result.write(altImport(line)) |
result.write(altImport(line)) |
else: |
else: |
result.write(line) |
result.write(line) |
for line in generated.readlines(): | for line in generated.readlines(): |
result.write(line) | result.write(line) |
head.close() | head.close() |
generated.close() | generated.close() |
result.close() | result.close() |
with_xslt=1 | with_xslt=1 |
else: |
else: |
with_xslt=1 |
with_xslt=1 |
|
|
if with_xslt == 1: |
if with_xslt == 1: |
xslt_includes="" |
xslt_includes="" |
for dir in includes_dir: |
for dir in includes_dir: |
if not missing(dir + "/libxslt/xsltconfig.h"): | if not missing(dir + "/libxslt/xsltconfig.h"): |
xslt_includes=dir + "/libxslt" | xslt_includes=dir + "/libxslt" |
break; | break; |
|
|
if xslt_includes == "": |
if xslt_includes == "": |
print("failed to find headers for libxslt: update includes_dir") | print("failed to find headers for libxslt: update includes_dir") |
with_xslt = 0 | with_xslt = 0 |
|
|
|
|
descr = "libxml2 package" |
descr = "libxml2 package" |
Line 198 extens=[Extension('libxml2mod', c_files, include_dirs=
|
Line 198 extens=[Extension('libxml2mod', c_files, include_dirs=
|
libraries=libs, define_macros=macros)] |
libraries=libs, define_macros=macros)] |
if with_xslt == 1: |
if with_xslt == 1: |
extens.append(Extension('libxsltmod', xslt_c_files, include_dirs=includes, |
extens.append(Extension('libxsltmod', xslt_c_files, include_dirs=includes, |
library_dirs=libdirs, | library_dirs=libdirs, |
libraries=libs, define_macros=macros)) |
libraries=libs, define_macros=macros)) |
|
|
if missing("MANIFEST"): |
if missing("MANIFEST"): |
Line 208 if missing("MANIFEST"):
|
Line 208 if missing("MANIFEST"):
|
for file in xml_files: |
for file in xml_files: |
manifest.write(file + "\n") |
manifest.write(file + "\n") |
if with_xslt == 1: |
if with_xslt == 1: |
for file in xslt_files: | for file in xslt_files: |
manifest.write(file + "\n") | manifest.write(file + "\n") |
manifest.close() |
manifest.close() |
|
|
if WITHDLLS: |
if WITHDLLS: |