Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/schroot/, dev-util/schroot/files/
Date: Mon, 26 Sep 2022 20:01:24
Message-Id: 1664222472.754401ca87d224ab1861e6065f081825cddd15da.sam@gentoo
1 commit: 754401ca87d224ab1861e6065f081825cddd15da
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 26 20:01:03 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 26 20:01:12 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=754401ca
7
8 dev-util/schroot: fix build w/ musl, libcxx
9
10 Closes: https://bugs.gentoo.org/739034
11 Closes: https://bugs.gentoo.org/715514
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 .../files/schroot-1.6.13_p2-build-fixes.patch | 103 +++++++++++++++++++++
15 dev-util/schroot/schroot-1.6.13_p2.ebuild | 4 +
16 2 files changed, 107 insertions(+)
17
18 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
19 new file mode 100644
20 index 000000000000..b10b8b191f96
21 --- /dev/null
22 +++ b/dev-util/schroot/files/schroot-1.6.13_p2-build-fixes.patch
23 @@ -0,0 +1,103 @@
24 +https://codeberg.org/shelter/reschroot/pulls/5
25 +https://bugs.gentoo.org/739034
26 +https://bugs.gentoo.org/715514
27 +
28 +From 56b0c8ac846c18002e32e93629ae04a0a6281706 Mon Sep 17 00:00:00 2001
29 +From: Sam James <sam@g.o>
30 +Date: Mon, 26 Sep 2022 20:52:54 +0100
31 +Subject: [PATCH 1/3] Fix libcxx build without <tr1/*> (use <memory> if
32 + available)
33 +
34 +With Clang & libcxx 15, tr1/* doesn't seem to be available,
35 +which is fine, as we can use the proper <memory> header
36 +instead.
37 +
38 +We already do this in several other locations. Fall back
39 +to tr1 and Boost as before.
40 +
41 +Signed-off-by: Sam James <sam@g.o>
42 +--- a/bin/schroot-base/schroot-base-options.h
43 ++++ b/bin/schroot-base/schroot-base-options.h
44 +@@ -27,7 +27,9 @@
45 + #include <string>
46 + #include <stdexcept>
47 +
48 +-#ifdef HAVE_TR1_MEMORY
49 ++#ifdef HAVE_MEMORY_SHARED_PTR
50 ++#include <memory>
51 ++#elif HAVE_TR1_MEMORY
52 + #include <tr1/memory>
53 + #elif HAVE_BOOST_SHARED_PTR_HPP
54 + #include <boost/shared_ptr.hpp>
55 +--- a/bin/schroot/schroot-options-base.h
56 ++++ b/bin/schroot/schroot-options-base.h
57 +@@ -27,7 +27,9 @@
58 + #include <string>
59 + #include <vector>
60 +
61 +-#ifdef HAVE_TR1_MEMORY
62 ++#ifdef HAVE_MEMORY_SHARED_PTR
63 ++#include <memory>
64 ++#elif HAVE_TR1_MEMORY
65 + #include <tr1/memory>
66 + #elif HAVE_BOOST_SHARED_PTR_HPP
67 + #include <boost/shared_ptr.hpp>
68 +From 04a35b2c57b84e098c9cad75d36675a958e9075e Mon Sep 17 00:00:00 2001
69 +From: Sam James <sam@g.o>
70 +Date: Mon, 26 Sep 2022 20:54:16 +0100
71 +Subject: [PATCH 2/3] Fix localename type
72 +
73 +Needs to be a string.
74 +
75 +Fixes error:
76 +```
77 +/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 '='
78 + localename = std::locale::classic();
79 + ~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
80 +/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
81 + operator=(const basic_string& __str)
82 + ^
83 +[...]
84 +```
85 +
86 +Bug: https://bugs.gentoo.org/739034
87 +Signed-off-by: Sam James <sam@g.o>
88 +--- a/sbuild/sbuild-basic-keyfile.tcc
89 ++++ b/sbuild/sbuild-basic-keyfile.tcc
90 +@@ -214,7 +214,7 @@ sbuild::basic_keyfile<K, P>::get_locale_string (group_name_type const& group,
91 + }
92 + catch (std::runtime_error const& e) // Invalid locale
93 + {
94 +- localename = std::locale::classic();
95 ++ localename = std::locale::classic().name();
96 + }
97 + std::string::size_type pos;
98 + bool status = false;
99 +From 5b00d06a567fe71328124ea53b92ddbd1bd8c6fd Mon Sep 17 00:00:00 2001
100 +From: Sam James <sam@g.o>
101 +Date: Mon, 26 Sep 2022 20:54:45 +0100
102 +Subject: [PATCH 3/3] Add <libintl.h> include for musl
103 +MIME-Version: 1.0
104 +Content-Type: text/plain; charset=UTF-8
105 +Content-Transfer-Encoding: 8bit
106 +
107 +Fixes error:
108 +```
109 +/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&)’:
110 +/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
111 + 48 | stream << feature % pos->first % gettext(pos->second.c_str());
112 + | ^~~~~~~
113 +```
114 +
115 +Bug: https://bugs.gentoo.org/715514
116 +Signed-off-by: Sam James <sam@g.o>
117 +--- a/sbuild/sbuild-feature.cc
118 ++++ b/sbuild/sbuild-feature.cc
119 +@@ -19,6 +19,7 @@
120 + #include <config.h>
121 +
122 + #include <iostream>
123 ++#include <libintl.h>
124 +
125 + #include "sbuild-feature.h"
126 +
127
128 diff --git a/dev-util/schroot/schroot-1.6.13_p2.ebuild b/dev-util/schroot/schroot-1.6.13_p2.ebuild
129 index c1283549302e..33e88c52a9d1 100644
130 --- a/dev-util/schroot/schroot-1.6.13_p2.ebuild
131 +++ b/dev-util/schroot/schroot-1.6.13_p2.ebuild
132 @@ -48,6 +48,10 @@ RDEPEND="${COMMON_DEPEND}
133
134 S="${WORKDIR}/re${PN}"
135
136 +PATCHES=(
137 + "${FILESDIR}"/${PN}-1.6.13_p2-build-fixes.patch
138 +)
139 +
140 src_unpack() {
141 unpack "${P/%_p*}".tar.gz
142 cd "${S}"