blob: e303b2ec541d0dbbbf4b95e2b982863addc03418 (
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
# Maintainer:
# Contributor: morguldir <morguldir@protonmail.com>
# Contributor: Sefa Eyeoglu <contact@scrumplex.net>
# Contributor: Ivan Semkin (ivan at semkin dot ru)
# Contributor: Martin Weinelt <hexa@darmstadt.ccc.de>
## useful links
# https://matrix.org/
# https://github.com/quotient-im/Quaternion
## options
: ${_build_git:=true}
[[ "${_build_git::1}" == "t" ]] && _pkgtype+="-git"
## basic info
_pkgname="quaternion"
pkgname="$_pkgname${_pkgtype:-}"
pkgver=0.0.95.1.r238.gc074213
pkgrel=1
pkgdesc='Qt-based IM client for the Matrix protocol'
url="https://github.com/quotient-im/Quaternion"
license=('GPL-3.0-or-later' 'LGPL-2.1-or-later')
arch=('aarch64' 'i686' 'x86_64')
## main package
_main_package() {
depends=(
hicolor-icon-theme
qt5-multimedia
qt5-quickcontrols2
qt5-tools
qtkeychain-qt5
)
makedepends=(
cmake
git
)
optdepends=(
'qt5-graphicaleffects: Display the conversation history at startup'
)
if [ "${_build_git::1}" != "t" ] ; then
_main_stable
else
_main_git
fi
}
## stable package
_main_stable() {
_pkgsrc="$_pkgname"
source=(
"$_pkgsrc"::"git+https://github.com/quotient-im/Quaternion#tag=${pkgver%%.r*}"
# submodules for quoternion
"libquotient"::'git+https://github.com/quotient-im/libQuotient'
)
sha256sums=(
'SKIP'
'SKIP'
)
_prepare_package() {
_prepare_submodules_quoternion
}
pkgver() {
echo "${pkgver%%.r*}"
}
}
## git package
_main_git() {
provides=("$_pkgname")
conflicts=("$_pkgname")
_pkgsrc="$_pkgname"
source=(
"$_pkgsrc"::"git+https://github.com/quotient-im/Quaternion"
# submodules for quoternion
"libquotient"::'git+https://github.com/quotient-im/libQuotient'
# submodules for libquotient
'gtad'::'git+https://github.com/quotient-im/gtad.git'
'doxygen-awesome-css'::'git+https://github.com/jothepro/doxygen-awesome-css.git'
)
sha256sums=(
'SKIP'
'SKIP'
'SKIP'
'SKIP'
)
pkgver() {
cd "$_pkgsrc"
git describe --long --tags --exclude '[a-z]*' --exclude '*[a-z][a-z]*' \
| sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
_prepare_package() {
_prepare_submodules_quoternion
_prepare_submodules_libquotient
}
}
## submodules
_prepare_submodules_quoternion() (
cd "$_pkgsrc"
local -A _submodules=(
['libquotient']='lib'
)
_submodule_update
)
_prepare_submodules_libquotient() (
cd "$_pkgsrc/lib"
local -A _submodules=(
['doxygen-awesome-css']='doxygen-awesome-css'
['gtad']='gtad/gtad'
)
_submodule_update
)
## common functions
prepare() {
_submodule_update() {
local key
for key in ${!_submodules[@]} ; do
git submodule init "${_submodules[${key}]}"
git submodule set-url "${_submodules[${key}]}" "${srcdir}/${key}"
git -c protocol.file.allow=always submodule update "${_submodules[${key}]}"
done
}
_prepare_package
}
build() {
local _cmake_options=(
-B build
-S "$_pkgsrc"
-DCMAKE_INSTALL_PREFIX="/usr"
-DCMAKE_BUILD_TYPE=Release
-DUSE_INTREE_LIBQMC=ON
-DBUILD_WITH_QT6=OFF
)
cmake "${_cmake_options[@]}"
cmake --build build
}
package() {
DESTDIR="${pkgdir:?}" cmake --install build
}
## execute
_main_package
|