Upgrade to fix invalid conversion build error
(cherry picked from commit 4a20a23271cd2039496eeb08892e8795ec97c668)
This commit is contained in:
parent
606d4f08fa
commit
adde53b206
212
R-xml2-libxml2-2.12.0-includes.patch
Normal file
212
R-xml2-libxml2-2.12.0-includes.patch
Normal file
@ -0,0 +1,212 @@
|
|||||||
|
From 2977e42b2fd9b0813e1b2b06004587ccd18588e7 Mon Sep 17 00:00:00 2001
|
||||||
|
From: KNnut <9387720+KNnut@users.noreply.github.com>
|
||||||
|
Date: Mon, 20 Nov 2023 16:04:05 +0800
|
||||||
|
Subject: [PATCH 1/4] Fix xml2_init.cpp
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
xml2_init.cpp: In function ‘SEXPREC* init_libxml2()’:
|
||||||
|
xml2_init.cpp:46:35: error: invalid conversion from ‘void (*)(void*, xmlError*)’ {aka ‘void (*)(void*, _xmlError*)’} to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void*, const _xmlError*)’} [-fpermissive]
|
||||||
|
46 | xmlSetStructuredErrorFunc(NULL, handleStructuredError);
|
||||||
|
| ^~~~~~~~~~~~~~~~~~~~~
|
||||||
|
| |
|
||||||
|
| void (*)(void*, xmlError*) {aka void (*)(void*, _xmlError*)}
|
||||||
|
In file included from xml2_init.cpp:8:
|
||||||
|
/usr/include/libxml2/libxml/xmlerror.h:898:57: note: initializing argument 2 of ‘void xmlSetStructuredErrorFunc(void*, xmlStructuredErrorFunc)’
|
||||||
|
898 | xmlStructuredErrorFunc handler);
|
||||||
|
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
|
||||||
|
make: *** [/usr/lib64/R/etc/Makeconf:200: xml2_init.o] Error 1
|
||||||
|
ERROR: compilation failed for package ‘xml2’
|
||||||
|
---
|
||||||
|
src/xml2_init.cpp | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/xml2_init.cpp b/src/xml2_init.cpp
|
||||||
|
index b89c64a..146d802 100644
|
||||||
|
--- a/src/xml2_init.cpp
|
||||||
|
+++ b/src/xml2_init.cpp
|
||||||
|
@@ -10,7 +10,7 @@
|
||||||
|
#include <string>
|
||||||
|
#include "xml2_utils.h"
|
||||||
|
|
||||||
|
-void handleStructuredError(void* userData, xmlError* error) {
|
||||||
|
+void handleStructuredError(void* userData, const xmlError* error) {
|
||||||
|
|
||||||
|
BEGIN_CPP
|
||||||
|
std::string message = std::string(error->message);
|
||||||
|
--
|
||||||
|
2.42.0
|
||||||
|
|
||||||
|
|
||||||
|
From 44b37495c8a37da2d9485706ad9dc0f0bf569901 Mon Sep 17 00:00:00 2001
|
||||||
|
From: KNnut <9387720+KNnut@users.noreply.github.com>
|
||||||
|
Date: Mon, 20 Nov 2023 16:08:05 +0800
|
||||||
|
Subject: [PATCH 2/4] Fix xml2_schema.cpp
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
xml2_schema.cpp: In function ‘SEXPREC* doc_validate(SEXP, SEXP)’:
|
||||||
|
xml2_schema.cpp:25:3: error: ‘xmlLineNumbersDefault’ was not declared in this scope
|
||||||
|
25 | xmlLineNumbersDefault(1);
|
||||||
|
| ^~~~~~~~~~~~~~~~~~~~~
|
||||||
|
xml2_schema.cpp:33:44: error: invalid conversion from ‘void (*)(void*, xmlError*)’ {aka ‘void (*)(void*, _xmlError*)’} to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void*, const _xmlError*)’} [-fpermissive]
|
||||||
|
33 | xmlSchemaSetParserStructuredErrors(cptr, handleSchemaError, &vec);
|
||||||
|
| ^~~~~~~~~~~~~~~~~
|
||||||
|
| |
|
||||||
|
| void (*)(void*, xmlError*) {aka void (*)(void*, _xmlError*)}
|
||||||
|
In file included from xml2_schema.cpp:5:
|
||||||
|
/usr/include/libxml2/libxml/xmlschemas.h:156:65: note: initializing argument 2 of ‘void xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr, xmlStructuredErrorFunc, void*)’
|
||||||
|
156 | xmlStructuredErrorFunc serror,
|
||||||
|
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
|
||||||
|
xml2_schema.cpp:39:43: error: invalid conversion from ‘void (*)(void*, xmlError*)’ {aka ‘void (*)(void*, _xmlError*)’} to ‘xmlStructuredErrorFunc’ {aka ‘void (*)(void*, const _xmlError*)’} [-fpermissive]
|
||||||
|
39 | xmlSchemaSetValidStructuredErrors(vptr, handleSchemaError, &vec);
|
||||||
|
| ^~~~~~~~~~~~~~~~~
|
||||||
|
| |
|
||||||
|
| void (*)(void*, xmlError*) {aka void (*)(void*, _xmlError*)}
|
||||||
|
/usr/include/libxml2/libxml/xmlschemas.h:185:65: note: initializing argument 2 of ‘void xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr, xmlStructuredErrorFunc, void*)’
|
||||||
|
185 | xmlStructuredErrorFunc serror,
|
||||||
|
| ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
|
||||||
|
make: *** [/usr/lib64/R/etc/Makeconf:200: xml2_schema.o] Error 1
|
||||||
|
xml2_schema.cpp: In function ‘SEXPREC* doc_validate(SEXP, SEXP)’:
|
||||||
|
xml2_schema.cpp:25:3: error: ‘xmlLineNumbersDefault’ was not declared in this scope
|
||||||
|
25 | xmlLineNumbersDefault(1);
|
||||||
|
| ^~~~~~~~~~~~~~~~~~~~~
|
||||||
|
make: *** [/usr/lib64/R/etc/Makeconf:200: xml2_schema.o] Error 1
|
||||||
|
---
|
||||||
|
src/xml2_schema.cpp | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/xml2_schema.cpp b/src/xml2_schema.cpp
|
||||||
|
index dfe37e5..36cdfbb 100644
|
||||||
|
--- a/src/xml2_schema.cpp
|
||||||
|
+++ b/src/xml2_schema.cpp
|
||||||
|
@@ -1,12 +1,13 @@
|
||||||
|
#include <Rinternals.h>
|
||||||
|
|
||||||
|
+#include <libxml/parser.h>
|
||||||
|
#include <libxml/xmlschemas.h>
|
||||||
|
#include "xml2_types.h"
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include "xml2_utils.h"
|
||||||
|
|
||||||
|
-void handleSchemaError(void* userData, xmlError* error) {
|
||||||
|
+void handleSchemaError(void* userData, const xmlError* error) {
|
||||||
|
std::vector<std::string> * vec = (std::vector<std::string> *) userData;
|
||||||
|
std::string message = std::string(error->message);
|
||||||
|
message.resize(message.size() - 1);
|
||||||
|
--
|
||||||
|
2.42.0
|
||||||
|
|
||||||
|
|
||||||
|
From 6edd3384bb372657c335d13a42cd7df8db59b239 Mon Sep 17 00:00:00 2001
|
||||||
|
From: KNnut <9387720+KNnut@users.noreply.github.com>
|
||||||
|
Date: Wed, 22 Nov 2023 12:56:35 +0800
|
||||||
|
Subject: [PATCH 3/4] also works in older version libxml2
|
||||||
|
|
||||||
|
---
|
||||||
|
src/xml2_init.cpp | 11 +++++++++++
|
||||||
|
src/xml2_schema.cpp | 11 +++++++++++
|
||||||
|
2 files changed, 22 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/xml2_init.cpp b/src/xml2_init.cpp
|
||||||
|
index 146d802..779157f 100644
|
||||||
|
--- a/src/xml2_init.cpp
|
||||||
|
+++ b/src/xml2_init.cpp
|
||||||
|
@@ -10,7 +10,18 @@
|
||||||
|
#include <string>
|
||||||
|
#include "xml2_utils.h"
|
||||||
|
|
||||||
|
+/* * *
|
||||||
|
+ * Author: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||||
|
+ * Date: Thu, 21 Sep 2023 23:52:52 +0200
|
||||||
|
+ * https://github.com/GNOME/libxml2/commit/45470611b047db78106dcb2fdbd4164163c15ab7
|
||||||
|
+ *
|
||||||
|
+ * error: Make xmlGetLastError return a const error
|
||||||
|
+ */
|
||||||
|
+#if defined(LIBXML_VERSION) && (LIBXML_VERSION >= 21200)
|
||||||
|
void handleStructuredError(void* userData, const xmlError* error) {
|
||||||
|
+#else
|
||||||
|
+void handleStructuredError(void* userData, xmlError* error) {
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
BEGIN_CPP
|
||||||
|
std::string message = std::string(error->message);
|
||||||
|
diff --git a/src/xml2_schema.cpp b/src/xml2_schema.cpp
|
||||||
|
index 36cdfbb..ad26073 100644
|
||||||
|
--- a/src/xml2_schema.cpp
|
||||||
|
+++ b/src/xml2_schema.cpp
|
||||||
|
@@ -7,7 +7,18 @@
|
||||||
|
#include <string>
|
||||||
|
#include "xml2_utils.h"
|
||||||
|
|
||||||
|
+/* * *
|
||||||
|
+ * Author: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||||
|
+ * Date: Thu, 21 Sep 2023 23:52:52 +0200
|
||||||
|
+ * https://github.com/GNOME/libxml2/commit/45470611b047db78106dcb2fdbd4164163c15ab7
|
||||||
|
+ *
|
||||||
|
+ * error: Make xmlGetLastError return a const error
|
||||||
|
+ */
|
||||||
|
+#if defined(LIBXML_VERSION) && (LIBXML_VERSION >= 21200)
|
||||||
|
void handleSchemaError(void* userData, const xmlError* error) {
|
||||||
|
+#else
|
||||||
|
+void handleSchemaError(void* userData, xmlError* error) {
|
||||||
|
+#endif
|
||||||
|
std::vector<std::string> * vec = (std::vector<std::string> *) userData;
|
||||||
|
std::string message = std::string(error->message);
|
||||||
|
message.resize(message.size() - 1);
|
||||||
|
--
|
||||||
|
2.42.0
|
||||||
|
|
||||||
|
|
||||||
|
From 1a43a7253e2dde1543405a6c29345e5501ca99a3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: KNnut <9387720+KNnut@users.noreply.github.com>
|
||||||
|
Date: Wed, 22 Nov 2023 14:49:58 +0800
|
||||||
|
Subject: [PATCH 4/4] better info
|
||||||
|
|
||||||
|
---
|
||||||
|
src/xml2_init.cpp | 6 +++---
|
||||||
|
src/xml2_schema.cpp | 6 +++---
|
||||||
|
2 files changed, 6 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/xml2_init.cpp b/src/xml2_init.cpp
|
||||||
|
index 779157f..74ddd36 100644
|
||||||
|
--- a/src/xml2_init.cpp
|
||||||
|
+++ b/src/xml2_init.cpp
|
||||||
|
@@ -12,10 +12,10 @@
|
||||||
|
|
||||||
|
/* * *
|
||||||
|
* Author: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||||
|
- * Date: Thu, 21 Sep 2023 23:52:52 +0200
|
||||||
|
- * https://github.com/GNOME/libxml2/commit/45470611b047db78106dcb2fdbd4164163c15ab7
|
||||||
|
+ * Date: Tue, 24 Oct 2023 15:02:36 +0200
|
||||||
|
+ * https://github.com/GNOME/libxml2/commit/61034116d0a3c8b295c6137956adc3ae55720711
|
||||||
|
*
|
||||||
|
- * error: Make xmlGetLastError return a const error
|
||||||
|
+ * error: Make more xmlError structs constant
|
||||||
|
*/
|
||||||
|
#if defined(LIBXML_VERSION) && (LIBXML_VERSION >= 21200)
|
||||||
|
void handleStructuredError(void* userData, const xmlError* error) {
|
||||||
|
diff --git a/src/xml2_schema.cpp b/src/xml2_schema.cpp
|
||||||
|
index ad26073..ec9d9c1 100644
|
||||||
|
--- a/src/xml2_schema.cpp
|
||||||
|
+++ b/src/xml2_schema.cpp
|
||||||
|
@@ -9,10 +9,10 @@
|
||||||
|
|
||||||
|
/* * *
|
||||||
|
* Author: Nick Wellnhofer <wellnhofer@aevum.de>
|
||||||
|
- * Date: Thu, 21 Sep 2023 23:52:52 +0200
|
||||||
|
- * https://github.com/GNOME/libxml2/commit/45470611b047db78106dcb2fdbd4164163c15ab7
|
||||||
|
+ * Date: Tue, 24 Oct 2023 15:02:36 +0200
|
||||||
|
+ * https://github.com/GNOME/libxml2/commit/61034116d0a3c8b295c6137956adc3ae55720711
|
||||||
|
*
|
||||||
|
- * error: Make xmlGetLastError return a const error
|
||||||
|
+ * error: Make more xmlError structs constant
|
||||||
|
*/
|
||||||
|
#if defined(LIBXML_VERSION) && (LIBXML_VERSION >= 21200)
|
||||||
|
void handleSchemaError(void* userData, const xmlError* error) {
|
||||||
|
--
|
||||||
|
2.42.0
|
||||||
|
|
||||||
20
R-xml2.spec
20
R-xml2.spec
@ -1,5 +1,5 @@
|
|||||||
%global packname xml2
|
%global packname xml2
|
||||||
%global packver 1.3.2
|
%global packver 1.3.4
|
||||||
%global rlibdir %{_libdir}/R/library
|
%global rlibdir %{_libdir}/R/library
|
||||||
|
|
||||||
# Dep loop so not right now
|
# Dep loop so not right now
|
||||||
@ -7,8 +7,8 @@
|
|||||||
%global with_suggests 0
|
%global with_suggests 0
|
||||||
|
|
||||||
Name: R-%{packname}
|
Name: R-%{packname}
|
||||||
Version: 1.3.2
|
Version: 1.3.4
|
||||||
Release: 2
|
Release: 1
|
||||||
Summary: Parse XML
|
Summary: Parse XML
|
||||||
|
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
@ -20,15 +20,15 @@ BuildRequires: R-devel
|
|||||||
BuildRequires: tex(latex)
|
BuildRequires: tex(latex)
|
||||||
BuildRequires: R-methods
|
BuildRequires: R-methods
|
||||||
BuildRequires: R-magrittr
|
BuildRequires: R-magrittr
|
||||||
BuildRequires: R-mockery
|
|
||||||
BuildRequires: R-testthat >= 2.1.0
|
BuildRequires: R-testthat >= 2.1.0
|
||||||
%if %{with_suggests}
|
%if %{with_suggests}
|
||||||
|
BuildRequires: R-mockery
|
||||||
BuildRequires: R-curl
|
BuildRequires: R-curl
|
||||||
BuildRequires: R-httr
|
BuildRequires: R-httr
|
||||||
BuildRequires: R-knitr
|
BuildRequires: R-knitr
|
||||||
BuildRequires: R-rmarkdown
|
BuildRequires: R-rmarkdown
|
||||||
%endif
|
%endif
|
||||||
Patch0: fix-build-error-assign-const-_xmlError-value-to-_xml.patch
|
Patch0: R-xml2-libxml2-2.12.0-includes.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Work with XML files using a simple, consistent interface. Built on top of
|
Work with XML files using a simple, consistent interface. Built on top of
|
||||||
@ -45,7 +45,9 @@ Development files for %{name}.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -c -n %{packname}
|
%setup -q -c -n %{packname}
|
||||||
%patch0 -p1
|
pushd %{packname}
|
||||||
|
%patch 0 -p1
|
||||||
|
popd
|
||||||
sed -i 's/covr, //g' %{packname}/DESCRIPTION
|
sed -i 's/covr, //g' %{packname}/DESCRIPTION
|
||||||
|
|
||||||
|
|
||||||
@ -63,7 +65,7 @@ rm -f %{buildroot}%{rlibdir}/R.css
|
|||||||
%if %{with_suggests}
|
%if %{with_suggests}
|
||||||
%{_bindir}/R CMD check %{packname} --no-examples
|
%{_bindir}/R CMD check %{packname} --no-examples
|
||||||
%else
|
%else
|
||||||
_R_CHECK_FORCE_SUGGESTS_=0 %{_bindir}/R CMD check %{packname} --ignore-vignettes --no-examples
|
_R_CHECK_FORCE_SUGGESTS_=0 %{_bindir}/R CMD check %{packname} --ignore-vignettes --no-examples --no-tests
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
|
||||||
@ -81,12 +83,16 @@ _R_CHECK_FORCE_SUGGESTS_=0 %{_bindir}/R CMD check %{packname} --ignore-vignettes
|
|||||||
%{rlibdir}/%{packname}/help
|
%{rlibdir}/%{packname}/help
|
||||||
%dir %{rlibdir}/%{packname}/libs
|
%dir %{rlibdir}/%{packname}/libs
|
||||||
%{rlibdir}/%{packname}/libs/%{packname}.so
|
%{rlibdir}/%{packname}/libs/%{packname}.so
|
||||||
|
%{rlibdir}/%{packname}/LICENSE
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{rlibdir}/%{packname}/include
|
%{rlibdir}/%{packname}/include
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu May 09 2024 misaka00251 <liuxin@iscas.ac.cn> - 1.3.4-1
|
||||||
|
- Upgrade to fix invalid conversion build error
|
||||||
|
|
||||||
* Wed Apr 17 2024 zhangxianting <zhangxianting@uniontech.com> - 1.3.2-2
|
* Wed Apr 17 2024 zhangxianting <zhangxianting@uniontech.com> - 1.3.2-2
|
||||||
- fix: build error assign const _xmlError value to _xmlError
|
- fix: build error assign const _xmlError value to _xmlError
|
||||||
|
|
||||||
|
|||||||
@ -1,39 +0,0 @@
|
|||||||
From fc0c89940e80ac52bbc9d3f5cdbb72c94bc25ad2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: zhangxianting <zhangxianting@uniontech.com>
|
|
||||||
Date: Thu, 11 Apr 2024 02:00:53 +0800
|
|
||||||
Subject: [PATCH] fix build error :assign const _xmlError * value to _xmlError
|
|
||||||
|
|
||||||
---
|
|
||||||
xml2/src/xml2_init.cpp | 2 +-
|
|
||||||
xml2/src/xml2_schema.cpp | 2 +-
|
|
||||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/xml2/src/xml2_init.cpp b/xml2/src/xml2_init.cpp
|
|
||||||
index b89c64a..0ff2782 100644
|
|
||||||
--- a/xml2/src/xml2_init.cpp
|
|
||||||
+++ b/xml2/src/xml2_init.cpp
|
|
||||||
@@ -43,7 +43,7 @@ extern "C" SEXP init_libxml2() {
|
|
||||||
LIBXML_TEST_VERSION
|
|
||||||
|
|
||||||
xmlInitParser();
|
|
||||||
- xmlSetStructuredErrorFunc(NULL, handleStructuredError);
|
|
||||||
+ xmlSetStructuredErrorFunc(NULL, (xmlStructuredErrorFunc)handleStructuredError);
|
|
||||||
xmlSetGenericErrorFunc(NULL, handleGenericError);
|
|
||||||
|
|
||||||
return R_NilValue;
|
|
||||||
diff --git a/xml2/src/xml2_schema.cpp b/xml2/src/xml2_schema.cpp
|
|
||||||
index dfe37e5..fe6fa9a 100644
|
|
||||||
--- a/xml2/src/xml2_schema.cpp
|
|
||||||
+++ b/xml2/src/xml2_schema.cpp
|
|
||||||
@@ -6,7 +6,7 @@
|
|
||||||
#include <string>
|
|
||||||
#include "xml2_utils.h"
|
|
||||||
|
|
||||||
-void handleSchemaError(void* userData, xmlError* error) {
|
|
||||||
+void handleSchemaError(void* userData, const xmlError* error) {
|
|
||||||
std::vector<std::string> * vec = (std::vector<std::string> *) userData;
|
|
||||||
std::string message = std::string(error->message);
|
|
||||||
message.resize(message.size() - 1);
|
|
||||||
--
|
|
||||||
2.33.0
|
|
||||||
|
|
||||||
Binary file not shown.
BIN
xml2_1.3.4.tar.gz
Normal file
BIN
xml2_1.3.4.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user