Package: golang-github-mattn-go-runewidth / 0.0.7-1~bpo10+1

unicode-data.patch Patch series | download
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
Last-Update: 2019-12-26
Forwarded: not-needed
Author: Dmitry Smirnov <onlyjob@debian.org>
Description: avoid download on build time; use data from "unicode-data" package.

--- a/script/generate.go
+++ b/script/generate.go
@@ -4,11 +4,11 @@
 	"bufio"
 	"fmt"
 	"io"
 	"log"
-	"net/http"
 	"os"
 	"strings"
+	"bytes"
 )
 
 type rrange struct {
 	lo rune
@@ -176,20 +176,24 @@
 	defer f.Close()
 
 	fmt.Fprint(f, "package runewidth\n\n")
 
-	resp, err := http.Get("https://unicode.org/Public/12.1.0/ucd/EastAsianWidth.txt")
+	f_eaw, err := os.Open("/usr/share/unicode/EastAsianWidth.txt")
 	if err != nil {
 		log.Fatal(err)
 	}
-	defer resp.Body.Close()
+	txt_eaw := new(bytes.Buffer)
+	txt_eaw.ReadFrom(f_eaw)
+	defer f_eaw.Close()
 
-	eastasian(f, resp.Body)
+	eastasian(f, txt_eaw)
 
-	resp, err = http.Get("https://unicode.org/Public/emoji/12.1/emoji-data.txt")
+	f_ed, err := os.Open("/usr/share/unicode/emoji/emoji-data.txt")
 	if err != nil {
 		log.Fatal(err)
 	}
-	defer resp.Body.Close()
+	txt_ed := new(bytes.Buffer)
+	txt_ed.ReadFrom(f_ed)
+	defer f_ed.Close()
 
-	emoji(f, resp.Body)
+	emoji(f, txt_ed)
 }