summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 13b0a6fb2794a62a33db414083d0ed68677e3cf3 (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
# Maintainer: Nikolay Bogoychev <nheart@gmail.com>
# Improved by yochananmarqos https://aur.archlinux.org/packages/translatelocally-git
pkgname=translatelocally-git
pkgver=r508.a210037
pkgrel=2
pkgdesc="Fast and secure translation on your local machine, powered by marian and Bergamot."
arch=('x86_64')
url="https://translatelocally.com"
license=('MIT')
depends=('libarchive' 'qt6-base' 'qt6-svg' 'pcre2')
makedepends=('cmake' 'git' 'intel-oneapi-mkl' 'qt6-tools')
source=('git+https://github.com/XapaJIaMnu/translateLocally.git')
sha256sums=('SKIP')

pkgver() {
  cd translateLocally
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd translateLocally

  # There are many submodules that may change occasionally
  git submodule update --init --recursive
  git -c protocol.file.allow=always submodule update
}

build() {
  cmake -B build -S translateLocally \
    -DCMAKE_BUILD_TYPE='Release' \
    -DCMAKE_INSTALL_PREFIX='/usr' \
    -Wno-dev
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build

  cd translateLocally

  # Yes, they spelled it wrong...
  install -Dm644 LICENCE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
}