2016-09-11 23:37:58 +02:00
|
|
|
# Maintainer: Martchus <martchus@gmx.net>
|
|
|
|
|
|
|
|
# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
|
|
|
|
# you also find the URL of a binary repository.
|
|
|
|
|
2017-07-15 19:17:28 +02:00
|
|
|
# if tests fail due to timeout, you can try to increase the timeout
|
|
|
|
# by setting SYNCTHING_TEST_TIMEOUT_FACTOR
|
|
|
|
|
2016-09-11 23:37:58 +02:00
|
|
|
# set the web view provider: either webkit, webengine, auto or none
|
|
|
|
_webview_provider=webkit
|
|
|
|
|
2017-03-21 01:02:22 +01:00
|
|
|
# set to non-empty string to enable KIO plugin to show Syncthing actions in
|
|
|
|
# Dolphin file browser
|
|
|
|
_enable_kio_plugin=1
|
|
|
|
|
2017-10-05 00:17:28 +02:00
|
|
|
# set to non-empty string to enable Plasmoid for Plasma 5 desktop
|
2017-08-31 16:17:23 +02:00
|
|
|
_enable_plasmoid=1
|
|
|
|
|
2016-09-11 23:37:58 +02:00
|
|
|
_reponame=syncthingtray
|
2017-02-01 17:39:20 +01:00
|
|
|
pkgname=syncthingtray-git
|
2016-09-11 23:37:58 +02:00
|
|
|
_name=${pkgname%-git}
|
2018-01-12 16:49:18 +01:00
|
|
|
pkgver=0.7.2
|
2016-09-11 23:37:58 +02:00
|
|
|
pkgrel=1
|
|
|
|
arch=('i686' 'x86_64')
|
|
|
|
pkgdesc='Tray application for Syncthing'
|
|
|
|
license=('GPL')
|
2017-03-21 01:02:22 +01:00
|
|
|
depends=('qtutilities-git' 'qt5-svg' 'openssl' 'desktop-file-utils' 'xdg-utils')
|
2016-09-11 23:37:58 +02:00
|
|
|
[[ $_webview_provider == none ]] && depends+=('qt5-base')
|
|
|
|
[[ $_webview_provider == webkit ]] && depends+=('qt5-webkit')
|
|
|
|
[[ $_webview_provider == webengine ]] && depends+=('qt5-webengine')
|
2017-03-21 01:02:22 +01:00
|
|
|
[[ $_enable_kio_plugin ]] && optdepends+=('kio: KIO plugin for Syncthing actions in Dolphin')
|
2017-10-05 00:17:28 +02:00
|
|
|
[[ $_enable_plasmoid ]] && optdepends+=('plasma-workspace: Plasmoid for Plasma 5 desktop')
|
2016-09-11 23:37:58 +02:00
|
|
|
makedepends=('cmake' 'qt5-tools' 'git')
|
2017-03-09 23:21:29 +01:00
|
|
|
checkdepends=('cppunit' 'syncthing')
|
2017-04-02 19:21:23 +02:00
|
|
|
[[ $_enable_kio_plugin ]] && makedepends+=('kio')
|
2017-08-31 16:17:23 +02:00
|
|
|
[[ $_enable_plasmoid ]] && makedepends+=('plasma-framework' 'extra-cmake-modules')
|
2016-09-11 23:37:58 +02:00
|
|
|
provides=("${_name}")
|
|
|
|
conflicts=("${_name}")
|
|
|
|
url="https://github.com/Martchus/${_reponame}"
|
2017-04-02 19:21:23 +02:00
|
|
|
source=("${_reponame}::${MARTCHUS_GIT_URL_PREFIX:-git://github.com/Martchus}/${_reponame}.git")
|
2016-09-11 23:37:58 +02:00
|
|
|
sha256sums=('SKIP')
|
|
|
|
|
2018-02-28 18:05:07 +01:00
|
|
|
ephemeral_port() {
|
|
|
|
local lport=32768;
|
|
|
|
local uport=60999;
|
|
|
|
while true; do
|
|
|
|
local mport=$[$lport + ($RANDOM % $uport)];
|
|
|
|
(echo '' >/dev/tcp/127.0.0.1/${mport}) >/dev/null 2>&1
|
|
|
|
if [[ $? -ne 0 ]]; then
|
|
|
|
echo $mport;
|
|
|
|
return 0;
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2016-09-11 23:37:58 +02:00
|
|
|
pkgver() {
|
2017-03-21 01:02:22 +01:00
|
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame}"
|
2016-09-11 23:37:58 +02:00
|
|
|
echo "$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame}"
|
2017-03-21 01:02:22 +01:00
|
|
|
local additional_args=
|
2017-08-31 16:17:23 +02:00
|
|
|
[[ $_enable_kio_plugin ]] || additional_args+=' -DNO_FILE_ITEM_ACTION_PLUGIN=ON'
|
2017-10-05 00:17:28 +02:00
|
|
|
[[ $_enable_plasmoid ]] || additional_args+=' -DNO_PLASMOID=ON'
|
2016-09-11 23:37:58 +02:00
|
|
|
cmake \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_INSTALL_PREFIX="/usr" \
|
2016-12-30 23:17:39 +01:00
|
|
|
-DWEBVIEW_PROVIDER="${_webview_provider}" \
|
2017-03-21 01:02:22 +01:00
|
|
|
-DSYSTEMD_SUPPORT=ON \
|
|
|
|
$additional_args
|
2016-09-11 23:37:58 +02:00
|
|
|
make
|
|
|
|
}
|
|
|
|
|
2017-03-09 23:21:29 +01:00
|
|
|
check() {
|
|
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame}"
|
2018-02-28 18:05:07 +01:00
|
|
|
make SYNCTHING_PORT=$(ephemeral_port) check
|
2017-03-09 23:21:29 +01:00
|
|
|
}
|
|
|
|
|
2016-09-11 23:37:58 +02:00
|
|
|
package() {
|
|
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame}"
|
|
|
|
make DESTDIR="${pkgdir}" install
|
|
|
|
}
|