1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-11-06 23:49:25 +03:00
Commit Graph

148 Commits

Author SHA1 Message Date
Nick Wellnhofer
8c2e8031b2 python: Fix tests on MinGW
Add the directories containing required DLLs with os.add_dll_directory
to make tests work on MinGW.
2023-09-05 17:00:41 +02:00
Nick Wellnhofer
6bbef7f3b7 python: Remove temp file when running tests/basic.py
Fixes make distcheck.
2023-04-26 16:37:28 +02:00
Nick Wellnhofer
eaa68b7738 xsltlocale: Make API platform-independent
Make xsltlocale.h more private. This really is an internal header.

Use LCMapStringW on Windows. Make the API platform-independent by
passing locales as `void *`.

Add support for custom locale handlers in a transform context. Update
ICU example to use these handlers.
2023-01-09 18:34:29 +01:00
Chun-wei Fan
e85d9dc54f build: Add a distutils-based build system for the Python bits
This is a streamlined version of the libxml2 setup.py.in that is
adapted for libxslt so that one can build the Python bindings and build
wheels easily, especially for Windows builds.

This will bundle the libxslt and libexslt DLLs, which matters more for
Python 3.8.x and later on Windows, where the dependent DLLs need to be
found at where the .pyd files are located unless one uses
os.add_dll_directory(); the libxml2 (and its dependent DLLs) should be
located with the libxml2-python package.
2022-11-21 16:14:31 +08:00
Chun-wei Fan
983e5fc41e python/types.c: Fix building against older libxml2
The XML_IGNORE_FPTR_CAST_WARNINGS and XML_POP_WARNINGS macros were added very
recently, so define them as nothing if they aren't defined upon including the
libxml2 headers.
2022-11-21 12:40:22 +08:00
Chun-wei Fan
966296cb9b python/libxslt.c: Replace ssize_t with Py_ssize_t
This ensures that we have the ssize_t that we want on all compilers supported
by Python, since ssize_t is not supported on Visual Studio, for instance, since
it is a POSIX type.
2022-11-21 12:38:53 +08:00
Nick Wellnhofer
971d5c4dd1 tests: Port most of the test suite to C
Use runtest.c from libxml2 as a starting point.

This finally allows us to run most of tests with CMake and Autotools
VPATH builds.
2022-09-07 22:18:55 +02:00
Nick Wellnhofer
cc64f2a78b tests: Fix out-of-tree Python tests 2022-09-07 21:09:51 +02:00
Nick Wellnhofer
5e38ecc864 autotools: Fix Python tests in VPATH builds 2022-09-06 17:32:01 +02:00
Nick Wellnhofer
f47413d137 autotools: Disable parallel Python build
See ea8f7c92a9
2022-09-06 17:32:01 +02:00
Nick Wellnhofer
f9a0817b20 autotools: Use AM_CFLAGS consistently
Don't pollute CFLAGS. Always add LIBXML_CFLAGS and LIBXSLT_CFLAGS.
2022-09-06 17:32:01 +02:00
Nick Wellnhofer
d5238cf0a2 python: Don't output missing generators during build 2022-09-06 17:32:01 +02:00
Nick Wellnhofer
1dd4a2285f python: Fix build on Windows
- Don't pollute LDFLAGS
- Also check for MSYS
2022-09-06 15:00:48 +02:00
Nick Wellnhofer
5443ca169c python: Support Python 3 on Windows
Copy updated implementation of PyFileGET from libxml2.
2022-09-06 15:00:48 +02:00
Nick Wellnhofer
a0623d9f7a Fix various compiler warnings 2022-09-01 08:19:00 +02:00
Nick Wellnhofer
33023085bf Disable Python bindings for debugger
Most of the functions couldn't be used from Python anyway.

Fixes #75.
2022-08-31 17:42:12 +02:00
Nick Wellnhofer
fc3601b906 Set library path when running Python tests
Copied from libxml2.

Should fix #75.
2022-08-29 20:44:20 +02:00
Nick Wellnhofer
43e3b41def Migrate from PyEval_ to PyObject_
PyEval_ functions are deprecated.
2022-08-29 17:23:35 +02:00
Nick Wellnhofer
0d48888bc8 Also clean up __pycache__ 2022-08-29 16:29:34 +02:00
Nick Wellnhofer
7a4a1c63f0 Remove generated files from distribution
- libxslt.spec
- python/libxslt.py

Also prefer 'dist_' prefix over EXTRA_DIST.
2022-08-29 16:29:34 +02:00
Nick Wellnhofer
940e59939d Don't mess with xmlDefaultSAXHandler
This is deprecated and shouldn't have any effect.
2022-08-26 04:32:18 +02:00
Mike Dalessio
3f3e888f1a Add missing compile definition for static builds to Autotools
Related to eaa53788 and 29923816

Closes #73
2022-08-20 13:50:46 -04:00
Nick Wellnhofer
36bbe5ab3c Remove case labels with XPointer location types 2022-04-21 04:56:49 +02:00
David Seifert
02c6ce836c Use portable python shebangs
* In conda or Gentoo Prefix, we don't want to use the system python and
  instead rely on PATH lookup.
2022-04-05 11:45:23 +02:00
David Seifert
b06c0ba5ba python/Makefile.am: nest python docs in $(docdir) 2022-04-02 14:30:15 +02:00
David Seifert
23012544eb python/Makefile.am: rely on global AM_INIT_AUTOMAKE
* Even Debian oldoldstable has Automake 1.15 available nowadays.
2022-04-02 14:30:14 +02:00
David Seifert
a5a32b9382 Use AM_PATH_PYTHON/PKG_CHECK_MODULES for python bindings
* `AM_PATH_PYTHON` is a much more common idiom for building
  and installing python modules than writing your own.
* It also makes cross-compiling the python bindings possible.
  Previously the `PYTHON_CFLAGS`/`PYTHON_LIBS` would have been
  based on the `--build` python and not the `--host` python.
  By using `pkg-config`, we can always redirect the python-X.Y.pc.
2022-04-02 13:17:54 +02:00
Nick Wellnhofer
22f12ce58e Stop calling deprecated libxml2 init functions 2022-03-18 15:38:40 +01:00
Nick Wellnhofer
05cea0c72c Update links
Documentation and releases are now available on gitlab.gnome.org.
2022-02-14 22:31:18 +01:00
Nick Wellnhofer
b3076bccdb Finish and clean up Python 3 support
- Handle Python 3 types similar to libxml2
- Copy new versions of libxml_xmlXPathDestructNsNode and
  libxml_xmlXPathObjectPtrConvert from libxml2
- Fix compiler warnings
- Fix whitespace
- Remove unneeded imports from __future__
- Remove test in extelem.py (StringIO can't be converted to FILE under
  Python 3)
- string.lower() works in both Python 2 and 3

Closes #25.
2020-11-19 17:59:37 +01:00
Suleyman Poyraz
a2db8da1ac Initial support for Python 3
Squashed merge of pull request !19.
2020-11-19 17:08:37 +01:00
Daniel Veillard
e9709fa901 Candidate release 1 of libxslt 1.1.34
* doc/xsltproc.xml: moved to new place for docbook stylesheet and work
  around a missing / inrewrite of  docbook xsl catalog in Fedora 30
* tests/fuzz/Makefile.am: add fuzz.h to sources
* python/Makefile.am: there is no more TODO
* libxslt.spec.in: run make tests instead of check to avoid fuzz in that
  environment, and drop python TODO
2019-10-23 20:49:08 +02:00
Nick Wellnhofer
7a9b9e5300 Remove empty TODO file 2019-10-21 12:53:46 +02:00
Nick Wellnhofer
5307ec9978 Remove generated file libxsltclass.txt from version control 2019-10-21 12:52:54 +02:00
Nick Wellnhofer
47c8300023 Make sure that Python tests exit with error code 2019-10-21 12:52:41 +02:00
Nick Wellnhofer
e176258ef6 Remove WIN32_EXTRA_* variables
Simply use LDFLAGS and LIBS instead.
2019-02-12 12:31:20 +01:00
Nick Wellnhofer
d5d511f0b7 Fix vsnprintf in Python bindings on Windows
- Fix vsnprintf on older MSVC versions
- Stop using _vsnprintf on MinGW
2019-02-12 12:31:20 +01:00
Nick Wellnhofer
51b79bfa90 Fix callback signatures in Python bindings 2018-01-16 19:04:33 +01:00
Nick Wellnhofer
3bea417b5e Fix extension callback signatures 2017-11-29 16:52:13 +01:00
Nick Wellnhofer
9210e72590 Fix typos
Fixes bug 788668.
2017-11-04 16:07:59 +01:00
Nick Wellnhofer
8760bb2276 Fix Windows compiler warnings
Fixes bug 788317. Thanks to J. Peter Mugaas for the initial patch.
2017-10-25 16:21:23 +02:00
Nick Wellnhofer
477f5779ed Fix compiler warnings in Python bindings 2017-10-08 14:26:56 +02:00
Daniel Veillard
90e8b9066d Fix a couple of places where (f)printf parameters were broken
As reported by Thomas Jarosch <thomas.jarosch@intra2net.com>
2013-01-30 17:31:37 +01:00
Alexandre Rostovtsev
358bd4e46c Fix python build by using libxsltmod_la_CPPFLAGS instead of AM_CPPFLAGS
Commit a2cd8a03 broke the --with-python build by moving includes from
INCLUDES to AM_CPPFLAGS. AM_CPPFLAGS gets ignored when a target-specific
*_CPPFLAGS variable exists, but at least some automake versions
automatically add "libxsltmod_la_CPPFLAGS = -shared" to python/Makefile.in

https://bugzilla.gnome.org/show_bug.cgi?id=684637
2012-11-21 14:25:45 +08:00
Daniel Veillard
a27de70018 Release of libxslt-1.1.27
* configure.in doc/symbols.xml doc/xslt.html: updated for the release
* NEWS config.h.in doc/* */*.syms : regenerated
2012-09-12 14:37:09 +08:00
Daniel Veillard
0ca0a15ffb Big space and tabs cleanup
Remove spaces followed by tabs, and space and tabs at the end of lines
2012-09-12 14:07:24 +08:00
Daniel Veillard
39b0c27af8 Remove .cvsignore files which are not needed anymore 2012-09-04 14:28:28 +08:00
Daniel Richard G
a2cd8a03ac Various "make distcheck" and other fixes
Makefile.am:

* Use $(VAR), not @VAR@, as the former is the correct form for AC_SUBST'ed
   variables in Makefile.am files

* Touch these *.xml/*.syms files in the "dist-hook" target to prevent them
   from being regenerated, because the "make dist" process in itself
   updates the timestamps of the source files when it copies them into
   $(distdir)

* Add EXTRA_LIBS (-lrt on my system) to xsltConf.sh, as this is a required
   dependency when client applications link against -lxslt

   (note that the definition of EXTRA_LIBS has been changed; see below)

* Removed MAKEFLAGS+=--silent bits, as this is not compatible with non-GNU
   Make programs

autogen.sh:

* Add --warnings=all options to automake and autoconf invocations, to
   better catch potential problems (most of which I've fixed in this patch)

configure.in:

* Replaced obsolete macros with their current equivalents; for reference,
   see

     http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html

   (I removed AC_ISC_POSIX outright because the doc states it is no longer
   useful)

* test(1) uses "=" as an operator, not "=="

* Fixed quoting on an AC_LINK_IFELSE() invocation to quell Autoconf errors

* Don't add redundant libraries to EXTRA_LIBS, because (1) this variable
   already contains LibXSLT's own additional system-library deps, and is
   useful in that form, and (2) the LibXML2 deps are already handled by
   Libtool

* Don't delete files in srcdir, and don't create the symlink to
   "Copyright" there either

   (I don't understand why this is being symlinked in the first place...)

doc/Makefile.am:

* Can't use wildcards in EXTRA_DIST, because this breaks dependencies
   (e.g. you can't "make EXSLT/\*.html"), and they only work properly when
   building inside the source tree; these have been replaced with their
   expansions. Other entries have been added here in lieu of the wildcards
   in the dist-hook target, as well as opportunistic use of the $(*PAGES)
   variables.

* Don't define an "all" target, because this steps on Automake's toes; use
   "all-local" instead

* Define and use an "xsltproc" variable to reference an in-tree-built
   version of xsltproc, instead of e.g. $(bindir)/xsltproc

   NOTE: The makefile also uses $(XSLTPROC), which names an external
   instance of the program found at configure time. Some instances of this
   could probably be changed to $(xsltproc) to remove the dependency on an
   existing installed program.

* Qualified various filenames as appropriate with $(srcdir)

* Use $(XMLLINT) consistently instead of $(bindir)/xmllint

* In the "libxslt-api.xml ..." rule, cd into $(srcdir) before invoking
   apibuild.py as this script has to run in srcdir anyway

* In the "clean-local" rule, clear out some additional files to allow
   "make distcheck" to pass

* Eliminated the redundant "maintainer-clean-local" rule

* Added a "distclean-local" rule to clear out the build directory in an
   out-of-source build to allow "make distcheck" to pass

* Added a "check-extra-dist" target to make it easier to check that
   EXTRA_DIST isn't missing anything

* Use $(MKDIR_P), not $(mkinstalldirs), as the latter name is obsolete

* Use $(VAR) instead of @VAR@

* The "dist-hook" target didn't work (if any generated files were in
   builddir and not in srcdir), and is no longer needed thanks to the
   comprehensive EXTRA_DIST variable

* Added an "uninstall-local" rule to allow "make distcheck" to pass

* Updated the .PHONY target list, removed non-existent targets

doc/symbols.xml:

* Needed to add this bit to make the generation scripts shut up

libexslt/Makefile.am:

* AM_CPPFLAGS should be used instead of INCLUDES, as the latter is an
   obsolete name

* Moved $(LIBXML_CFLAGS) to AM_CFLAGS, to segregate CFLAGS from CPPFLAGS

   (Note that $(CFLAGS) need not be added to AM_CFLAGS, because Automake
   already references both in the build rules)

* Use $(VAR) instead of @VAR@

libxslt.pc.in:

* Add EXTRA_LIBS (-lrt on my system), as this is a required dependency
   when client applications link against -lxslt

libxslt/Makefile.am:

* AM_CPPFLAGS should be used instead of INCLUDES, as the latter is an
   obsolete name

* Moved $(LIBXML_CFLAGS) to AM_CFLAGS, to segregate CFLAGS from CPPFLAGS

* Use $(VAR) instead of @VAR@, $(MKDIR_P) instead of $(mkinstalldirs)

* Use $(MKDIR_P), not $(mkinstalldirs), as the latter name is obsolete

libxslt/xsltutils.c:

* Some systems don't know about CLOCK_MONOTONIC; older Solaris knows about
   CLOCK_HIGHRES. Some systems, alas, have no usable alternative to
   CLOCK_REALTIME.

python/Makefile.am:

* AM_CPPFLAGS should be used instead of INCLUDES, as the latter is an
   obsolete name

* Moved $(LIBXML_CFLAGS) to AM_CFLAGS, to segregate CFLAGS from CPPFLAGS

* Because libxslt-py.c is (presumably) supposed to be generated every time
   at build time, don't bundle it in the dist tarball

* Use $(VAR) instead of @VAR@

* libxsltclass.py is a generated file, so it doesn't get qualified with
   $(srcdir)

* Use $(MKDIR_P) instead of (mkinstalldirs)

* Added an uninstall-local rule so that "make distcheck" passes

* Removed the $(srcdir) qualifications in the GENERATED file list, as
   these files may exist in builddir

* In the gen_prog rule, qualify the script invocation with $(srcdir), and
   set the SRCDIR environment variable so that the script can find the
   files it needs when builddir != srcdir

* Don't define an "all" target, as this steps on Automake's toes

python/generator.py:

* Get the source directory from the SRCDIR environment variable, and use
   it appropriately

python/tests/Makefile.am:

* Set CLEANFILES instead of defining a "clean" rule

* Use $(VAR) instead of @VAR@, $(MKDIR_P) instead of $(mkinstalldirs)

tests/*/Makefile.am, tests/exslt/*/Makefile.am:

* Need to clean up .memdump files for "make distcheck" to pass

* Don't define an "all" target, as this steps on Automake's toes

tests/REC/Makefile.am:

* Added two missing *.stand.out files to EXTRA_DIST

tests/XSLTMark/Makefile.am:

* Replaced the GNU-Make-specific %.out bit with a more broadly compatible
   rule

   (the "dummy" bit shuts up Automake)

* Use "$(xsltproc)" instead of "$(top_builddir)/xsltproc/xsltproc"

* Use a less $(MAKE)-heavy invocation in the "tests" target

* Replaced a conflicting "clean" target with CLEANFILES

* Added a dependency on $(xsltproc) to all the test targets

* Added a .PHONY target list

tests/docbook/Makefile.am:

* Ditched the "echo -n" bit, because it wasn't working as advertised

* Create output directories for out-of-source builds

* "$(basename $$i)" is a typo in a makefile

* Don't embed $(srcdir) in $out/$html/$fo/$msg/$xhtml, so that we can
   refer to these files in builddir or srcdir

* Add a trailing "echo" to complete the "echo -n"

* Don't output files unconditionally to srcdir (it may be read-only, for
   starters)

tests/plugins/Makefile.am:

* AM_CPPFLAGS should be used instead of INCLUDES, as the latter is an
   obsolete name

   (Note that the "$(LIBXML_CFLAGS) $(LIBXSLT_CFLAGS)" bit that was here
   can be dropped entirely, because these already appear in
   xmlsoft_org_xslt_testplugin_la_CFLAGS)

* Use noinst_LTLIBRARIES inside the WITH_MODULES conditional instead of
   EXTRA_LTLIBRARIES, as this is cleaner (and disallows building the plugin
   if module support is disabled)

* Need to clean up *.res files for "make distcheck" to pass

* Use the abs_builddir variable conveniently provided to us by Automake
   instead of a GNU Make $(shell ...) construct

xslt-config.in:

* Add EXTRA_LIBS (-lrt on my system), as this is a required dependency
   when client applications link against -lxslt

xsltproc/Makefile.am:

* AM_CPPFLAGS should be used instead of INCLUDES, as the latter is an
   obsolete name

* Moved $(LIBXML_CFLAGS) into AM_CFLAGS

* Use $(VAR) instead of @VAR@

* Need to clean .memdump for "make distcheck" to pass

* Added rules to build lib[e]xslt.la if needed, which allows test
   makefiles to build xsltproc on the fly even if nothing else has been
   built already

* Create .memdump file in the "tests" target, as it's being grepped
   afterward
2012-08-09 19:46:03 +08:00
Daniel Veillard
afa29e64cc Fix python generator to not use deprecated xmllib
* python/generator.py: use xml.sax instead, patch based on similar
  fix for libvirt by Cole Robinson <crobinso@redhat.com>
2010-01-13 15:41:06 +01:00
Frederic Crozat
a1981a0da0 link python module with python library
libxslt python module wasn't linked with python library
* configure.in python/Makefile.am: detect and add appropriate linking
  flags
2009-09-24 18:16:07 +02:00