summaryrefslogtreecommitdiff
path: root/dev-erlang/idna/files/0001-Remove-dependency-on-unicode_util_compat.patch
blob: 0737b1842360992233c5bf24c605d39844252502 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
From 9c91cd33265f4706e5e614349b879c059ffaeaf9 Mon Sep 17 00:00:00 2001
From: Florian Schmaus <flo@geekplace.eu>
Date: Thu, 8 Apr 2021 19:43:43 +0200
Subject: [PATCH] Remove dependency on unicode_util_compat
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Newer erlang versions, and this includes all dev-lang/erlang version
currently in ::gentoo, do not require unicode_util_compat.

This is based on
https://github.com/benoitc/erlang-idna/pull/31/. Holger Weiß suggested
to additionaly patch unicode_util_compat out of
src/idna.app.src. Thanks Holger. :)

Signed-off-by: Florian Schmaus <flo@geekplace.eu>
Suggested-by: Holger Weiß <holger@zedat.fu-berlin.de>
---
 rebar.config         |  2 +-
 rebar.config.script  | 11 -----------
 rebar.lock           |  6 ------
 src/idna.app.src     |  2 +-
 src/idna.erl         | 10 +++++-----
 src/idna_context.erl |  4 ++--
 6 files changed, 9 insertions(+), 26 deletions(-)
 delete mode 100644 rebar.config.script
 delete mode 100644 rebar.lock

diff --git a/rebar.config b/rebar.config
index 84fd954aea01..cd0201386367 100644
--- a/rebar.config
+++ b/rebar.config
@@ -1,3 +1,3 @@
 {erl_opts, []}.
 
-{deps, [{unicode_util_compat, "0.4.1"}]}.
+{deps, []}.
diff --git a/rebar.config.script b/rebar.config.script
deleted file mode 100644
index d2bce945b8b2..000000000000
--- a/rebar.config.script
+++ /dev/null
@@ -1,11 +0,0 @@
-IsRebar3 = erlang:function_exported(rebar3, main, 1),
-Rebar2Deps = [{unicode_util_compat, ".*",
-               {git, "https://github.com/benoitc/unicode_util_compat.git",
-                {tag, "0.3.1"}}}
-             ],
-case IsRebar3 of
-    true ->
-        CONFIG;
-    false ->
-        lists:keyreplace(deps, 1, CONFIG, {deps, Rebar2Deps})
-end.
diff --git a/rebar.lock b/rebar.lock
deleted file mode 100644
index 15fc8a117070..000000000000
--- a/rebar.lock
+++ /dev/null
@@ -1,6 +0,0 @@
-{"1.1.0",
-[{<<"unicode_util_compat">>,{pkg,<<"unicode_util_compat">>,<<"0.4.1">>},0}]}.
-[
-{pkg_hash,[
- {<<"unicode_util_compat">>, <<"D869E4C68901DD9531385BB0C8C40444EBF624E60B6962D95952775CAC5E90CD">>}]}
-].
diff --git a/src/idna.app.src b/src/idna.app.src
index a6a75374351b..d6475067c2ad 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 3436dd995477..24d96b810ceb 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 afcb814956e3..a09ff1f92992 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.30.2