[arch-commits] Commit in libxslt/repos/extra-x86_64 (5 files)
Jan Steffens
heftig at gemini.archlinux.org
Wed Feb 16 19:48:48 UTC 2022
Date: Wednesday, February 16, 2022 @ 19:48:48
Author: heftig
Revision: 437518
archrelease: copy trunk to extra-x86_64
Added:
libxslt/repos/extra-x86_64/0001-Make-generate-id-deterministic.patch
(from rev 437517, libxslt/trunk/0001-Make-generate-id-deterministic.patch)
libxslt/repos/extra-x86_64/PKGBUILD
(from rev 437517, libxslt/trunk/PKGBUILD)
Deleted:
libxslt/repos/extra-x86_64/0001-Make-generate-id-deterministic.patch
libxslt/repos/extra-x86_64/0002-Fix-manpage.patch
libxslt/repos/extra-x86_64/PKGBUILD
-------------------------------------------+
0001-Make-generate-id-deterministic.patch | 365 +++++++++++++---------------
0002-Fix-manpage.patch | 45 ---
PKGBUILD | 117 ++++----
3 files changed, 235 insertions(+), 292 deletions(-)
Deleted: 0001-Make-generate-id-deterministic.patch
===================================================================
--- 0001-Make-generate-id-deterministic.patch 2022-02-16 19:48:37 UTC (rev 437517)
+++ 0001-Make-generate-id-deterministic.patch 2022-02-16 19:48:48 UTC (rev 437518)
@@ -1,184 +0,0 @@
-From a94626df19f62bc7ee5aa8e65dd1995bed1a8092 Mon Sep 17 00:00:00 2001
-From: Daniel Veillard <veillard at redhat.com>
-Date: Sun, 29 Oct 2017 01:04:54 +0200
-Subject: [PATCH 1/2] Make generate-id deterministic
-
-Origin: upstream, https://bugzilla.gnome.org/attachment.cgi?id=306475
-Bug: https://bugzilla.gnome.org/show_bug.cgi?id=751621
-Bug-Debian: https://bugs.debian.org/823857
----
- libxslt/functions.c | 91 ++++++++++++++++++++++++++++++++++++++++-
- libxslt/functions.h | 7 ++++
- libxslt/transform.c | 8 ++++
- libxslt/xsltInternals.h | 2 +
- 4 files changed, 107 insertions(+), 1 deletion(-)
-
-diff --git a/libxslt/functions.c b/libxslt/functions.c
-index b350545a..858a483a 100644
---- a/libxslt/functions.c
-+++ b/libxslt/functions.c
-@@ -671,6 +671,63 @@ xsltFormatNumberFunction(xmlXPathParserContextPtr ctxt, int nargs)
- xmlXPathFreeObject(decimalObj);
- }
-
-+/**
-+ * xsltCleanupIds:
-+ * @ctxt: the transformation context
-+ * @root: the root of the resulting document
-+ *
-+ * This clean up ids which may have been saved in Element contents
-+ * by xsltGenerateIdFunction() to provide stable IDs on elements.
-+ *
-+ * Returns the number of items cleaned or -1 in case of error
-+ */
-+int
-+xsltCleanupIds(xsltTransformContextPtr ctxt, xmlNodePtr root) {
-+ xmlNodePtr cur;
-+ int count = 0;
-+
-+ if ((ctxt == NULL) || (root == NULL))
-+ return(-1);
-+ if (root->type != XML_ELEMENT_NODE)
-+ return(-1);
-+
-+ cur = root;
-+ while (cur != NULL) {
-+ if (cur->type == XML_ELEMENT_NODE) {
-+ if (cur->content != NULL) {
-+ cur->content = NULL;
-+ count++;
-+ }
-+ if (cur->children != NULL) {
-+ cur = cur->children;
-+ continue;
-+ }
-+ }
-+ if (cur->next != NULL) {
-+ cur = cur->next;
-+ continue;
-+ }
-+ do {
-+ cur = cur->parent;
-+ if (cur == NULL)
-+ break;
-+ if (cur == (xmlNodePtr) root) {
-+ cur = NULL;
-+ break;
-+ }
-+ if (cur->next != NULL) {
-+ cur = cur->next;
-+ break;
-+ }
-+ } while (cur != NULL);
-+ }
-+
-+fprintf(stderr, "Attributed %d IDs for element, cleaned up %d\n",
-+ ctxt->nextid, count);
-+
-+ return(count);
-+}
-+
- /**
- * xsltGenerateIdFunction:
- * @ctxt: the XPath Parser context
-@@ -722,7 +779,39 @@ xsltGenerateIdFunction(xmlXPathParserContextPtr ctxt, int nargs){
- if (obj)
- xmlXPathFreeObject(obj);
-
-- val = (long)((char *)cur - (char *)&base_address);
-+ /*
-+ * Try to provide stable ID for generated document:
-+ * - usually ID are computed to be placed on elements via attributes
-+ * so using the element as the node for the ID
-+ * - the cur->content should be a correct placeholder for this, we use
-+ * it to hold element node numbers in xmlXPathOrderDocElems to
-+ * speed up XPath too
-+ * - xsltCleanupIds() clean them up before handing the XSLT output
-+ * to the API client.
-+ * - other nodes types use the node address method but that should
-+ * not end up in resulting document ID
-+ * - we can enable this by default without risk of performance issues
-+ * only the one pass xsltCleanupIds() is added
-+ */
-+ if (cur->type == XML_ELEMENT_NODE) {
-+ if (cur->content == NULL) {
-+ xsltTransformContextPtr tctxt;
-+
-+ tctxt = xsltXPathGetTransformContext(ctxt);
-+ if (tctxt == NULL) {
-+ val = (long)((char *)cur - (char *)&base_address);
-+ } else {
-+ tctxt->nextid++;
-+ val = tctxt->nextid;
-+ cur->content = (void *) (val);
-+ }
-+ } else {
-+ val = (long) cur->content;
-+ }
-+ } else {
-+ val = (long)((char *)cur - (char *)&base_address);
-+ }
-+
- if (val >= 0) {
- snprintf((char *)str, sizeof(str), "idp%ld", val);
- } else {
-diff --git a/libxslt/functions.h b/libxslt/functions.h
-index 5455b7f4..31163613 100644
---- a/libxslt/functions.h
-+++ b/libxslt/functions.h
-@@ -63,6 +63,13 @@ XSLTPUBFUN void XSLTCALL
- xsltFunctionAvailableFunction (xmlXPathParserContextPtr ctxt,
- int nargs);
-
-+/*
-+ * Cleanup for ID generation
-+ */
-+XSLTPUBFUN int XSLTCALL
-+ xsltCleanupIds (xsltTransformContextPtr ctxt,
-+ xmlNodePtr root);
-+
- /*
- * And the registration
- */
-diff --git a/libxslt/transform.c b/libxslt/transform.c
-index d1c47932..3d1ee059 100644
---- a/libxslt/transform.c
-+++ b/libxslt/transform.c
-@@ -706,6 +706,7 @@ xsltNewTransformContext(xsltStylesheetPtr style, xmlDocPtr doc) {
- cur->traceCode = (unsigned long*) &xsltDefaultTrace;
- cur->xinclude = xsltGetXIncludeDefault();
- cur->keyInitLevel = 0;
-+ cur->nextid = 0;
-
- return(cur);
-
-@@ -6140,6 +6141,13 @@ xsltApplyStylesheetInternal(xsltStylesheetPtr style, xmlDocPtr doc,
- if (root != NULL) {
- const xmlChar *doctype = NULL;
-
-+ /*
-+ * cleanup ids which may have been saved in Elements content ptrs
-+ */
-+ if (ctxt->nextid != 0) {
-+ xsltCleanupIds(ctxt, root);
-+ }
-+
- if ((root->ns != NULL) && (root->ns->prefix != NULL))
- doctype = xmlDictQLookup(ctxt->dict, root->ns->prefix, root->name);
- if (doctype == NULL)
-diff --git a/libxslt/xsltInternals.h b/libxslt/xsltInternals.h
-index 14a971aa..a7d71b57 100644
---- a/libxslt/xsltInternals.h
-+++ b/libxslt/xsltInternals.h
-@@ -1782,6 +1782,8 @@ struct _xsltTransformContext {
- int maxTemplateVars;
- unsigned long opLimit;
- unsigned long opCount;
-+
-+ unsigned long nextid;/* for generating stable ids */
- };
-
- /**
---
-2.27.0
-
Copied: libxslt/repos/extra-x86_64/0001-Make-generate-id-deterministic.patch (from rev 437517, libxslt/trunk/0001-Make-generate-id-deterministic.patch)
===================================================================
--- 0001-Make-generate-id-deterministic.patch (rev 0)
+++ 0001-Make-generate-id-deterministic.patch 2022-02-16 19:48:48 UTC (rev 437518)
@@ -0,0 +1,181 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <veillard at redhat.com>
+Date: Sun, 29 Oct 2017 01:04:54 +0200
+Subject: [PATCH] Make generate-id deterministic
+
+Origin: upstream, https://bugzilla.gnome.org/attachment.cgi?id=306475
+Bug: https://bugzilla.gnome.org/show_bug.cgi?id=751621
+Bug-Debian: https://bugs.debian.org/823857
+---
+ libxslt/functions.c | 91 ++++++++++++++++++++++++++++++++++++++++-
+ libxslt/functions.h | 7 ++++
+ libxslt/transform.c | 8 ++++
+ libxslt/xsltInternals.h | 2 +
+ 4 files changed, 107 insertions(+), 1 deletion(-)
+
+diff --git a/libxslt/functions.c b/libxslt/functions.c
+index 7887dda70f67..be0d897bd471 100644
+--- a/libxslt/functions.c
++++ b/libxslt/functions.c
+@@ -683,6 +683,63 @@ xsltFormatNumberFunction(xmlXPathParserContextPtr ctxt, int nargs)
+ xmlXPathFreeObject(decimalObj);
+ }
+
++/**
++ * xsltCleanupIds:
++ * @ctxt: the transformation context
++ * @root: the root of the resulting document
++ *
++ * This clean up ids which may have been saved in Element contents
++ * by xsltGenerateIdFunction() to provide stable IDs on elements.
++ *
++ * Returns the number of items cleaned or -1 in case of error
++ */
++int
++xsltCleanupIds(xsltTransformContextPtr ctxt, xmlNodePtr root) {
++ xmlNodePtr cur;
++ int count = 0;
++
++ if ((ctxt == NULL) || (root == NULL))
++ return(-1);
++ if (root->type != XML_ELEMENT_NODE)
++ return(-1);
++
++ cur = root;
++ while (cur != NULL) {
++ if (cur->type == XML_ELEMENT_NODE) {
++ if (cur->content != NULL) {
++ cur->content = NULL;
++ count++;
++ }
++ if (cur->children != NULL) {
++ cur = cur->children;
++ continue;
++ }
++ }
++ if (cur->next != NULL) {
++ cur = cur->next;
++ continue;
++ }
++ do {
++ cur = cur->parent;
++ if (cur == NULL)
++ break;
++ if (cur == (xmlNodePtr) root) {
++ cur = NULL;
++ break;
++ }
++ if (cur->next != NULL) {
++ cur = cur->next;
++ break;
++ }
++ } while (cur != NULL);
++ }
++
++fprintf(stderr, "Attributed %d IDs for element, cleaned up %d\n",
++ ctxt->nextid, count);
++
++ return(count);
++}
++
+ /**
+ * xsltGenerateIdFunction:
+ * @ctxt: the XPath Parser context
+@@ -734,7 +791,39 @@ xsltGenerateIdFunction(xmlXPathParserContextPtr ctxt, int nargs){
+ if (obj)
+ xmlXPathFreeObject(obj);
+
+- val = (long)((char *)cur - (char *)&base_address);
++ /*
++ * Try to provide stable ID for generated document:
++ * - usually ID are computed to be placed on elements via attributes
++ * so using the element as the node for the ID
++ * - the cur->content should be a correct placeholder for this, we use
++ * it to hold element node numbers in xmlXPathOrderDocElems to
++ * speed up XPath too
++ * - xsltCleanupIds() clean them up before handing the XSLT output
++ * to the API client.
++ * - other nodes types use the node address method but that should
++ * not end up in resulting document ID
++ * - we can enable this by default without risk of performance issues
++ * only the one pass xsltCleanupIds() is added
++ */
++ if (cur->type == XML_ELEMENT_NODE) {
++ if (cur->content == NULL) {
++ xsltTransformContextPtr tctxt;
++
++ tctxt = xsltXPathGetTransformContext(ctxt);
++ if (tctxt == NULL) {
++ val = (long)((char *)cur - (char *)&base_address);
++ } else {
++ tctxt->nextid++;
++ val = tctxt->nextid;
++ cur->content = (void *) (val);
++ }
++ } else {
++ val = (long) cur->content;
++ }
++ } else {
++ val = (long)((char *)cur - (char *)&base_address);
++ }
++
+ if (val >= 0) {
+ snprintf((char *)str, sizeof(str), "idp%ld", val);
+ } else {
+diff --git a/libxslt/functions.h b/libxslt/functions.h
+index 5455b7f47802..31163613f6e9 100644
+--- a/libxslt/functions.h
++++ b/libxslt/functions.h
+@@ -63,6 +63,13 @@ XSLTPUBFUN void XSLTCALL
+ xsltFunctionAvailableFunction (xmlXPathParserContextPtr ctxt,
+ int nargs);
+
++/*
++ * Cleanup for ID generation
++ */
++XSLTPUBFUN int XSLTCALL
++ xsltCleanupIds (xsltTransformContextPtr ctxt,
++ xmlNodePtr root);
++
+ /*
+ * And the registration
+ */
+diff --git a/libxslt/transform.c b/libxslt/transform.c
+index 57f05bf71920..9368e17197bf 100644
+--- a/libxslt/transform.c
++++ b/libxslt/transform.c
+@@ -706,6 +706,7 @@ xsltNewTransformContext(xsltStylesheetPtr style, xmlDocPtr doc) {
+ cur->traceCode = (unsigned long*) &xsltDefaultTrace;
+ cur->xinclude = xsltGetXIncludeDefault();
+ cur->keyInitLevel = 0;
++ cur->nextid = 0;
+
+ return(cur);
+
+@@ -6038,6 +6039,13 @@ xsltApplyStylesheetInternal(xsltStylesheetPtr style, xmlDocPtr doc,
+ if (root != NULL) {
+ const xmlChar *doctype = NULL;
+
++ /*
++ * cleanup ids which may have been saved in Elements content ptrs
++ */
++ if (ctxt->nextid != 0) {
++ xsltCleanupIds(ctxt, root);
++ }
++
+ if ((root->ns != NULL) && (root->ns->prefix != NULL))
+ doctype = xmlDictQLookup(ctxt->dict, root->ns->prefix, root->name);
+ if (doctype == NULL)
+diff --git a/libxslt/xsltInternals.h b/libxslt/xsltInternals.h
+index 14343d2751c8..9d3ff5fc0c06 100644
+--- a/libxslt/xsltInternals.h
++++ b/libxslt/xsltInternals.h
+@@ -1786,6 +1786,8 @@ struct _xsltTransformContext {
+ int maxTemplateVars;
+ unsigned long opLimit;
+ unsigned long opCount;
++
++ unsigned long nextid;/* for generating stable ids */
+ };
+
+ /**
Deleted: 0002-Fix-manpage.patch
===================================================================
--- 0002-Fix-manpage.patch 2022-02-16 19:48:37 UTC (rev 437517)
+++ 0002-Fix-manpage.patch 2022-02-16 19:48:48 UTC (rev 437518)
@@ -1,45 +0,0 @@
-From ea42953d3d75278f4f89009dfeed115200e4d102 Mon Sep 17 00:00:00 2001
-From: "Jan Alexander Steffens (heftig)" <jan.steffens at gmail.com>
-Date: Wed, 10 Jun 2020 17:13:43 +0000
-Subject: [PATCH 2/2] Fix manpage
-
-Use the right stylesheet for DocBook 4. This fixes the bad whitespace
-processing.
-
-Use the just-built xsltproc to generate the manpage.
----
- doc/Makefile.am | 4 ++--
- doc/xsltproc.xml | 2 +-
- 2 files changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/doc/Makefile.am b/doc/Makefile.am
-index 3d5364ca..6a7b9408 100644
---- a/doc/Makefile.am
-+++ b/doc/Makefile.am
-@@ -239,9 +239,9 @@ libxslt-api.xml libxslt-refs.xml EXSLT/libexslt-api.xml \
- ($(XSLTPROC) -o ../libxslt/libxslt.syms $(srcdir)/syms.xsl $(srcdir)/symbols.xml)
-
- xsltproc.1: $(srcdir)/xsltproc.xml
-- -@(if [ -x $(XSLTPROC) ] ; then \
-+ -@(if [ -x $(srcdir)/../xsltproc/xsltproc ] ; then \
- echo "Rebuilding the man pages from the xml" ; \
-- $(XSLTPROC) --nonet $(srcdir)/xsltproc.xml ; fi)
-+ $(srcdir)/../xsltproc/xsltproc --nonet $(srcdir)/xsltproc.xml ; fi)
-
- # Note that in the following, xmllint output is piped to xsltproc
- search.php: $(srcdir)/api.xsl $(srcdir)/site.xsl $(srcdir)/search.templ \
-diff --git a/doc/xsltproc.xml b/doc/xsltproc.xml
-index 08fc3e97..6ca1b323 100644
---- a/doc/xsltproc.xml
-+++ b/doc/xsltproc.xml
-@@ -1,6 +1,6 @@
- <?xml version="1.0"?>
- <?xml-stylesheet type="text/xsl"
-- href="http://cdn.docbook.org/release/xsl/current//manpages/docbook.xsl"?>
-+ href="http://cdn.docbook.org/release/xsl-nons/current/manpages/docbook.xsl"?>
- <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
- "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
-
---
-2.27.0
-
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2022-02-16 19:48:37 UTC (rev 437517)
+++ PKGBUILD 2022-02-16 19:48:48 UTC (rev 437518)
@@ -1,63 +0,0 @@
-# Maintainer: Eric Belanger <eric at archlinux.org>
-# Contributor: John Proctor <jproctor at prium.net>
-
-pkgname=libxslt
-pkgver=1.1.34
-pkgrel=6
-pkgdesc="XML stylesheet transformation library"
-url="http://xmlsoft.org/XSLT/"
-arch=(x86_64)
-license=(custom)
-depends=(libxml2 libgcrypt)
-makedepends=(git docbook-xsl)
-checkdepends=(docbook-xml python)
-_commit=3653123f992db24cec417d12600f4c67388025e3 # tags/v1.1.34^0
-source=("git+https://gitlab.gnome.org/GNOME/libxslt.git#commit=$_commit"
- 0001-Make-generate-id-deterministic.patch
- 0002-Fix-manpage.patch)
-sha256sums=('SKIP'
- '80ffc45016b2c0b8edeb332ba587a8523ea5ed856229e7f531edd0af9742bab3'
- 'd7dea109c91958e2231c06d9b841853855a666f93b001a1999beab42c3345203')
-
-pkgver() {
- cd $pkgname
- git describe --tags | sed 's/^v//;s/-/+/g'
-}
-
-prepare() {
- cd $pkgname
-
- # Fix build with libxml libxml2-2.9.12
- git cherry-pick -n 9ae2f94df1721e002941b40665efb762aefcea1a
- git cherry-pick -n 824657768aea2cce9c23e72ba8085cb5e44350c7
- git cherry-pick -n 77c26bad0433541f486b1e7ced44ca9979376908
-
- # Make xsltproc output reproducible for packages which use it to generate documentation
- patch -Np1 -i ../0001-Make-generate-id-deterministic.patch
-
- # Fix manpage whitespace and rebuild the manpage
- patch -Np1 -i ../0002-Fix-manpage.patch
- rm doc/xsltproc.1
-
- NOCONFIGURE=1 ./autogen.sh
-}
-
-build() {
- cd $pkgname
- ./configure --prefix=/usr --without-python --disable-static
- sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
- make
-}
-
-check() {
- cd $pkgname
- make check
-}
-
-package() {
- cd $pkgname
- make DESTDIR="$pkgdir" install
- install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-}
-
-# vim:set sw=2 et:
Copied: libxslt/repos/extra-x86_64/PKGBUILD (from rev 437517, libxslt/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2022-02-16 19:48:48 UTC (rev 437518)
@@ -0,0 +1,54 @@
+# Contributor: Eric Belanger <eric at archlinux.org>
+# Contributor: John Proctor <jproctor at prium.net>
+
+pkgname=libxslt
+pkgver=1.1.35
+pkgrel=1
+pkgdesc="XML stylesheet transformation library"
+url="https://gitlab.gnome.org/GNOME/libxslt/-/wikis"
+arch=(x86_64)
+license=(custom)
+depends=(libxml2 libgcrypt)
+makedepends=(git python)
+checkdepends=(docbook-xml)
+optdepends=('python: Python bindings')
+provides=(lib{,e}xslt.so)
+_commit=50af4e65da712ceb59f98a7feeeab2ddc3324ab9 # tags/v1.1.35^0
+source=("git+https://gitlab.gnome.org/GNOME/libxslt.git#commit=$_commit"
+ 0001-Make-generate-id-deterministic.patch)
+sha256sums=('SKIP'
+ '0b1dc7ac703e347eace1b92f7ef48735a8b6013b8e5b9620a9ca882d8bf46a74')
+
+pkgver() {
+ cd libxslt
+ git describe --tags | sed 's/^v//;s/[^-]*-g/r&/;s/-/+/g'
+}
+
+prepare() {
+ cd libxslt
+
+ # Make xsltproc output reproducible for packages which use it to generate documentation
+ git apply -3 ../0001-Make-generate-id-deterministic.patch
+
+ NOCONFIGURE=1 ./autogen.sh
+}
+
+build() {
+ cd libxslt
+ ./configure --prefix=/usr --disable-static
+ sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
+ make
+}
+
+check() {
+ cd libxslt
+ make check
+}
+
+package() {
+ cd libxslt
+ make DESTDIR="$pkgdir" install
+ install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 COPYING
+}
+
+# vim:set sw=2 et:
More information about the arch-commits
mailing list