[Buildroot] [PATCH 01/20] package/erlang-idna: remove unicode_util_compat library

Johan Oudinet johan.oudinet at gmail.com
Mon May 16 13:13:15 UTC 2022


This library is not needed for the erlang version packaged in
Buildroot. Since it has been recently removed from erlang-idna
upstream repository but not included in any release yet, backport this
commit as a patch to this version.

Signed-off-by: Johan Oudinet <johan.oudinet at gmail.com>
---
 ...1-remove-unicode_util_compat_library.patch | 92 +++++++++++++++++++
 1 file changed, 92 insertions(+)
 create mode 100644 package/erlang-idna/0001-remove-unicode_util_compat_library.patch

diff --git a/package/erlang-idna/0001-remove-unicode_util_compat_library.patch b/package/erlang-idna/0001-remove-unicode_util_compat_library.patch
new file mode 100644
index 0000000000..788e633879
--- /dev/null
+++ b/package/erlang-idna/0001-remove-unicode_util_compat_library.patch
@@ -0,0 +1,92 @@
+From 230a9175a5edb1b1a47fb09af2f4341eab93b1b0 Mon Sep 17 00:00:00 2001
+From: Benoit Chesneau <bchesneau at gmail.com>
+Date: Sat, 5 Dec 2020 11:31:24 +0100
+Subject: [PATCH] remove unicode_util_compat library
+
+remove unicode_util_compat library and support only Erlang >= 20. This
+change simplify the stack and prepare future change to support specific
+features of Erlang 23 and sup.
+---
+ src/idna.app.src     |  2 +-
+ src/idna.erl         | 10 +++++-----
+ src/idna_context.erl |  4 ++--
+ 3 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/src/idna.app.src b/src/idna.app.src
+index a6a7537..d647506 100644
+--- a/src/idna.app.src
++++ b/src/idna.app.src
+@@ -3,7 +3,7 @@
+   {vsn, "6.0.0"},
+   {modules, []},
+   {registered, []},
+-  {applications, [kernel, stdlib, unicode_util_compat]},
++  {applications, [kernel, stdlib]},
+ 
+   {maintainers, ["Benoit Chesneau"]},
+   {licenses, ["BSD"]},
+diff --git a/src/idna.erl b/src/idna.erl
+index 3436dd9..24d96b8 100644
+--- a/src/idna.erl
++++ b/src/idna.erl
+@@ -333,7 +333,7 @@ lowercase_list([], true) ->
+ lowercase_list([], false) ->
+   throw(unchanged);
+ lowercase_list(CPs0, Changed) ->
+-  case unicode_util_compat:lowercase(CPs0) of
++  case unicode_util:lowercase(CPs0) of
+     [Char|CPs] when Char =:= hd(CPs0) -> [Char|lowercase_list(CPs, Changed)];
+     [Char|CPs] -> append(Char,lowercase_list(CPs, true));
+     [] -> lowercase_list([], Changed)
+@@ -346,9 +346,9 @@ lowercase_bin(CP1, <<CP2/utf8, Bin/binary>>, Changed)
+   when CP1 < 128, CP2 < 256 ->
+   [CP1|lowercase_bin(CP2, Bin, Changed)];
+ lowercase_bin(CP1, Bin, Changed) ->
+-  case unicode_util_compat:lowercase([CP1|Bin]) of
++  case unicode_util:lowercase([CP1|Bin]) of
+     [CP1|CPs] ->
+-      case unicode_util_compat:cp(CPs) of
++      case unicode_util:cp(CPs) of
+         [Next|Rest] ->
+           [CP1|lowercase_bin(Next, Rest, Changed)];
+         [] when Changed ->
+@@ -357,7 +357,7 @@ lowercase_bin(CP1, Bin, Changed) ->
+           throw(unchanged)
+       end;
+     [Char|CPs] ->
+-      case unicode_util_compat:cp(CPs) of
++      case unicode_util:cp(CPs) of
+         [Next|Rest] ->
+           [Char|lowercase_bin(Next, Rest, true)];
+         [] ->
+@@ -374,7 +374,7 @@ append(GC, Str) when is_list(GC) -> GC ++ Str.
+ 
+ 
+ characters_to_nfc_list(CD) ->
+-  case unicode_util_compat:nfc(CD) of
++  case unicode_util:nfc(CD) of
+     [CPs|Str] when is_list(CPs) -> CPs ++ characters_to_nfc_list(Str);
+     [CP|Str] -> [CP|characters_to_nfc_list(Str)];
+     [] -> []
+diff --git a/src/idna_context.erl b/src/idna_context.erl
+index afcb814..a09ff1f 100644
+--- a/src/idna_context.erl
++++ b/src/idna_context.erl
+@@ -28,7 +28,7 @@ valid_contextj(Label, Pos) ->
+ valid_contextj(16#200c, Label, Pos) ->
+   if
+      Pos > 0 ->
+-       case unicode_util_compat:lookup(lists:nth(Pos, Label)) of
++       case unicode_util:lookup(lists:nth(Pos, Label)) of
+          #{ ccc := ?virama_combining_class } -> true;
+          _ ->
+            valid_contextj_1(Label, Pos)
+@@ -38,7 +38,7 @@ valid_contextj(16#200c, Label, Pos) ->
+   end;
+ 
+ valid_contextj(16#200d, Label, Pos) when Pos > 0 ->
+-  case unicode_util_compat:lookup(lists:nth(Pos, Label)) of
++  case unicode_util:lookup(lists:nth(Pos, Label)) of
+     #{ ccc := ?virama_combining_class } -> true;
+     _ -> false
+   end;
-- 
2.34.1




More information about the buildroot mailing list