summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-07-17 14:21:27 +0000
committerSam James <sam@gentoo.org>2022-07-17 14:21:27 +0000
commit2318040e31ef2c5c72332281ae2987319bf46e38 (patch)
treee98d082addab7145b64d9774ab01bf05187f318e /dev-libs/liborcus
parentmedia-libs/raptor: use pkg-config for ICU/libxml2/libxslt (fix LLD) (diff)
downloadgentoo-2318040e31ef2c5c72332281ae2987319bf46e38.tar.gz
gentoo-2318040e31ef2c5c72332281ae2987319bf46e38.tar.bz2
gentoo-2318040e31ef2c5c72332281ae2987319bf46e38.zip
dev-libs/liborcus: fix build w/ Clang
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-libs/liborcus')
-rw-r--r--dev-libs/liborcus/files/liborcus-0.17.2-clang.patch26
-rw-r--r--dev-libs/liborcus/liborcus-0.17.2.ebuild4
2 files changed, 30 insertions, 0 deletions
diff --git a/dev-libs/liborcus/files/liborcus-0.17.2-clang.patch b/dev-libs/liborcus/files/liborcus-0.17.2-clang.patch
new file mode 100644
index 000000000000..62950cfcecb9
--- /dev/null
+++ b/dev-libs/liborcus/files/liborcus-0.17.2-clang.patch
@@ -0,0 +1,26 @@
+https://gitlab.com/orcus/orcus/-/commit/469aca3c76965b9031947506a15d940cbcd11cdb
+
+From: Tom Stellard <tstellar@redhat.com>
+Date: Mon, 16 May 2022 22:12:30 +0000
+Subject: [PATCH] Fix error when compiling with clang
+
+csv.cpp:83:29: error: non-constant-expression cannot be narrowed from type 'Py_ssize_t' (aka 'long') to 'std::basic_string_view::size_type' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]
+ app.read_stream({p, n});
+ ^
+csv.cpp:83:29: note: insert an explicit cast to silence this issue
+ app.read_stream({p, n});
+ ^
+ static_cast<size_type>( )
+1 error generated.
+--- a/src/python/csv.cpp
++++ b/src/python/csv.cpp
+@@ -80,7 +80,7 @@ PyObject* csv_read(PyObject* /*module*/, PyObject* args, PyObject* kwargs)
+
+ Py_ssize_t n = 0;
+ const char* p = PyUnicode_AsUTF8AndSize(str.get(), &n);
+- app.read_stream({p, n});
++ app.read_stream({p, static_cast<std::string_view::size_type>(n)});
+
+ return create_document(std::move(doc));
+ }
+GitLab
diff --git a/dev-libs/liborcus/liborcus-0.17.2.ebuild b/dev-libs/liborcus/liborcus-0.17.2.ebuild
index 1bf855fc46a8..cc350aa44e50 100644
--- a/dev-libs/liborcus/liborcus-0.17.2.ebuild
+++ b/dev-libs/liborcus/liborcus-0.17.2.ebuild
@@ -37,6 +37,10 @@ DEPEND="${RDEPEND}
dev-util/mdds:${MDDS_SLOT}
"
+PATCHES=(
+ "${FILESDIR}"/${P}-clang.patch
+)
+
pkg_setup() {
use python && python-single-r1_pkg_setup
}