summaryrefslogtreecommitdiffstats
path: root/arch/tde-base/tde-i18n/PKGBUILD
blob: f598f6a1e9f05ee830988d000fc70e413c370aeb (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
# Contributor: Slávek Banko <slavek.banko@axis.cz>

_mod=tde-i18n
_cat=core/
_kdemod="${_mod/tde/kde}"

pkgbase="tde-${_mod/tde-}"
pkgname=("$pkgbase")
pkgver=14.0.12
pkgrel=1
pkgdesc="Internationalized (i18n) files for TDE"
arch=('any')
url="https://scm.trinitydesktop.org/scm/git/${_mod}"
license=('GPL')
groups=('tde-base')
makedepends=('tde-cmake-trinity')
depends=('tde-tdelibs')
options=('staticlibs' 'libtool' '!strip')
source=("https://mirror.ppa.trinitydesktop.org/trinity/releases/R${pkgver}/main/${_cat}${_mod}-trinity-${pkgver}.tar.xz")
md5sums=('62e049f7717401eed9994d05c1430578')
install=''

_languages=(
  'af               "Afrikaans"'
  'ar               "Arabic"'
  'az               "Azerbaijani"'
  'be               "Belarusian"'
  'bg               "Bulgarian"'
  'bn               "Bengali"'
  'br               "Breton"'
  'bs               "Bosnian"'
  'ca               "Catalan"'
  'cs               "Czech"'
  'csb              "Kashubian"'
  'cy               "Welsh"'
  'da               "Danish"'
  'de               "German"'
  'el               "Greek"'
  'en_GB            "English (British)"'
  'eo               "Esperanto"'
  'es               "Spanish"'
  'es_AR            "Spanish (Argentina)"'
  'et               "Estonian"'
  'eu               "Basque"'
  'fa               "Persian"'
  'fi               "Finnish"'
  'fr               "French"'
  'fy               "Frisian"'
  'ga               "Irish"'
  'gl               "Galician"'
  'he               "Hebrew"'
  'hi               "Hindi"'
  'hr               "Croatian"'
  'hu               "Hungarian"'
  'is               "Icelandic"'
  'it               "Italian"'
  'ja               "Japanese"'
  'kk               "Kazakh"'
  'km               "Khmer"'
  'ko               "Korean"'
  'lt               "Lithuanian"'
  'lv               "Latvian"'
  'mk               "Macedonian"'
  'mn               "Mongolian"'
  'ms               "Malay"'
  'nb               "Norwegian Bokmål"'
  'nds              "Low Saxon"'
  'nl               "Dutch"'
  'nn               "Norwegian Nynorsk"'
  'pa               "Punjabi"'
  'pl               "Polish"'
  'pt               "Portuguese"'
  'pt_BR            "Portuguese (Brazil)"'
  'ro               "Romanian"'
  'ru               "Russian"'
  'rw               "Kinyarwanda"'
  'se               "Northern Sami"'
  'sk               "Slovak"'
  'sl               "Slovenian"'
  'sr               "Serbian"'
  'sr@Latn          "Serbian Latin"'
  'ss               "Swati"'
  'sv               "Swedish"'
  'ta               "Tamil"'
  'te               "Telugu"'
  'tg               "Tajik"'
  'th               "Thai"'
  'tr               "Turkish"'
  'uk               "Ukrainian"'
  'uz               "Uzbek"'
  'uz@cyrillic      "Uzbek (Cyrillic)"'
  'vi               "Vietnamese"'
  'wa               "Walloon"'
  'zh_CN            "Chinese (Simplified)"'
  'zh_TW            "Chinese (Traditional)"'
)

_pkglangs=()
for _lang in "${_languages[@]}"; do
  _locale=${_lang%% *}
  _pkglang=$(echo ${_locale,,} | tr '[:upper:]' '[:lower:]' | \
             sed "s|@latn|latin|" | \
             tr -d "_" | tr -d "@")
  _pkgname=${pkgbase}-${_pkglang}

  pkgname+=($_pkgname)
  _pkglangs+=($_pkgname)
  eval "package_$_pkgname() {
    _package $_pkglang $_lang
  }"
done

_package() {
  pkgdesc="$3 ($2) internationalized (i18n) files for TDE"
  provides=("${_mod}-${1}")
  conflicts=("trinity-${_kdemod}-${1}" "kdemod3-${_kdemod}-${1}")
  replaces=("trinity-${_mod}-${1}")

  msg "Packaging - $pkgname-$pkgver"
  cd ${srcdir}/build
  DESTDIR="${pkgdir}" ninja -j1 install-${2/@/_}
}

[ -n "$TDEDIR" ] || TDEDIR=/opt/trinity

build() {
   msg "Creating out-of-source build directory: ${srcdir}/build"
   mkdir -p ${srcdir}/build
   cd ${srcdir}/build

   msg "Starting cmake..."
   cmake ${srcdir}/${pkgname}-trinity-${pkgver} \
     -GNinja \
     -DCMAKE_VERBOSE_MAKEFILE=ON \
     -DCMAKE_INSTALL_PREFIX=${TDEDIR} \
     -DBUILD_ALL=ON

   msg "Building - ${pkgname#*-}..."
   ninja $NUMJOBS
}

package_tde-i18n() {
  pkgdesc="All languages (all) internationalized (i18n) files for TDE"
  provides=("${_mod}")
  conflicts=("trinity-${_kdemod}" "kdemod3-${_kdemod}")
  replaces=("trinity-${_mod}")
  depends+=(${_pkglangs[@]})
}