Allow for builing twice
Alexandre Viau
8 years ago
0 | |
Description: Generate table.go during build
|
1 | |
Upstream ships with a pre-built table.go file. It is
|
2 | |
best to build it ourselves.
|
3 | |
Author: Alexandre Viau <alexandre@alexandreviau.net>
|
4 | |
Last-Update: 2015-09-04
|
5 | |
|
6 | |
--- /dev/null
|
7 | |
+++ b/generate_table.go
|
8 | |
@@ -0,0 +1,2 @@
|
9 | |
+package unidecode
|
|
0 |
--- a/unidecode.go
|
|
1 |
+++ b/unidecode.go
|
|
2 |
@@ -1,6 +1,7 @@
|
|
3 |
// Package unidecode implements a unicode transliterator
|
|
4 |
// which replaces non-ASCII characters with their ASCII
|
|
5 |
// approximations.
|
10 | 6 |
+//go:generate go run make_table.go
|
|
7 |
package unidecode
|
|
8 |
|
|
9 |
import (
|
6 | 6 |
SOURCE = $(TMP)/../
|
7 | 7 |
|
8 | 8 |
%:
|
9 | |
dh $@ --buildsystem=golang --with=golang
|
|
9 |
dh $@ --buildsystem=golang --with=golang --builddirectory=_build
|
10 | 10 |
|
11 | |
override_dh_auto_build:
|
12 | |
# Also install table.txt
|
13 | |
rm $(SOURCE)/table.go
|
14 | |
cp $(SOURCE)/table.txt $(CURDIR)/*/src/github.com/rainycape/unidecode/
|
15 | |
dh_auto_build
|
|
11 |
override_dh_auto_configure:
|
|
12 |
dh_auto_configure
|
|
13 |
# Don't use included table.go + install table.txt
|
|
14 |
rm _build/src/github.com/rainycape/unidecode/table.go
|
|
15 |
cp $(SOURCE)/table.txt _build/src/github.com/rainycape/unidecode/table.txt
|