archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / barrier / trunk / PKGBUILD
bloba20184647ebbee23bd2e4e25ee2c59e428587b86
1 # Maintainer: Morten Linderud <foxboron@archlinux.org>
2 # Contributor: Tilman BLUMENBACH <tilman+aur AT ax86 DOT net>
4 pkgname=(barrier barrier-headless)
5 pkgver=2.4.0
6 pkgrel=2
7 pkgdesc="Open-source KVM software based on Synergy"
8 arch=(x86_64)
9 url="https://github.com/debauchee/barrier"
10 license=("custom:GPL2WithOpenSSLException")
11 changelog=CHANGELOG.rst
12 depends=(curl avahi libx11 libxrandr libxext
13         libxinerama xorgproto libxtst libxi
14         libsm libice openssl)
15 makedepends=(cmake git qt5-base hicolor-icon-theme)
16 source=("git+https://github.com/debauchee/barrier.git#tag=v${pkgver}")
17 sha256sums=('SKIP')
19 prepare() {
20     cd "barrier"
21     git submodule update --init --recursive
22     # lib/platform: Fix encoding for text copied between linux and windows
23     # https://github.com/debauchee/barrier/commit/dd3ea8adfef868e52098ea24d2ed08320a90e3b9
24     git cherry-pick -n dd3ea8adfef868e52098ea24d2ed08320a90e3b9
26     # Add missing cstddef includes for NULL
27     # https://github.com/debauchee/barrier/commit/4b12265ae5d324b942698a3177e1d8b1749414d7
28     git cherry-pick -n 4b12265ae5d324b942698a3177e1d8b1749414d7
31 build() {
32     cd "barrier"
34     mkdir -p build
35     cd build
37     cmake -G "Unix Makefiles" \
38         -D CMAKE_BUILD_TYPE:STRING=Release \
39         -D CMAKE_INSTALL_PREFIX:STRING=/usr \
40         -D BARRIER_REVISION:STRING=00000000 \
41         -D BARRIER_VERSION_STAGE:STRING=RELEASE \
42         ..
43     make
47 _package_common() {
48     # Install binaries:
49     cd "barrier/build"
50     DESTDIR="${pkgdir}" make install
52     # Install the license:
53     cd ..
54     install -m 644 -D LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
56     # Install the manpages:
57     mkdir -p "${pkgdir}/usr/share/man/man1"
58     install -m 644 doc/*.1 "${pkgdir}/usr/share/man/man1"
60     # Install the examples:
61     mkdir -p "${pkgdir}/usr/share/doc/${pkgname}"
62     install -m 644 doc/barrier.conf* "${pkgdir}/usr/share/doc/${pkgname}"
65 package_barrier() {
66     pkgdesc="Open-source KVM software based on Synergy (GUI)"
67     depends=("barrier-headless=${pkgver}-${pkgrel}" qt5-base hicolor-icon-theme)
69     # Install all the files:
70     _package_common
72     # Now go and delete files that are already in
73     # barrier-headless:
74     for file in \
75         /usr/share/doc \
76         /usr/share/man \
77         /usr/bin/barrier{s,c} \
78     ;do
79         rm -rf "${pkgdir}/${file}"
80     done
83 package_barrier-headless() {
84     pkgdesc="Open-source KVM software based on Synergy (client and server CLI binaries)"
86     # Install all the files:
87     _package_common
89     # Now go and delete the GUI-related files:
90     for file in \
91         /usr/bin/barrier \
92         /usr/share/applications \
93         /usr/share/icons \
94     ;do
95         rm -rf "${pkgdir}/${file}"
96     done