Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 632214 - dev-libs/libxslt: no locale support with >=sys-libs/glibc-2.26
Summary: dev-libs/libxslt: no locale support with >=sys-libs/glibc-2.26
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on: 637310
Blocks: xlocale.h
  Show dependency tree
 
Reported: 2017-09-28 02:52 UTC by Quentin Minster
Modified: 2018-04-28 18:30 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
libxslt-1.1.30-locale-support-glibc-2.26.patch (file_632214.txt,938 bytes, text/plain)
2017-09-28 02:52 UTC, Quentin Minster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Quentin Minster 2017-09-28 02:52:28 UTC
Created attachment 496790 [details]
libxslt-1.1.30-locale-support-glibc-2.26.patch

Since version 2.26, glibc removed the 'xlocale.h' header (see [1]).
Thus when building libxslt, the configure script fails to find it and disables locale support in libxslt entirely (this can be seen in /usr/include/x86_64-pc-linux-gnu/libxslt/xsltconfig.h, around lines 129-137).

Attached is a patch to only include 'xlocale.h' for versions of glibc below 2.26. The patch also touches configure.in to test for locale support even when 'xlocale.h' is missing.

Note that I'm a newbie with the autotools, so it may be that the way I did this is not the Right Way To Do It.

This issue has been reported upstream, see [2].



[1]: https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27
[2]: https://bugzilla.gnome.org/show_bug.cgi?id=788264
Comment 1 Andreas K. Hüttel archtester gentoo-dev 2017-10-07 23:33:46 UTC
it probably makes more sense to check for and include locale.h instead...
Comment 2 Quentin Minster 2017-10-08 02:17:47 UTC
(In reply to Andreas K. Hüttel from comment #1)
> it probably makes more sense to check for and include locale.h instead...

What do you mean exactly? locale.h is already checked for in the configure.in, and included at the line right above xlocale.h.
Comment 3 Quentin Minster 2017-10-17 21:10:43 UTC
Upstream committed a fix for the issue: https://git.gnome.org/browse/libxslt/commit/?id=8b4babb8f742a1a189df4c4569e68eda308df68f
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2017-10-28 19:50:33 UTC
It's actually worse than this. Public xslt headers include xlocale.h
Comment 5 Quentin Minster 2017-10-28 20:11:10 UTC
(In reply to Andreas K. Hüttel from comment #4)
> It's actually worse than this. Public xslt headers include xlocale.h

Yes, sorry I didn't make this clear. This broke the build or disabled some features in another package, but I must admit I can't remember which.

The attached patch fixes this.
Comment 6 Larry the Git Cow gentoo-dev 2017-10-28 20:31:17 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=22feb6cfb4d502a668287e6cada18bf52d418776

commit 22feb6cfb4d502a668287e6cada18bf52d418776
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2017-10-28 20:30:51 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2017-10-28 20:31:09 +0000

    dev-libs/libxslt: Fix glibc-2.26 compatibility. Patch by Quentin Minster.
    
    This patch is much less intrusive than the upstream solution, so using
    it for now. Revision bump since the current version unconditionally includes
    in public headers xlocale.h ...
    
    Closes: https://bugs.gentoo.org/632214
    Package-Manager: Portage-2.3.13, Repoman-2.3.4

 .../libxslt/files/libxslt-1.1.30-glibc226.patch    |  32 +++++
 dev-libs/libxslt/libxslt-1.1.30-r2.ebuild          | 136 +++++++++++++++++++++
 2 files changed, 168 insertions(+)
Comment 7 Fabian Groffen gentoo-dev 2017-10-30 17:05:57 UTC
Perhaps less intrusive, but it breaks on Darwin

In file included from /Users/fabian/Gentoo-10.10/var/tmp/portage/dev-libs/libxslt-1.1.30-r2/work/libxslt-1.1.30/libxslt/xslt.c:32:
In file included from /Users/fabian/Gentoo-10.10/var/tmp/portage/dev-libs/libxslt-1.1.30-r2/work/libxslt-1.1.30/libxslt/xsltInternals.h:24:
/Users/fabian/Gentoo-10.10/var/tmp/portage/dev-libs/libxslt-1.1.30-r2/work/libxslt-1.1.30/libxslt/xsltlocale.h:28:9: error: unknown type name 'locale_t'
typedef locale_t xsltLocale;
        ^
Comment 8 Andreas K. Hüttel archtester gentoo-dev 2018-02-21 22:58:47 UTC
(In reply to Fabian Groffen from comment #7)
> Perhaps less intrusive, but it breaks on Darwin
> 
> In file included from
> /Users/fabian/Gentoo-10.10/var/tmp/portage/dev-libs/libxslt-1.1.30-r2/work/
> libxslt-1.1.30/libxslt/xslt.c:32:
> In file included from
> /Users/fabian/Gentoo-10.10/var/tmp/portage/dev-libs/libxslt-1.1.30-r2/work/
> libxslt-1.1.30/libxslt/xsltInternals.h:24:
> /Users/fabian/Gentoo-10.10/var/tmp/portage/dev-libs/libxslt-1.1.30-r2/work/
> libxslt-1.1.30/libxslt/xsltlocale.h:28:9: error: unknown type name 'locale_t'
> typedef locale_t xsltLocale;
>         ^

Reopening thus. The best solution would be a version bump. Ping!
Comment 9 Larry the Git Cow gentoo-dev 2018-04-21 12:34:21 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e39d23cb4ddf16005e6dc6417c929219bbb16b85

commit e39d23cb4ddf16005e6dc6417c929219bbb16b85
Author:     Mart Raudsepp <leio@gentoo.org>
AuthorDate: 2018-04-21 11:23:40 +0000
Commit:     Mart Raudsepp <leio@gentoo.org>
CommitDate: 2018-04-21 12:33:02 +0000

    dev-libs/libxslt: bump to 1.1.32
    
    Drop the m4 patch that adds CXXFLAGS with unknown reasons of existing;
    it shouldn't be necessary as no AC_LANG([C++]) or such is used in
    configure.ac, so lets try without.
    
    simplify-python and python static modules disabling patches are kept
    for now, just having to adjust for the upstream rename of configure.in
    to configure.ac
    
    xslt-config breakage was fixed upstream in a different way, thus should
    not need that patch anymore, either.
    
    xlocale.h glibc removal was handled differently as well, via
    AC_CHECK_HEADERS([locale.h xlocale.h])
    AC_CHECK_FUNCS([strxfrm_l])
    with HAVE_LOCALE_H and HAVE_XLOCALE_H in the installed xsltlocale.h,
    about which I'm not sure how consumers are supposed to handle it when
    directly or indirectly including xsltlocale.h (presumably doing their
    own AC_CHECK_HEADERS call?), but that similar before as well via
    ifdef XSLT_LOCALE_XLOCALE in 1.1.30.
    
    "rm -r .. || die" instead of "rm -rf .." while here and fix unnecessary
    removal of non-existing non-python examples. There actually is a C
    example, but not installed (due to requiring ICU), so we'd have to
    doins it instead with USE=examples, but meh. Due to no -f, python examples
    have to be removed only if use python.
    
    Closes: https://bugs.gentoo.org/632214
    Bug: https://bugs.gentoo.org/637310
    Package-Manager: Portage-2.3.28, Repoman-2.3.9

 dev-libs/libxslt/Manifest                          |   1 +
 .../libxslt/files/1.1.32-simplify-python.patch     | 250 +++++++++++++++++++++
 dev-libs/libxslt/libxslt-1.1.32.ebuild             | 123 ++++++++++
 3 files changed, 374 insertions(+)