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
|
2018-12-09 14:15:51 +01:00
|
|
|
_webview_provider=${SYNCTHING_TRAY_WEBVIEW_PROVIDER:-webengine}
|
2018-11-01 05:16:53 +01:00
|
|
|
|
|
|
|
# set the JavaScript provider: either script, qml, auto or none
|
|
|
|
_js_provider=${SYNCTHING_TRAY_JS_PROVIDER:-qml}
|
2016-09-11 23:37:58 +02:00
|
|
|
|
2017-02-09 16:51:59 +01:00
|
|
|
# set to non-empty string to enable KIO plugin to show Syncthing actions in
|
|
|
|
# Dolphin file browser
|
2018-11-01 05:16:53 +01:00
|
|
|
_enable_kio_plugin=${SYNCTHING_TRAY_ENABLE_KIO_PLUGIN:-1}
|
2017-02-09 16:51:59 +01:00
|
|
|
|
2017-10-05 00:17:28 +02:00
|
|
|
# set to non-empty string to enable Plasmoid for Plasma 5 desktop
|
2018-11-01 05:16:53 +01:00
|
|
|
_enable_plasmoid=${SYNCTHING_TRAY_ENABLE_PLASMOID:-1}
|
|
|
|
|
|
|
|
[[ $_enable_kio_plugin == 0 ]] && _enable_kio_plugin=
|
|
|
|
[[ $_enable_plasmoid == 0 ]] && _enable_plasmoid=
|
2017-10-05 00:17:28 +02:00
|
|
|
|
2016-09-11 23:37:58 +02:00
|
|
|
_reponame=syncthingtray
|
|
|
|
pkgname=syncthingtray
|
2022-08-02 19:00:03 +02:00
|
|
|
pkgver=1.2.2
|
|
|
|
pkgrel=1
|
2018-11-01 05:16:53 +01:00
|
|
|
arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
|
2016-09-11 23:37:58 +02:00
|
|
|
pkgdesc='Tray application for Syncthing'
|
|
|
|
license=('GPL')
|
2022-07-09 12:21:22 +02:00
|
|
|
depends=('libqtutilities.so' 'libqtforkawesome.so' 'libc++utilities.so' 'libboost_filesystem.so' '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')
|
2018-12-30 23:40:48 +01:00
|
|
|
[[ $_js_provider == script ]] && depends+=('qt5-script')
|
|
|
|
[[ $_js_provider == qml ]] && depends+=('qt5-declarative')
|
2017-02-09 16:51:59 +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')
|
2021-06-27 22:07:58 +02:00
|
|
|
makedepends=('cmake' 'ninja' 'qt5-tools' 'mesa' 'boost')
|
2019-05-21 18:04:20 +02:00
|
|
|
checkdepends=('cppunit' 'syncthing' 'iproute2')
|
2017-02-09 16:51:59 +01:00
|
|
|
[[ $_enable_kio_plugin ]] && makedepends+=('kio')
|
2017-10-05 00:17:28 +02:00
|
|
|
[[ $_enable_plasmoid ]] && makedepends+=('plasma-framework' 'extra-cmake-modules')
|
2016-09-11 23:37:58 +02:00
|
|
|
url="https://github.com/Martchus/${_reponame}"
|
2016-10-03 14:23:34 +02:00
|
|
|
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/Martchus/${_reponame}/archive/v${pkgver}.tar.gz")
|
2022-08-02 19:00:03 +02:00
|
|
|
sha256sums=('0f556e30091ffc06e7e489c5e09e5460401c28fd1e8318b68cb6066ead7fe7a1')
|
2016-09-11 23:37:58 +02:00
|
|
|
|
2018-02-28 18:05:07 +01:00
|
|
|
ephemeral_port() {
|
2018-03-19 20:08:17 +01:00
|
|
|
comm -23 <(seq 49152 65535) <(ss -tan | awk '{print $4}' | cut -d':' -f2 | grep "[0-9]\{1,5\}" | sort | uniq) | shuf | head -n 1
|
2018-02-28 18:05:07 +01:00
|
|
|
}
|
|
|
|
|
2016-09-11 23:37:58 +02:00
|
|
|
build() {
|
|
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}"
|
2019-05-04 16:29:53 +02:00
|
|
|
|
2017-02-09 16:51:59 +01:00
|
|
|
local additional_args=
|
2017-10-05 00:17:28 +02:00
|
|
|
[[ $_enable_kio_plugin ]] || additional_args+=' -DNO_FILE_ITEM_ACTION_PLUGIN=ON'
|
|
|
|
[[ $_enable_plasmoid ]] || additional_args+=' -DNO_PLASMOID=ON'
|
2019-05-04 16:29:53 +02:00
|
|
|
|
2016-09-11 23:37:58 +02:00
|
|
|
cmake \
|
2020-10-04 01:04:01 +02:00
|
|
|
-G Ninja \
|
2019-05-04 16:29:53 +02:00
|
|
|
-DCMAKE_BUILD_TYPE:STRING='Release' \
|
|
|
|
-DCMAKE_INSTALL_PREFIX:PATH='/usr' \
|
|
|
|
-DBUILD_SHARED_LIBS:BOOL=ON \
|
2016-12-30 23:17:39 +01:00
|
|
|
-DWEBVIEW_PROVIDER="${_webview_provider}" \
|
2018-11-01 05:16:53 +01:00
|
|
|
-DJS_PROVIDER="${_js_provider}" \
|
2017-02-09 16:51:59 +01:00
|
|
|
-DSYSTEMD_SUPPORT=ON \
|
2020-11-04 14:28:20 +01:00
|
|
|
-DBUILTIN_TRANSLATIONS:BOOL=ON \
|
|
|
|
-DBUILTIN_TRANSLATIONS_OF_QT:BOOL=OFF \
|
2019-02-19 18:38:43 +01:00
|
|
|
$additional_args \
|
|
|
|
.
|
2020-10-04 01:04:01 +02:00
|
|
|
ninja
|
2016-09-11 23:37:58 +02:00
|
|
|
}
|
|
|
|
|
2017-03-09 23:21:29 +01:00
|
|
|
check() {
|
|
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}"
|
2020-10-04 01:04:01 +02:00
|
|
|
SYNCTHING_PORT=$(ephemeral_port) SYNCTHING_TEST_TIMEOUT_FACTOR=3 ninja check
|
2017-03-09 23:21:29 +01:00
|
|
|
}
|
|
|
|
|
2016-09-11 23:37:58 +02:00
|
|
|
package() {
|
|
|
|
cd "$srcdir/${PROJECT_DIR_NAME:-$_reponame-$pkgver}"
|
2020-10-04 01:04:01 +02:00
|
|
|
DESTDIR="${pkgdir}" ninja install
|
2016-09-11 23:37:58 +02:00
|
|
|
}
|