summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-09-26 21:01:03 +0100
committerSam James <sam@gentoo.org>2022-09-26 21:01:12 +0100
commit754401ca87d224ab1861e6065f081825cddd15da (patch)
tree0d825dcc408bd0afef40c2ad5fb140d511da9164 /dev-util/schroot
parentmedia-gfx/kgraphviewer: update EAPI 7 -> 8, HighDpi, drop obsolete dep (diff)
downloadgentoo-754401ca87d224ab1861e6065f081825cddd15da.tar.gz
gentoo-754401ca87d224ab1861e6065f081825cddd15da.tar.bz2
gentoo-754401ca87d224ab1861e6065f081825cddd15da.zip
dev-util/schroot: fix build w/ musl, libcxx
Closes: https://bugs.gentoo.org/739034 Closes: https://bugs.gentoo.org/715514 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-util/schroot')
-rw-r--r--dev-util/schroot/files/schroot-1.6.13_p2-build-fixes.patch103
-rw-r--r--dev-util/schroot/schroot-1.6.13_p2.ebuild4
2 files changed, 107 insertions, 0 deletions
diff --git a/dev-util/schroot/files/schroot-1.6.13_p2-build-fixes.patch b/dev-util/schroot/files/schroot-1.6.13_p2-build-fixes.patch
new file mode 100644
index 000000000000..b10b8b191f96
--- /dev/null
+++ b/dev-util/schroot/files/schroot-1.6.13_p2-build-fixes.patch
@@ -0,0 +1,103 @@
+https://codeberg.org/shelter/reschroot/pulls/5
+https://bugs.gentoo.org/739034
+https://bugs.gentoo.org/715514
+
+From 56b0c8ac846c18002e32e93629ae04a0a6281706 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 26 Sep 2022 20:52:54 +0100
+Subject: [PATCH 1/3] Fix libcxx build without <tr1/*> (use <memory> if
+ available)
+
+With Clang & libcxx 15, tr1/* doesn't seem to be available,
+which is fine, as we can use the proper <memory> header
+instead.
+
+We already do this in several other locations. Fall back
+to tr1 and Boost as before.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/bin/schroot-base/schroot-base-options.h
++++ b/bin/schroot-base/schroot-base-options.h
+@@ -27,7 +27,9 @@
+ #include <string>
+ #include <stdexcept>
+
+-#ifdef HAVE_TR1_MEMORY
++#ifdef HAVE_MEMORY_SHARED_PTR
++#include <memory>
++#elif HAVE_TR1_MEMORY
+ #include <tr1/memory>
+ #elif HAVE_BOOST_SHARED_PTR_HPP
+ #include <boost/shared_ptr.hpp>
+--- a/bin/schroot/schroot-options-base.h
++++ b/bin/schroot/schroot-options-base.h
+@@ -27,7 +27,9 @@
+ #include <string>
+ #include <vector>
+
+-#ifdef HAVE_TR1_MEMORY
++#ifdef HAVE_MEMORY_SHARED_PTR
++#include <memory>
++#elif HAVE_TR1_MEMORY
+ #include <tr1/memory>
+ #elif HAVE_BOOST_SHARED_PTR_HPP
+ #include <boost/shared_ptr.hpp>
+From 04a35b2c57b84e098c9cad75d36675a958e9075e Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 26 Sep 2022 20:54:16 +0100
+Subject: [PATCH 2/3] Fix localename type
+
+Needs to be a string.
+
+Fixes error:
+```
+/var/tmp/portage/dev-util/schroot-1.6.10_p7/work/schroot-1.6.10/sbuild/sbuild-basic-keyfile.tcc:217:18: error: no viable overloaded '='
+ localename = std::locale::classic();
+ ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
+/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/include/g++-v10/bits/basic_string.h:665:7: note: candidate function not viable: no known conversion from 'const std::locale' to 'const std::__cxx11::basic_string<char>' for 1st argument
+ operator=(const basic_string& __str)
+ ^
+[...]
+```
+
+Bug: https://bugs.gentoo.org/739034
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/sbuild/sbuild-basic-keyfile.tcc
++++ b/sbuild/sbuild-basic-keyfile.tcc
+@@ -214,7 +214,7 @@ sbuild::basic_keyfile<K, P>::get_locale_string (group_name_type const& group,
+ }
+ catch (std::runtime_error const& e) // Invalid locale
+ {
+- localename = std::locale::classic();
++ localename = std::locale::classic().name();
+ }
+ std::string::size_type pos;
+ bool status = false;
+From 5b00d06a567fe71328124ea53b92ddbd1bd8c6fd Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 26 Sep 2022 20:54:45 +0100
+Subject: [PATCH 3/3] Add <libintl.h> include for musl
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fixes error:
+```
+/var/tmp/portage/dev-util/schroot-1.6.10_p7/work/schroot-1.6.10/sbuild/sbuild-feature.cc: In static member function ‘static std::ostream& sbuild::feature::print_features(std::ostream&)’:
+/var/tmp/portage/dev-util/schroot-1.6.10_p7/work/schroot-1.6.10/sbuild/sbuild-feature.cc:48:40: error: ‘gettext’ was not declared in this scope
+ 48 | stream << feature % pos->first % gettext(pos->second.c_str());
+ | ^~~~~~~
+```
+
+Bug: https://bugs.gentoo.org/715514
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/sbuild/sbuild-feature.cc
++++ b/sbuild/sbuild-feature.cc
+@@ -19,6 +19,7 @@
+ #include <config.h>
+
+ #include <iostream>
++#include <libintl.h>
+
+ #include "sbuild-feature.h"
+
diff --git a/dev-util/schroot/schroot-1.6.13_p2.ebuild b/dev-util/schroot/schroot-1.6.13_p2.ebuild
index c1283549302e..33e88c52a9d1 100644
--- a/dev-util/schroot/schroot-1.6.13_p2.ebuild
+++ b/dev-util/schroot/schroot-1.6.13_p2.ebuild
@@ -48,6 +48,10 @@ RDEPEND="${COMMON_DEPEND}
S="${WORKDIR}/re${PN}"
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.6.13_p2-build-fixes.patch
+)
+
src_unpack() {
unpack "${P/%_p*}".tar.gz
cd "${S}"