diff options
-rw-r--r-- | .SRCINFO | 36 | ||||
-rw-r--r-- | PKGBUILD | 68 |
2 files changed, 90 insertions, 14 deletions
@@ -1,16 +1,40 @@ pkgbase = freedict-tools - pkgdesc = Tools to compile the Freedict dictionaries - pkgver = 0.5.0_beta.4 + pkgdesc = Tools to compile the FreeDict dictionaries + pkgver = 0.6.0 pkgrel = 1 + epoch = 1 url = https://freedict.org/ arch = any license = GPL license = GPL3 license = CC-BY-SA + license = AGPL3 + makedepends = ghc + makedepends = alex + makedepends = happy + depends = make depends = libxslt - depends = espeak - source = freedict-tools_0.5.0-beta.4.tar.gz::https://api.github.com/repos/freedict/tools/tarball/0.5.0-beta.4 - sha512sums = 2ec09762bdac9e61da27104422ff89e4521e8abb3f4a1b3853a19038238701fa7ee28af327f369fc1bcdd44423a8c7050b6ec3ed5f613cb208953cbf54773889 + depends = tar + depends = gzip + depends = dictd + depends = perl + depends = espeak-ng + depends = python>3.4 + depends = perl-xml-libxml + depends = perl-xml-libxslt + depends = iso-codes + depends = which + depends = haskell-base + depends = haskell-containers + depends = haskell-transformers + depends = haskell-pretty + depends = haskell-xml + depends = haskell-safe + depends = bash + depends = sed + depends = make + depends = coreutils + source = freedict-tools-0.6.0.tar.gz::https://github.com/freedict/tools/archive/refs/tags/0.6.0.tar.gz + sha512sums = e525a767b5468e16270838ff4e6e6773af9a062a50b6b0c01b9f4bbc06ecc33ac3c1ae5d5cb133041abba24214289e22f9c1a38fd585b2b936491663380c6aff pkgname = freedict-tools - @@ -1,22 +1,74 @@ # Maintainer: Einhard Leichtfuß <alguien@respiranto.de> + pkgname=freedict-tools -pkgver=0.5.0_beta.4 +epoch=1 +pkgver=0.6.0 _pkgver=${pkgver/_/-} pkgrel=1 -pkgdesc="Tools to compile the Freedict dictionaries" +pkgdesc="Tools to compile the FreeDict dictionaries" arch=('any') url="https://freedict.org/" -license=('GPL' 'GPL3' 'CC-BY-SA') -depends=('libxslt' 'espeak') -source=("freedict-tools_${_pkgver}.tar.gz::https://api.github.com/repos/freedict/tools/tarball/${_pkgver}") -sha512sums=('2ec09762bdac9e61da27104422ff89e4521e8abb3f4a1b3853a19038238701fa7ee28af327f369fc1bcdd44423a8c7050b6ec3ed5f613cb208953cbf54773889') +license=('GPL' 'GPL3' 'CC-BY-SA' 'AGPL3') +depends=('make' 'libxslt' 'tar' 'gzip' 'dictd' 'perl' 'espeak-ng' + 'python>3.4' 'perl-xml-libxml' 'perl-xml-libxslt' 'iso-codes' + 'which' + # ding2tei: + 'haskell-base' 'haskell-containers' 'haskell-transformers' + 'haskell-pretty' 'haskell-xml' 'haskell-safe' + 'bash' 'sed' 'make' 'coreutils') +makedepends=('ghc' 'alex' 'happy') # ding2tei +source=("${pkgname}-${_pkgver}.tar.gz::https://github.com/freedict/tools/archive/refs/tags/${_pkgver}.tar.gz") +sha512sums=('e525a767b5468e16270838ff4e6e6773af9a062a50b6b0c01b9f4bbc06ecc33ac3c1ae5d5cb133041abba24214289e22f9c1a38fd585b2b936491663380c6aff') + + +prepare() +{ + sed -Ei 's/^HCFLAGS =/& -dynamic/' \ + "tools-${_pkgver}/importers/ding2tei/GNUmakefile" +} + + +build() +{ + # Build ding2tei. + # * A UTF-8 locale is required. + + 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 + + make -C "tools-${_pkgver}/importers/ding2tei" LC_ALL="$_utf8_locale" +} + package() { mkdir -p "${pkgdir}/usr/lib/${pkgname}" - cp -r freedict-tools-*/. "${pkgdir}/usr/lib/${pkgname}/" + + # `*': Exclude `.gitignore'. + cp -r "tools-${_pkgver}"/* "${pkgdir}/usr/lib/${pkgname}/" + + # ding2tei: Delete unnecessary files. + cd "${pkgdir}/usr/lib/${pkgname}/importers/ding2tei" + mv src/preprocess/ . + find . -regextype posix-extended \ + -mindepth 1 -maxdepth 1 \ + ! -regex '\./(ding2tei|preprocess|GNUmakefile|README|dict)' \ + -exec rm -rf '{}' + + + # Adjust ding2tei Makefile to changed location of `preprocess/'. + sed -Ei 's/^(srcdir) = .*$/\1 = ./' GNUmakefile mkdir -p "${pkgdir}/usr/share/doc/freedict/tools" - ln -s /usr/lib/${pkgname}/README.md \ + ln -s "/usr/lib/${pkgname}/README.md" \ "${pkgdir}/usr/share/doc/freedict/tools/" } |