blob: 59ca478de5162c58439952a41e49c91df9397a73 (
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
|
# Maintainer: Daniel Bermond <dbermond@archlinux.org>
pkgbase=qhotkey-git
pkgname=('qhotkey-qt6-git' 'qhotkey-qt5-git')
pkgver=1.5.0.r9.gbb63025
pkgrel=1
pkgdesc='Library for creating global shortcut/hotkey for desktop Qt6 applications (git version)'
arch=('x86_64')
url='https://github.com/Skycoder42/QHotkey/'
license=('BSD-3-Clause')
makedepends=(
'cmake'
'git'
'libx11'
'qt5-base'
'qt5-x11extras'
'qt6-base')
source=('git+https://github.com/Skycoder42/QHotkey.git')
sha256sums=('SKIP')
pkgver() {
git -C QHotkey describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}
build() {
local -a _common_opts=(
'-GUnix Makefiles' \
'-DCMAKE_BUILD_TYPE:STRING=None'
'-DCMAKE_INSTALL_PREFIX:PATH=/usr'
'-DCMAKE_POLICY_VERSION_MINIMUM:STRING=3.5.0'
'-DBUILD_SHARED_LIBS:BOOL=ON'
'-Wno-dev')
cmake -B build-qt6 -S QHotkey \
-DCMAKE_INSTALL_INCLUDEDIR:PATH='include/qhotkey-qt6' \
-DCMAKE_INSTALL_LIBDIR:PATH='lib/qhotkey-qt6' \
-DQT_DEFAULT_MAJOR_VERSION:STRING='6' \
"${_common_opts[@]}"
cmake --build build-qt6
cmake -B build-qt5 -S QHotkey \
-DCMAKE_INSTALL_INCLUDEDIR:PATH='include/qhotkey-qt5' \
-DCMAKE_INSTALL_LIBDIR:PATH='lib/qhotkey-qt5' \
"${_common_opts[@]}"
cmake --build build-qt5
}
package_qhotkey-qt6-git() {
depends=(
'gcc-libs'
'glibc'
'libx11'
'qt6-base')
provides=('qhotkey-qt6')
conflicts=('qhotkey-qt6')
DESTDIR="$pkgdir" cmake --install build-qt6
install -D -m644 QHotkey/LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
# create symlinks on the default paths, for the Qt6 library to be the default one
install -d -m755 "${pkgdir}/usr/lib/cmake"
ln -s ../qhotkey-qt6/cmake/QHotkey "${pkgdir}/usr/lib/cmake/QHotkey"
local _file
while read -r -d '' _file
do
ln -s "qhotkey-qt6/${_file##*/}" "${pkgdir}/usr/include/${_file##*/}"
done < <(find "${pkgdir}/usr/include/qhotkey-qt6" -mindepth 1 -maxdepth 1 -print0)
while read -r -d '' _file
do
ln -s "qhotkey-qt6/${_file##*/}" "${pkgdir}/usr/lib/${_file##*/}"
done < <(find -L "${pkgdir}/usr/lib/qhotkey-qt6" -mindepth 1 -maxdepth 1 -type f -print0)
}
package_qhotkey-qt5-git() {
pkgdesc="$(sed '/Qt6/s/6/5/' <<< "$pkgdesc")"
depends=(
'gcc-libs'
'glibc'
'libx11'
'qt5-base'
'qt5-x11extras')
provides=('qhotkey-qt5')
conflicts=('qhotkey-qt5')
DESTDIR="$pkgdir" cmake --install build-qt5
install -D -m644 QHotkey/LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
|