summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorEinhard Leichtfuß2022-04-29 17:00:47 +0200
committerEinhard Leichtfuß2022-04-29 17:00:47 +0200
commitbac50498da828b11d0069c401921175cf06befc2 (patch)
treebb6d8c15d686b0f6d0d08a28d09f99e7dddd5e05 /PKGBUILD
parentf2a3a12023b3570ef0dd3ba25d44157302b466f4 (diff)
downloadaur-dict-freedict-deu-eng.tar.gz
Update to version 1.9-fd1
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD67
1 files changed, 40 insertions, 27 deletions
diff --git a/PKGBUILD b/PKGBUILD
index d09b1c48d58c..9a8ef364bd52 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,56 +2,69 @@
# README:
# * Building this package takes very long (a day or so) and consumes quite a
-# lot of RAM (> 4 GiB).
+# lot of RAM (> 7 GiB).
# * Consider to use the corresponding -bin package instead.
_lang=deu-eng
-pkgname=dict-freedict-${_lang}
-_dingver=1.8.1
-_pkgver=${_dingver}-fd0.2.1
-pkgver=${_pkgver//-/_}
+pkgname="dict-freedict-${_lang}"
+_dingver=1.9
+_pkgver="${_dingver}-fd1"
+pkgver="${_pkgver//-/_}"
pkgrel=1
-pkgdesc="German -> English dictionary for dictd et al. from Freedict.org"
+pkgdesc="German -> English dictionary for dictd et al. from FreeDict.org"
arch=('any')
url="https://freedict.org/"
license=('GPL' 'AGPL3')
optdepends=('dictd: dict client and server')
-makedepends=('freedict-tools-svn>=1:r443-2')
-install=${pkgname}.install
-source=("https://ftp.tu-chemnitz.de/pub/Local/urz/ding/old-releases/ding-${_dingver}.tar.gz")
-sha512sums=('7d1b459d40e26482c3c16a79565cb897a492fa5807f44c5c3ed1022bcf65ba90bec9cb503cc67970742c2beeb34bd653c684e56ef5492f536254bf475d3f70a4')
+makedepends=('freedict-tools>=1:0.6.0')
+install="${pkgname}.install"
+source=("ding-${_dingver}.gz::https://ftp.tu-chemnitz.de/pub/Local/urz/ding/de-en/de-en.txt.gz")
+sha512sums=('172b61d4ee52ea14385608cca62891ecab22a4136aa5967654f56b5ef4c77c9f4feeb294396be43b7787133fabdfb2ace8648d2ee4fa877cf21ec566a0ef2b77')
+
+
+_freedict_tools_dir=/usr/lib/freedict-tools
+_ding2tei_dir="${_freedict_tools_dir}/importers/ding2tei"
prepare()
{
- mkdir "$_lang"
+ mkdir -p dict/ding
+ ln -s "${srcdir}/ding-${_dingver}" dict/ding/de-en.txt
- printf '%s\n\n%s\n' \
- 'DISTFILES = deu-eng.tei' \
- 'include $(FREEDICT_TOOLS)/mk/dicts.mk' \
- > "${_lang}/Makefile"
+ mkdir -p "dict/tei/${_lang}"
+ ln -s "${_ding2tei_dir}/dict/tei/${_lang}/Makefile" "dict/tei/${_lang}/"
}
build()
{
- local _freedict_tools_dir=/usr/lib/freedict-tools
- local _ding2tei_dir="${_freedict_tools_dir}/importers/ding2tei"
-
- "$_ding2tei_dir"/preprocess/de-en/all.sh \
- < "ding-${_dingver}/de-en.txt" \
- > de-en.txt.preprocessed
+ local _utf8_locale
+ if [[ "$LANG" == *.UTF-8 ]]
+ then
+ _utf8_locale="$LANG"
+ else
+ _utf8_locale="$(localectl list-locales | grep '\.UTF-8$' | head -n 1)"
+ if [[ "$_utf8_locale" == '' ]]
+ then
+ printf 'No UTF-8 locale available. Cannot continue.'
+ return 1
+ fi
+ fi
- "${_ding2tei_dir}/ding2tei" de-en.txt.preprocessed "${_lang}/${_lang}.tei"
+ # Build the TEI XML file.
+ # * ding2tei (incl. the preprocess scripts) needs a UTF-8 locale.
+ # - The tools operating on the built TEI XML should not need this.
+ make -C "$_ding2tei_dir" -o ding2tei LC_ALL="$_utf8_locale" \
+ dictdir="${srcdir}/dict" "${_lang}"
- cd "$_lang"
- make FREEDICT_TOOLS="$_freedict_tools_dir" build-dictd
+ # Build the DICT files (this takes very long).
+ make -C "dict/tei/${_lang}" FREEDICT_TOOLS="$_freedict_tools_dir" \
+ build-dictd
}
package()
{
- install -m 755 -d "${pkgdir}/usr/share/dictd"
- install -m 644 -t "${pkgdir}/usr/share/dictd/" \
- "${_lang}/build/dictd/${_lang}".{dict.dz,index}
+ make -C "dict/tei/${_lang}" FREEDICT_TOOLS="$_freedict_tools_dir" \
+ DESTDIR="$pkgdir" PREFIX=/usr install
}