summaryrefslogtreecommitdiff
path: root/textproc
diff options
context:
space:
mode:
authorminskim <minskim@pkgsrc.org>2004-04-10 09:02:06 +0000
committerminskim <minskim@pkgsrc.org>2004-04-10 09:02:06 +0000
commit4d60fe28a355a94b375331c59a2b3e0d6acdff0d (patch)
tree0197a71e9cd6b2e567098235cbb412904478e5c5 /textproc
parentbf6230a1f0323a8865eaabc067b8d19bcbd2dd9e (diff)
downloadpkgsrc-4d60fe28a355a94b375331c59a2b3e0d6acdff0d.tar.gz
Update py-libxslt to 1.1.5.
Changes since 1.1.2: - patch for OS-X - enums export
Diffstat (limited to 'textproc')
-rw-r--r--textproc/py-libxslt/Makefile26
-rw-r--r--textproc/py-libxslt/distinfo7
-rwxr-xr-xtextproc/py-libxslt/files/setup.py214
-rw-r--r--textproc/py-libxslt/patches/patch-aa55
4 files changed, 233 insertions, 69 deletions
diff --git a/textproc/py-libxslt/Makefile b/textproc/py-libxslt/Makefile
index f4a0ae50605..c9402f19d19 100644
--- a/textproc/py-libxslt/Makefile
+++ b/textproc/py-libxslt/Makefile
@@ -1,30 +1,32 @@
-# $NetBSD: Makefile,v 1.4 2004/02/12 16:22:51 minskim Exp $
+# $NetBSD: Makefile,v 1.5 2004/04/10 09:02:06 minskim Exp $
-DISTNAME= libxml2-python-${LIBXML_VERSION}
-PKGNAME= ${PYPKGPREFIX}-libxslt-1.1.2
-PKGREVISION= 1
+DISTNAME= libxslt-1.1.5
+PKGNAME= ${PYPKGPREFIX}-${DISTNAME}
CATEGORIES= textproc
-MASTER_SITES= ftp://xmlsoft.org/python/
+MASTER_SITES= ${MASTER_SITE_GNOME:=sources/libxslt/1.1/}
+EXTRACT_SUFX= .tar.bz2
MAINTAINER= minskim@NetBSD.org
HOMEPAGE= http://xmlsoft.org/XSLT/
COMMENT= Python wrapper for libxslt
-DEPENDS+= ${PYPKGPREFIX}-libxml2>=${LIBXML_VERSION}:../../textproc/py-libxml2
+DEPENDS+= ${PYPKGPREFIX}-libxml2>=2.6.8:../../textproc/py-libxml2
+WRKSRC= ${WRKDIR}/${DISTNAME}/python
PYDISTUTILSPKG= YES
+PYBINMODULE= YES
USE_BUILDLINK3= YES
NO_CONFIGURE= YES
-LIBXML_VERSION= 2.6.4
-
-MAKE_ENV+= PYLIBXSLTVERSION=${PKGVERSION}
+MAKE_ENV+= PYLIBXSLTVERSION=${PKGVERSION}
SUBST_CLASSES+= setup
SUBST_MESSAGE.setup= "Fixing hardcoded paths."
SUBST_STAGE.setup= pre-build
SUBST_FILES.setup= setup.py
-SUBST_SED.setup= -e "s,'/usr','${BUILDLINK_PREFIX.libxslt}',g"
+SUBST_SED.setup= -e "s,@LIBICONVDIR@,${BUILDLINK_PREFIX.iconv},g" \
+ -e "s,@LIBXML2DIR@,${BUILDLINK_PREFIX.libxml2},g" \
+ -e "s,@LIBXSLTDIR@,${BUILDLINK_PREFIX.libxslt},g" \
BUILDLINK_DEPENDS.libxslt= libxslt>=${PKGVERSION}
.include "../../textproc/libxslt/buildlink3.mk"
@@ -32,4 +34,8 @@ BUILDLINK_DEPENDS.libxslt= libxslt>=${PKGVERSION}
.include "../../lang/python/extension.mk"
.include "../../converters/libiconv/buildlink3.mk"
.include "../../textproc/libxml2/buildlink3.mk"
+
+post-extract:
+ ${CP} ${FILESDIR}/setup.py ${WRKSRC}
+
.include "../../mk/bsd.pkg.mk"
diff --git a/textproc/py-libxslt/distinfo b/textproc/py-libxslt/distinfo
index a96a5e4d562..c1622f1d9e4 100644
--- a/textproc/py-libxslt/distinfo
+++ b/textproc/py-libxslt/distinfo
@@ -1,5 +1,4 @@
-$NetBSD: distinfo,v 1.1.1.1 2004/01/04 11:48:30 recht Exp $
+$NetBSD: distinfo,v 1.2 2004/04/10 09:02:06 minskim Exp $
-SHA1 (libxml2-python-2.6.4.tar.gz) = 320f50a6dde61d157eef7c804dce2ba5bfee1470
-Size (libxml2-python-2.6.4.tar.gz) = 197009 bytes
-SHA1 (patch-aa) = b13a62a16d65bc2ed768a576a898b2fe3d03d45f
+SHA1 (libxslt-1.1.5.tar.bz2) = a9b0ad31a438c7ea838314d616db8583aab6d447
+Size (libxslt-1.1.5.tar.bz2) = 1751266 bytes
diff --git a/textproc/py-libxslt/files/setup.py b/textproc/py-libxslt/files/setup.py
new file mode 100755
index 00000000000..56b43e52df3
--- /dev/null
+++ b/textproc/py-libxslt/files/setup.py
@@ -0,0 +1,214 @@
+#!/usr/bin/python -u
+#
+# Setup script for libxslt
+#
+import sys, os
+from distutils.core import setup, Extension
+
+# Thread-enabled libxml2
+with_threads = 1
+
+# If this flag is set (windows only),
+# a private copy of the dlls are included in the package.
+# If this flag is not set, the libxml2 and libxslt
+# dlls must be found somewhere in the PATH at runtime.
+WITHDLLS = 1 and sys.platform.startswith('win')
+
+def missing(file):
+ if os.access(file, os.R_OK) == 0:
+ return 1
+ return 0
+
+try:
+ HOME = os.environ['HOME']
+except:
+ HOME="C:"
+
+if sys.platform.startswith('win'):
+ libraryPrefix = 'lib'
+ platformLibs = []
+else:
+ libraryPrefix = ''
+ platformLibs = ["m","z"]
+
+# those are examined to find
+# - libxml2/libxml/tree.h
+# - iconv.h
+# - libxslt/xsltconfig.h
+includes_dir = [
+"@LIBICONVDIR@/include",
+"@LIBXML2DIR@/include",
+"@LIBXSLTDIR@/include"
+];
+
+xml_includes=""
+for dir in includes_dir:
+ if not missing(dir + "/libxml2/libxml/tree.h"):
+ xml_includes=dir + "/libxml2"
+ break;
+
+if xml_includes == "":
+ print "failed to find headers for libxml2: update includes_dir"
+ sys.exit(1)
+
+iconv_includes=""
+for dir in includes_dir:
+ if not missing(dir + "/iconv.h"):
+ iconv_includes=dir
+ break;
+
+if iconv_includes == "":
+ print "failed to find headers for libiconv: update includes_dir"
+ sys.exit(1)
+
+# those are added in the linker search path for libraries
+libdirs = ["@LIBXML2DIR@/lib"]
+
+xml_files = ["libxml2-api.xml", "libxml2-python-api.xml",
+ "libxml.c", "libxml.py", "libxml_wrap.h", "types.c",
+ "xmlgenerator.py", "README", "TODO", "drv_libxml2.py"]
+
+xslt_files = ["libxslt-api.xml", "libxslt-python-api.xml",
+ "libxslt.c", "libxsl.py", "libxslt_wrap.h",
+ "generator.py"]
+
+if 0:
+ try:
+ try:
+ import xmlgenerator
+ except:
+ import generator
+ except:
+ print "failed to find and generate stubs for libxml2, aborting ..."
+ print sys.exc_type, sys.exc_value
+ sys.exit(1)
+
+ head = open("libxml.py", "r")
+ generated = open("libxml2class.py", "r")
+ result = open("libxml2.py", "w")
+ for line in head.readlines():
+ if WITHDLLS:
+ result.write(altImport(line))
+ else:
+ result.write(line)
+ for line in generated.readlines():
+ result.write(line)
+ head.close()
+ generated.close()
+ result.close()
+
+with_xslt=0
+if missing("libxslt-py.c") or missing("libxslt.py"):
+ if missing("generator.py") or missing("libxslt-python-api.xml"):
+ print "libxslt stub generator not found, libxslt not built"
+ else:
+ try:
+ import generator
+ except:
+ print "failed to generate stubs for libxslt, aborting ..."
+ print sys.exc_type, sys.exc_value
+ else:
+ head = open("libxsl.py", "r")
+ generated = open("libxsltclass.py", "r")
+ result = open("libxslt.py", "w")
+ for line in head.readlines():
+ if WITHDLLS:
+ result.write(altImport(line))
+ else:
+ result.write(line)
+ for line in generated.readlines():
+ result.write(line)
+ head.close()
+ generated.close()
+ result.close()
+ with_xslt=1
+else:
+ with_xslt=1
+
+if with_xslt == 1:
+ xslt_includes=""
+ for dir in includes_dir:
+ if not missing(dir + "/libxslt/xsltconfig.h"):
+ xslt_includes=dir + "/libxslt"
+ break;
+
+ if xslt_includes == "":
+ print "failed to find headers for libxslt: update includes_dir"
+ with_xslt = 0
+
+
+descr = "libxml2 package"
+modules = []
+c_files = []
+includes= [xml_includes, iconv_includes]
+libs = [] + platformLibs
+macros = []
+if with_threads:
+ macros.append(('_REENTRANT','1'))
+if with_xslt == 1:
+ descr = "libxslt package"
+ if not sys.platform.startswith('win'):
+ #
+ # We are gonna build 2 identical shared libs with merge initializing
+ # both libxml2mod and libxsltmod
+ #
+ c_files = c_files + ['libxslt-py.c', 'libxslt.c']
+ xslt_c_files = c_files
+ macros.append(('MERGED_MODULES', '1'))
+ else:
+ #
+ # On windows the MERGED_MODULE option is not needed
+ # (and does not work)
+ #
+ xslt_c_files = ['libxslt-py.c', 'libxslt.c', 'types.c']
+ libs.insert(0, libraryPrefix + 'exslt')
+ libs.insert(0, libraryPrefix + 'xslt')
+ includes.append(xslt_includes)
+ modules.append('libxslt')
+
+
+extens=[]
+if with_xslt == 1:
+ extens.append(Extension('libxsltmod', xslt_c_files, include_dirs=includes,
+ library_dirs=libdirs,
+ libraries=libs, define_macros=macros))
+
+if missing("MANIFEST"):
+
+ manifest = open("MANIFEST", "w")
+ manifest.write("setup.py\n")
+ for file in xml_files:
+ manifest.write(file + "\n")
+ if with_xslt == 1:
+ for file in xslt_files:
+ manifest.write(file + "\n")
+ manifest.close()
+
+if WITHDLLS:
+ ext_package = "libxmlmods"
+ if sys.version >= "2.2":
+ base = "lib/site-packages/"
+ else:
+ base = ""
+ data_files = []
+else:
+ ext_package = None
+ data_files = []
+
+setup (name = "libxslt-python",
+ # On *nix, the version number is created from setup.py.in
+ # On windows, it is set by configure.js
+ version = os.environ['PYLIBXSLTVERSION'],
+ description = descr,
+ author = "Daniel Veillard",
+ author_email = "veillard@redhat.com",
+ url = "http://xmlsoft.org/python.html",
+ licence="MIT Licence",
+ py_modules=modules,
+ ext_modules=extens,
+ ext_package=ext_package,
+ data_files=data_files,
+ )
+
+sys.exit(0)
+
diff --git a/textproc/py-libxslt/patches/patch-aa b/textproc/py-libxslt/patches/patch-aa
deleted file mode 100644
index c886a555303..00000000000
--- a/textproc/py-libxslt/patches/patch-aa
+++ /dev/null
@@ -1,55 +0,0 @@
-$NetBSD: patch-aa,v 1.1.1.1 2004/01/04 11:48:31 recht Exp $
-
---- setup.py.orig 2003-12-10 11:00:03.000000000 -0600
-+++ setup.py
-@@ -162,17 +162,15 @@ if with_xslt == 1:
-
-
- descr = "libxml2 package"
--modules = [ 'libxml2', 'drv_libxml2' ]
--if WITHDLLS:
-- modules.append('libxmlmods.__init__')
-+modules = []
- c_files = ['libxml2-py.c', 'libxml.c', 'types.c' ]
- includes= [xml_includes, iconv_includes]
--libs = [libraryPrefix + "xml2"] + platformLibs
-+libs = [] + platformLibs
- macros = []
- if with_threads:
- macros.append(('_REENTRANT','1'))
- if with_xslt == 1:
-- descr = "libxml2 and libxslt package"
-+ descr = "libxslt package"
- if not sys.platform.startswith('win'):
- #
- # We are gonna build 2 identical shared libs with merge initializing
-@@ -193,9 +191,7 @@ if with_xslt == 1:
- modules.append('libxslt')
-
-
--extens=[Extension('libxml2mod', c_files, include_dirs=includes,
-- library_dirs=libdirs,
-- libraries=libs, define_macros=macros)]
-+extens=[]
- if with_xslt == 1:
- extens.append(Extension('libxsltmod', xslt_c_files, include_dirs=includes,
- library_dirs=libdirs,
-@@ -218,15 +214,15 @@ if WITHDLLS:
- base = "lib/site-packages/"
- else:
- base = ""
-- data_files = [(base+"libxmlmods",dlls)]
-+ data_files = []
- else:
- ext_package = None
- data_files = []
-
--setup (name = "libxml2-python",
-+setup (name = "libxslt-python",
- # On *nix, the version number is created from setup.py.in
- # On windows, it is set by configure.js
-- version = "2.6.4",
-+ version = os.environ['PYLIBXSLTVERSION'],
- description = descr,
- author = "Daniel Veillard",
- author_email = "veillard@redhat.com",