-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathPKGBUILD_git
119 lines (101 loc) · 4.15 KB
/
PKGBUILD_git
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
# Maintainer: Valentin Bruch <[email protected]>
# This PKGBUILD file shall simplify testing new features in Arch Linux.
# This does not intended to provide a stable version of BeamerPresenter!
### Customize by changing the following parameters. ###
# Select the git branch
: ${_git_branch:=main} # main or dev
# Enable/disable debugging
: ${_build_type:=Release} # Release or Debug
# Select the Qt version
: ${_qt_version_major:=6} # 5 or 6
# Select the PDF engine
: ${_use_mupdf:=ON} # ON or OFF
: ${_use_poppler:=OFF} # ON or OFF
: ${_use_qtpdf:=OFF} # ON or OFF
: ${_use_external_renderer:=OFF} # ON or OFF
# Other features
: ${_use_webcams:=ON} # ON or OFF
## Remarks on Debugging
# Setting _build_type=Debug enables the --debug command line option
# (see man 1 beamerpresenter). When enabling debugging, the binary
# will contain references to the source code in a temporary directory
# ($srcdir). At the end of the build process, this leads to the output
# "WARNING: Package contains reference to $srcdir".
### Do not change anything below unless you know what you are doing. ###
if pacman -Qq "qt${_qt_version_major}-base"
then
_qt_version_minor="$(pacman -Q "qt${_qt_version_major}-base" | sed -E 's/^qt[56]-base\s*[56]\.([0-9]+)\..*$/\1/')"
_qt_min_version="${_qt_version_major}.${_qt_version_minor}.0"
_qt_max_version="${_qt_version_major}.$(( _qt_version_minor + 1 )).0"
else
_qt_version_minor="x"
_qt_min_version="${_qt_version_major}"
_qt_max_version="$(( _qt_version_major + 1 ))"
fi
pkgname=beamerpresenter-git
pkgver=0.2.6_1009.2000c05
pkgrel=1
pkgdesc="Modular multi-screen pdf presenter (git)"
arch=('x86_64')
url="https://github.com/stiglers-eponym/BeamerPresenter"
license=('AGPL3' 'GPL3')
# depends and makedepends will be filled based on the PDF engine.
depends=("qt${_qt_version_major}-multimedia>=${_qt_min_version}" "qt${_qt_version_major}-multimedia<${_qt_max_version}" "qt${_qt_version_major}-svg>=${_qt_min_version}" "qt${_qt_version_major}-svg<${_qt_max_version}")
makedepends=('cmake' 'ninja' 'git' "qt${_qt_version_major}-tools")
backup=('etc/xdg/beamerpresenter/beamerpresenter.conf' 'etc/xdg/beamerpresenter/gui.json')
source=("${pkgname}-${_git_branch}::git+${url}.git#branch=${_git_branch}")
sha256sums=('SKIP')
if [ "${_use_mupdf}" == 'ON' ]
then
depends+=('jbig2dec' 'openjpeg2' 'gumbo-parser' 'libmupdf')
elif [ "${_use_mupdf}" == 'OFF' ]
then
license=('GPL3')
fi
if [ "${_use_poppler}" == 'ON' ]
then
depends+=("poppler-qt${_qt_version_major}")
fi
if [ "${_use_qtpdf}" == 'ON' ]
then
depends+=("qt${_qt_version_major}-webengine>=${_qt_min_version}" "qt${_qt_version_major}-webengine<${_qt_max_version}")
fi
if [ "${_qt_version_major}" == "5" ]
then
optdepends=('gst-libav: show videos' 'gst-plugins-good: show videos')
fi
pkgver() {
printf "0.2.6_%s.%s" \
"$(git -C "${srcdir}/${pkgname}-${_git_branch}" rev-list --count HEAD)" \
"$(git -C "${srcdir}/${pkgname}-${_git_branch}" rev-parse --short HEAD)"
}
conflicts=('beamerpresenter')
provides=("beamerpresenter=${pkgver}")
build() {
mkdir -p "${pkgname}-${_git_branch}/build"
cmake \
-B "${pkgname}-${_git_branch}/build" \
-S "${srcdir}/${pkgname}-${_git_branch}" \
-G Ninja \
-DCMAKE_BUILD_TYPE="${_build_type}" \
-DGIT_VERSION=ON \
-DUSE_POPPLER="${_use_poppler}" \
-DUSE_MUPDF="${_use_mupdf}" \
-DUSE_QTPDF="${_use_qtpdf}" \
-DUSE_EXTERNAL_RENDERER="${_use_external_renderer}" \
-DUSE_WEBCAMS="${_use_webcams}" \
-DLINK_MUPDF_THIRD=OFF \
-DLINK_GUMBO=ON \
-DUSE_TRANSLATIONS=ON \
-DINSTALL_LICENSE=OFF \
-DQT_VERSION_MAJOR="${_qt_version_major}" \
-DQT_VERSION_MINOR="${_qt_version_minor}" \
-DMUPDF_USE_SYSTEM_LIBS=ON \
-DCMAKE_INSTALL_PREFIX='/usr' \
-DCMAKE_INSTALL_SYSCONFDIR='/etc'
cmake --build "${pkgname}-${_git_branch}/build"
}
package() {
DESTDIR="${pkgdir}" cmake --install "${pkgname}-${_git_branch}/build"
install -Dm644 "${srcdir}/${pkgname}-${_git_branch}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}