void-packages/srcpkgs/Aegisub/patches/fix-icu-62-build.patch
Đoàn Trần Công Danh ec4c2d75fa srcpkgs/[A-Z]*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.-][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.-][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

57 lines
2.1 KiB
Diff

Upstream: Yes
Author: sidneys <sidneys.github.io@outlook.com>
Reason: fix build w/ ICU >= 60
--- a/libaegisub/common/character_count.cpp
+++ b/libaegisub/common/character_count.cpp
@@ -36,7 +36,7 @@ icu::BreakIterator& get_break_iterator(const char *ptr, size_t len) {
static std::once_flag token;
std::call_once(token, [&] {
UErrorCode status = U_ZERO_ERROR;
- bi.reset(BreakIterator::createCharacterInstance(Locale::getDefault(), status));
+ bi.reset(icu::BreakIterator::createCharacterInstance(icu::Locale::getDefault(), status));
if (U_FAILURE(status)) throw agi::InternalError("Failed to create character iterator");
});
@@ -58,7 +58,7 @@ size_t count_in_range(Iterator begin, Iterator end, int mask) {
size_t count = 0;
auto pos = character_bi.first();
- for (auto end = character_bi.next(); end != BreakIterator::DONE; pos = end, end = character_bi.next()) {
+ for (auto end = character_bi.next(); end != icu::BreakIterator::DONE; pos = end, end = character_bi.next()) {
if (!mask)
++count;
else {
@@ -143,7 +143,7 @@ size_t IndexOfCharacter(std::string const& str, size_t n) {
auto& bi = get_break_iterator(&str[0], str.size());
for (auto pos = bi.first(), end = bi.next(); ; --n, pos = end, end = bi.next()) {
- if (end == BreakIterator::DONE)
+ if (end == icu::BreakIterator::DONE)
return str.size();
if (n == 0)
return pos;
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -270,9 +270,9 @@ agi::fs::path SaveFileSelector(wxString const& message, std::string const& optio
}
wxString LocalizedLanguageName(wxString const& lang) {
- Locale iculoc(lang.c_str());
+ icu::Locale iculoc(lang.c_str());
if (!iculoc.isBogus()) {
- UnicodeString ustr;
+ icu::UnicodeString ustr;
iculoc.getDisplayName(iculoc, ustr);
#ifdef _MSC_VER
return wxString(ustr.getBuffer());
--- a/src/utils.cpp
+++ b/src/utils.cpp
@@ -44,6 +44,7 @@
#include <boost/filesystem/path.hpp>
#include <map>
#include <unicode/locid.h>
+#include <unicode/unistr.h>
#include <wx/clipbrd.h>
#include <wx/filedlg.h>
#include <wx/stdpaths.h>