Commit Graph
15 Commits
Author SHA1 Message Date
Xisco Fauli 47e110fc66 tdf#162786, tdf#161947: Add support for setuptools and pip
For that, just unzip the wheel files to the Lib directory

Change-Id: I3998e427aeadb840b626ebbb6ce91938de47d2b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180271
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2025-01-21 22:05:50 +01:00
Xisco Fauli b2ae2fa78f lxml: ignore warnings when calling setup.py build too
Reverts dc97b366ab
"python3: silence distutils deprecated warning"
and f41773d684
"python3: silence distutils deprecated warning (take 2)"
and c920605dd4
"external/lxml: Fix --enable-python=fully-internal build"

Change-Id: I9131fa5ac22cf4f0279e7bf0edc5c50b61845044
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170206
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-07-09 16:37:02 +02:00
Xisco Fauli 6dc23b7bff lxml: do not apply replace-setuptools-with-distutils on macosx
it has setuptools support

Change-Id: Ia66d3e6398044fc6ae8ac1f70afc3a8fdf23fe2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170175
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2024-07-09 16:30:52 +02:00
Xisco Fauli f52dc148f2 lxml: ignore warnings when calling setup
Since a1295cb177
"python: upgrade to 3.10.14 (master only)"

macosx builds with:
Building lxml version 5.2.2.
Building without Cython.
Building against libxml2 2.9.4 and libxslt 1.1.29
Building against libxml2/libxslt in the following directory: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
running install
Traceback (most recent call last):
  File "/Users/libreoffice/releases/r/workdir/UnpackedTarball/lxml/setup.py", line 208, in <module>
    setup(
  File "/Users/libreoffice/releases/r/workdir/UnpackedTarball/python3/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/__init__.py", line 87, in setup
    return distutils.core.setup(**attrs)
  File "/Users/libreoffice/releases/r/workdir/UnpackedTarball/python3/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/Users/libreoffice/releases/r/workdir/UnpackedTarball/python3/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/Users/libreoffice/releases/r/workdir/UnpackedTarball/python3/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands
    self.run_command(cmd)
  File "/Users/libreoffice/releases/r/workdir/UnpackedTarball/python3/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 1217, in run_command
    super().run_command(command)
  File "/Users/libreoffice/releases/r/workdir/UnpackedTarball/python3/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 985, in run_command
    cmd_obj = self.get_command_obj(command)
  File "/Users/libreoffice/releases/r/workdir/UnpackedTarball/python3/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 860, in get_command_obj
    cmd_obj = self.command_obj[command] = klass(self)
  File "/Users/libreoffice/releases/r/workdir/UnpackedTarball/python3/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/__init__.py", line 158, in __init__
    super().__init__(dist)
  File "/Users/libreoffice/releases/r/workdir/UnpackedTarball/python3/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 64, in __init__
    self.initialize_options()
  File "/Users/libreoffice/releases/r/workdir/UnpackedTarball/python3/python-inst/@__________________________________________________OOO/LibreOfficePython.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/install.py", line 34, in initialize_options
    warnings.warn(
setuptools._deprecation_warning.SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
/Users/libreoffice/releases/libo-core/external/lxml/ExternalProject_lxml.mk:25: recipe for target '/Users/libreoffice/releases/r/workdir/ExternalProject/lxml/build' failed
make[1]: *** [/Users/libreoffice/releases/r/workdir/ExternalProject/lxml/build] Error 1
Makefile:125: recipe for target 'lxml' failed
make: *** [lxml] Error 2

Because we bundle setuptools on macosx, and for that reason,
this deprecationwarning is triggered. In the long run,
external/lxml/ExternalProject_lxml.mk should be changed to
use build and pip as the message says, but for now, just
ignore the warnings.

Change-Id: I05373363aba746fa40e5039c08aaa0f320908c24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170205
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-07-09 16:04:24 +02:00
Xisco Fauli 606623d0fc lxml: upgrade to 5.2.1
* 0001-Make-regexp-string-raw-to-correct-its-escape-sequenc.patch.1 got
  obsoleted with https://github.com/lxml/lxml/commit/9686dd9c7670d18acff6360c8444520273d5f1b2

* Wincompatible-function-pointer-types.patch and
Wincompatible-pointer-types.patch got obsoleted with
https://github.com/lxml/lxml/commit/6bdf4c321b92e002123b4c162c75524dbeb4d54d

Change-Id: I8f0dcba3bd64a1766a2292b687c8959c739ced6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167278
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2024-05-07 15:38:36 +02:00
Christian Lohmaier 875a1bf2e1 makefile simplification: replace $(call gb_UnpackedTarball_get_dir,foo)
…by a simple/static $(gb_UnpackedTarball_workdir)/foo
see also 0c4c84a14b

Change-Id: I8e6aa55c85534c4446556548910c950ddbe7c6fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167163
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
2024-05-06 11:40:45 +02:00
Stephan Bergmann f09b9b2785 external/lxml: Silence -Wincompatible-pointer-types
...as seen with recent GCC 14 trunk,

> gcc -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -g -O0 -Wall -I/home/sberg/lo/core/workdir/UnpackedTarball/zlib -I/home/sberg/lo/core/workdir/UnpackedTarball/python3 -I/home/sberg/lo/core/workdir/UnpackedTarball/python3/Include -fPIC -DCYTHON_CLINE_IN_TRACEBACK=0 -I/home/sberg/lo/core/workdir/UnpackedTarball/libxml2/include -I/home/sberg/lo/core/workdir/UnpackedTarball/libxslt -Isrc -Isrc/lxml/includes -I/home/sberg/lo/core/workdir/UnpackedTarball/python3/Include -I/home/sberg/lo/core/workdir/UnpackedTarball/python3 -c src/lxml/etree.c -o build/temp.linux-x86_64-3.8-pydebug/src/lxml/etree.o -w
> src/lxml/etree.c: In function ‘__pyx_pf_4lxml_5etree_11TreeBuilder_4data’:
> src/lxml/etree.c:137698:66: error: passing argument 1 of ‘__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData’ from incompatible pointer type [-Wincompatible-pointer-types]
> 137698 |   __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_data); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 832, __pyx_L1_error)
>        |                                                                 ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>        |                                                                  |
>        |                                                                  struct __pyx_obj_4lxml_5etree__SaxParserTarget *
> src/lxml/etree.c:137074:105: note: expected ‘struct __pyx_obj_4lxml_5etree_TreeBuilder *’ but argument is of type ‘struct __pyx_obj_4lxml_5etree__SaxParserTarget *’
> 137074 | static int __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self, PyObject *__pyx_v_data) {
>        |                                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~

etc.

Change-Id: I19f6768bf031c04730972c1fa4a006e2a7d50e27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165758
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-04-03 21:36:29 +02:00
Stephan Bergmann 7a63830a47 external/lxml: Silence -Wincompatible-function-pointer-types
...with Clang since
<https://github.com/llvm/llvm-project/commit/af01f717c48f0fd2481600ed6c00441763365b62>
"Default implicit function pointer conversions diagnostic to be an error",
causing

> src/lxml/etree.c:113121:38: error: incompatible function pointer types assigning to 'xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') from 'void (void *, xmlError *)' (aka 'void (void *, struct _xmlError *)') [-Wincompatible-function-pointer-types]
>  113121 |   __pyx_v_self->_c_ctxt->sax->serror = __pyx_f_4lxml_5etree__receiveParserError;
>         |                                      ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> src/lxml/etree.c:117609:25: error: incompatible function pointer types assigning to 'xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') from 'void (void *, xmlError *)' (aka 'void (void *, struct _xmlError *)') [-Wincompatible-function-pointer-types]
>  117609 |     __pyx_v_sax->serror = __pyx_f_4lxml_5etree__receiveParserError;
>         |                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> src/lxml/etree.c:181693:28: error: incompatible function pointer types assigning to 'xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') from 'void (void *, xmlError *)' (aka 'void (void *, struct _xmlError *)') [-Wincompatible-function-pointer-types]
>  181693 |   __pyx_v_xpathCtxt->error = __pyx_f_4lxml_5etree__receiveXPathError;
>         |                            ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> src/lxml/etree.c:218967:60: error: incompatible function pointer types passing 'void (void *, xmlError *)' (aka 'void (void *, struct _xmlError *)') to parameter of type 'xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') [-Wincompatible-function-pointer-types]
>  218967 |   xmlRelaxNGSetParserStructuredErrors(__pyx_v_parser_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log));
>         |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> workdir/UnpackedTarball/libxml2/include/libxml/relaxng.h:156:30: note: passing argument to parameter 'serror' here
>   156 |                                          xmlStructuredErrorFunc serror,
>       |                                                                 ^
> src/lxml/etree.c:219385:60: error: incompatible function pointer types passing 'void (void *, xmlError *)' (aka 'void (void *, struct _xmlError *)') to parameter of type 'xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') [-Wincompatible-function-pointer-types]
>  219385 |     xmlRelaxNGSetValidStructuredErrors(__pyx_v_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log));
>         |                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> workdir/UnpackedTarball/libxml2/include/libxml/relaxng.h:185:31: note: passing argument to parameter 'serror' here
>   185 |                                           xmlStructuredErrorFunc serror, void *ctx);
>       |                                                                  ^
> src/lxml/etree.c:220274:59: error: incompatible function pointer types passing 'void (void *, xmlError *)' (aka 'void (void *, struct _xmlError *)') to parameter of type 'xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') [-Wincompatible-function-pointer-types]
>  220274 |   xmlSchemaSetParserStructuredErrors(__pyx_v_parser_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log));
>         |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> workdir/UnpackedTarball/libxml2/include/libxml/xmlschemas.h:156:30: note: passing argument to parameter 'serror' here
>   156 |                                          xmlStructuredErrorFunc serror,
>       |                                                                 ^
> src/lxml/etree.c:220817:59: error: incompatible function pointer types passing 'void (void *, xmlError *)' (aka 'void (void *, struct _xmlError *)') to parameter of type 'xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') [-Wincompatible-function-pointer-types]
>  220817 |     xmlSchemaSetValidStructuredErrors(__pyx_v_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log));
>         |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> workdir/UnpackedTarball/libxml2/include/libxml/xmlschemas.h:185:30: note: passing argument to parameter 'serror' here
>   185 |                                          xmlStructuredErrorFunc serror,
>       |                                                                 ^
> src/lxml/etree.c:221582:66: error: incompatible function pointer types passing 'void (void *, xmlError *)' (aka 'void (void *, struct _xmlError *)') to parameter of type 'xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') [-Wincompatible-function-pointer-types]
>  221582 |     xmlSchemaSetValidStructuredErrors(__pyx_v_self->_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_error_log));
>         |                                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> workdir/UnpackedTarball/libxml2/include/libxml/xmlschemas.h:185:30: note: passing argument to parameter 'serror' here
>   185 |                                          xmlStructuredErrorFunc serror,
>       |                                                                 ^
> src/lxml/etree.c:222759:63: error: incompatible function pointer types passing 'void (void *, xmlError *)' (aka 'void (void *, struct _xmlError *)') to parameter of type 'xmlStructuredErrorFunc' (aka 'void (*)(void *, const struct _xmlError *)') [-Wincompatible-function-pointer-types]
>  222759 |     xmlSchematronSetValidStructuredErrors(__pyx_v_valid_ctxt, __pyx_f_4lxml_5etree__receiveError, ((void *)__pyx_v_self->__pyx_base._error_log));
>         |                                                               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> workdir/UnpackedTarball/libxml2/include/libxml/schematron.h:106:31: note: passing argument to parameter 'serror' here
>   106 |                                           xmlStructuredErrorFunc serror,
>       |                                                                  ^

Change-Id: I98d1861acfe364d8f83aaca26100dc2c9729ec33
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161669
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-01-05 17:54:25 +01:00
Michael Weghorn c920605dd4 external/lxml: Fix --enable-python=fully-internal build
After

    commit a4b4a90557
    Date:   Sun Jul 2 14:54:23 2023 +0900

        lxml: upgrade to release 4.9.2

, my `--enable-python=fully-internal` build started
to fail with

    Building lxml version 4.9.2.
    Building without Cython.
    Building against libxml2 2.9.14 and libxslt 1.1.35
    Traceback (most recent call last):
      File "setup.py", line 207, in <module>
        setup(
      File ".../libreoffice/instdir/program/python-core-3.8.18/lib/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File ".../libreoffice/instdir/program/python-core-3.8.18/lib/distutils/dist.py", line 274, in __init__
        warnings.warn(msg)
    UserWarning: Unknown distribution option: 'project_urls'
    make[1]: *** [.../libreoffice/external/lxml/ExternalProject_lxml.mk:26: .../libreoffice/workdir/ExternalProject/lxml/build] Error 1
    make[1]: *** Waiting for unfinished jobs....
    make: *** [Makefile:289: build] Error 2

and Julien reports the same in [1].

The above commit includes a patch to switch from
setuptools to distutils.
Possibly the distutils variant of the `setup` function
doesn't know about the "project_urls" keyword argument
(at least in our bundled Python version),
so extend the patch to drop that from the
`setup.py`.

[1] https://gerrit.libreoffice.org/c/core/+/153863

Change-Id: Icfac9fb0a3c62d3b30c12bc23ddbc0f9b088d788
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158230
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-10-20 13:19:57 +02:00
Taichi Haradaguchi a4b4a90557 lxml: upgrade to release 4.9.2
* external/lxml/Wincompatible-function-pointer-types.patch: fixed upstream.
* backport external/lxml/0001-Make-regexp-string-raw-to-correct-its-escape-sequenc.patch.1
  from <https://github.com/lxml/lxml/pull/371>.

Changelog: https://lxml.de/4.9/changes-4.9.2.html

Change-Id: I8ea947b3b1fb30b9427d066bd41a5d4693ceedbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153863
Tested-by: Jenkins
Reviewed-by: Taichi Haradaguchi <20001722@ymail.ne.jp>
2023-10-20 02:23:12 +02:00
Stephan Bergmann ae7efecd24 external/lxml: Fix -Wincompatible-function-pointer-types
...with recent Clang 16 trunk since
<https://github.com/llvm/llvm-project/commit/af01f717c48f0fd2481600ed6c00441763365b62>
"Default implicit function pointer conversions diagnostic to be an error",
causing

> src/lxml/etree.c:175589:60: error: incompatible function pointer types passing 'void (void *, void *, xmlChar *)' (aka 'void (void *, void *, unsigned char *)') to parameter of type 'xmlHashScanner' (aka 'void (*)(void *, void *, const unsigned char *)') [-Wincompatible-function-pointer-types]
>   xmlHashScan(__pyx_v_self->__pyx_base._xpathCtxt->nsHash, __pyx_f_4lxml_5etree__registerExsltFunctionsForNamespaces, __pyx_v_self->__pyx_base._xpathCtxt);
>                                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> workdir/UnpackedTarball/libxml2/include/libxml/hash.h:213:22: note: passing argument to parameter 'f' here
>                                          xmlHashScanner f,
>                                                         ^

Change-Id: I2a359ed0dfdfa83b49fb03f447967a6d0ff73989
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138266
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-15 11:17:41 +02:00
Michael Stahl d3a136dfb7 lxml: try to remove some quirky PYPATH stuff
In RepositoryExternal.mk, a system python automatically gets $PYPATH
added to $PYTHONPATH, but the internal one does not - this doesn't make
sense.

Try to remove it for system-case by fixing the one case that relies on
it and for which it was introduced in commit
84ef6d8254 to directly extend $PYTHONPATH
instead, which ought to work as long as it's not evaluated at global
scope and thereby avoids affecting all python invocations.

Change-Id: I4534f2be92b850dc01193cb1bb2e0a299a5152be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91748
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-04-06 18:01:48 +02:00
Luboš Luňák 0adc9b615f GBUILD_TRACE, support for finding out where the build time is spent
See instructions in solenv/gbuild/Trace.mk . This generates a file than
can be viewed e.g. in the Chromium tracing view.

Change-Id: I5f90647c58ca729375525b6daed2d4918adc8188
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88754
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2020-02-16 14:49:45 +01:00
Stephan Bergmann 221413dc6f Make rebuild of external/lxml work
...if any of its dependencies have changed

Change-Id: If0ddad0f70dfca201578eefdbd7a153fbea2660b
2018-04-09 08:47:06 +02:00
Samuel Thibault 84ef6d8254 Build external lxml if not provided by system
except on windows, where gla11y will resort to python's internal xml parser,
which does not provide line numbers.

This allows gla11y to be runnable on all systems.

Change-Id: Ica4eb90f59bddfcefd783fc2ed9c8c27357e7572
Reviewed-on: https://gerrit.libreoffice.org/50115
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-02-28 22:54:21 +01:00