summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b4e15a419e1685d498ab1bb705d8356a65b813f0 (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
# Maintainer: Mattia Basaglia <glax@dragon.best>
# Contributor: Sythelux Rikd <dersyth@gmail.com>

## useful links:
# https://glaxnimate.mattbas.org/
# https://gitlab.com/mattbas/glaxnimate
# https://invent.kde.org/graphics/glaxnimate

# basic info
_pkgname="glaxnimate"
pkgname="$_pkgname"
pkgver=0.5.4
pkgrel=6
pkgdesc="Simple vector animation program"
url="https://glaxnimate.mattbas.org/"
license=('GPL-3.0-or-later')
arch=('x86_64' 'i686' 'armv7h' 'aarch64' 'riscv32' 'riscv64')

depends=(
  'ffmpeg'
  'libarchive'
  'potrace'
  'python'
  'qt6-base'
  'qt6-imageformats'
  'qt6-svg'
  'qt6-tools'
)
makedepends=(
  'clang' # lupdate/translations
  'cmake'
  'git'
  'ninja'
  'qt6-declarative'
)

_pkgsrc="kde.$_pkgname"
source=("$_pkgsrc"::"git+https://invent.kde.org/graphics/glaxnimate.git#tag=$pkgver")
sha256sums=('SKIP')

_source_glaxnimate() {
  source+=(
    'kde.breeze-icons'::'git+https://github.com/KDE/breeze-icons.git'
    'mattbas.cmake-lib'::'git+https://gitlab.com/mattbas/CMake-Lib.git'
    'mattbas.python-lottie'::'git+https://gitlab.com/mattbas/python-lottie.git'
    'mattbas.qt-color-widgets'::'git+https://gitlab.com/mattbas/Qt-Color-Widgets.git'
    'mattbas.qt-history-lineedit'::'git+https://gitlab.com/mattbas/Qt-History-LineEdit.git'
    'pybind.pybind11'::'git+https://github.com/pybind/pybind11.git'
    'rpavlik.cmake-modules'::'git+https://github.com/rpavlik/cmake-modules.git'
  )
  sha256sums+=(
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
    'SKIP'
  )
}
_source_glaxnimate

_prepare_glaxnimate() (
  cd "$_pkgsrc"
  local _submodules=(
    'kde.breeze-icons'::'data/icons/breeze-icons'
    'mattbas.cmake-lib'::'cmake'
    'mattbas.python-lottie'::'data/lib/python-lottie'
    'mattbas.qt-color-widgets'::'external/Qt-Color-Widgets'
    'mattbas.qt-history-lineedit'::'external/Qt-History-LineEdit'
    'pybind.pybind11'::'external/QtAppSetup/external/pybind11'
    'rpavlik.cmake-modules'::'external/cmake-modules'
  )
  _submodule_update
)

prepare() {
  _submodule_update() {
    local _module
    for _module in "${_submodules[@]}"; do
      git submodule init "${_module##*::}"
      git submodule set-url "${_module##*::}" "$srcdir/${_module%::*}"
      git -c protocol.file.allow=always submodule update "${_module##*::}"
    done
  }

  _prepare_glaxnimate

  cd "$_pkgsrc"

  # fix for ffmpeg 7.0
  git cherry-pick -n -m1 4fb2b67a0f0ce2fbffb6fe9f87c3bf7914c8a602

  # force Qt6
  sed -E -e 's@Qt5 Qt6@Qt6@' \
    -i CMakeLists.txt \
    external/Qt-History-LineEdit/CMakeLists.txt
}

build() {
  local _cmake_options=(
    -B build
    -S "$_pkgsrc"
    -G Ninja
    -DCMAKE_BUILD_TYPE=None
    -DCMAKE_INSTALL_PREFIX='/usr'
    -DQT_VERSION_MAJOR=6
    -Wno-dev
  )

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

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