summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ebca9b90f4a3d2cf3fe94f06ead5a96043bace4d (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
# Maintainer:
# Contributor: André Kugland <kugland@gmail.com>

# options
: ${_pocketsphinx:=false}

: ${_pkgtype:=-nopocketsphinx-git}

# basic info
_pkgname="subtitlecomposer"
pkgname="$_pkgname${_pkgtype:-}"
pkgver=0.8.0.r77.g4eeaadf
pkgrel=1
pkgdesc="Video subtitle editor"
url="https://invent.kde.org/multimedia/subtitlecomposer"
license=('GPL-2.0-or-later')
arch=('i686' 'x86_64')

depends=(
  'ffmpeg'
  'kcodecs'
  'kcompletion'
  'kconfig'
  'kconfigwidgets'
  'kcoreaddons'
  'ki18n'
  'kio'
  'ktextwidgets'
  'kwidgetsaddons'
  'kxmlgui'
  'libicui18n.so' # icu
  'openal'
  'openssl'
  'qt6-5compat'
  'qt6-base'
  'qt6-declarative'
  'sonnet'
)
makedepends=(
  'blas'
  'extra-cmake-modules'
  'git'
  'jack'
)
_checkdepends=(
  'xorg-server-xvfb'
)
optdepends=(
  'ruby: scripting'
  'python: scripting'
)

if [[ "${_pocketsphinx::1}" == "t" ]]; then
  makedepends+=('pocketsphinx')
  optdepends+=('pocketsphinx: speech recognition')
fi

provides=("$_pkgname=${pkgver%%.r*}")
conflicts=("$_pkgname")

_pkgsrc="$_pkgname"
source=("$_pkgsrc"::"git+$url.git")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --abbrev=7 --exclude='*[a-zA-Z][a-zA-Z]*' \
    | sed -E 's/^[^0-9]*//;s/([^-]*-g)/r\1/;s/-/./g'
}

prepare() {
  if [[ "${_pocketsphinx::1}" != "t" ]]; then
    sed -Ei '/^add_subdirectory(speechplugins\/pocketsphinx)/d' "$_pkgsrc/src/CMakeLists.txt"
  fi
}

build() {
  local _cmake_options=(
    -B build
    -S "$_pkgsrc"
    -DCMAKE_BUILD_TYPE=Release
    -DCMAKE_INSTALL_PREFIX='/usr'
    -DCMAKE_INSTALL_LIBDIR='lib'
    -DQT_MAJOR_VERSION=6
    -DBUILD_TESTING=OFF
    -Wno-dev
  )

  cmake "${_cmake_options[@]}"
  cmake --build build
}

_check() {
  export DISPLAY=:99
  Xvfb :99 >&/dev/null &
  trap "kill $! || true" EXIT
  cmake --build build --target test
}

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