PKGBUILDs/syncthingtray/git/PKGBUILD

99 lines
3.8 KiB
Bash
Raw Normal View History

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=${SYNCTHING_TRAY_WEBVIEW_PROVIDER:-webengine}
2016-09-11 23:37:58 +02:00
# set the JavaScript provider: either script, qml, auto or none
2018-11-01 05:16:53 +01:00
_js_provider=${SYNCTHING_TRAY_JS_PROVIDER:-qml}
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
2018-11-01 05:16:53 +01:00
_enable_kio_plugin=${SYNCTHING_TRAY_ENABLE_KIO_PLUGIN:-1}
2017-03-21 01:02:22 +01: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-08-31 16:17:23 +02:00
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}
pkgver=1117.1d239cc
pkgrel=2
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')
depends=('qtutilities-git' 'qtforkawesome-git' 'boost-libs' 'qt5-svg' 'openssl' 'desktop-file-utils' 'xdg-utils')
[[ $_webview_provider == none ]] && [[ $_js_provider == none ]] && depends+=('qt5-base')
2016-09-11 23:37:58 +02:00
[[ $_webview_provider == webkit ]] && depends+=('qt5-webkit')
[[ $_webview_provider == webengine ]] && depends+=('qt5-webengine')
[[ $_js_provider == script ]] && depends+=('qt5-script')
[[ $_js_provider == qml ]] && depends+=('qt5-declarative')
2017-03-21 01:02:22 +01:00
[[ $_enable_kio_plugin ]] && optdepends+=('kio: KIO plugin for Syncthing actions in Dolphin')
[[ $_enable_plasmoid ]] && optdepends+=('plasma-workspace: Plasmoid for Plasma 5 desktop')
makedepends=('cmake' 'ninja' 'qt5-tools' 'git' 'mesa' 'boost')
checkdepends=('cppunit' 'syncthing' 'iproute2')
[[ $_enable_kio_plugin ]] && makedepends+=('kio')
2017-08-31 16:17:23 +02:00
[[ $_enable_plasmoid ]] && makedepends+=('plasma-framework' 'extra-cmake-modules')
#provides=("${_name}")
2016-09-11 23:37:58 +02:00
conflicts=("${_name}")
url="https://github.com/Martchus/${_reponame}"
source=("${_reponame}::${MARTCHUS_GIT_URL_PREFIX:-git+https://github.com/Martchus}/${_reponame}.git")
2016-09-11 23:37:58 +02:00
sha256sums=('SKIP')
ephemeral_port() {
comm -23 <(seq 49152 65535) <(ss -tan | awk '{print $4}' | cut -d':' -f2 | grep "[0-9]\{1,5\}" | sort | uniq) | shuf | head -n 1
}
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'
[[ $_enable_plasmoid ]] || additional_args+=' -DNO_PLASMOID=ON'
2016-09-11 23:37:58 +02:00
cmake \
2020-10-07 22:22:10 +02:00
-G Ninja \
-DCMAKE_BUILD_TYPE:STRING='Release' \
-DCMAKE_INSTALL_PREFIX:PATH='/usr' \
-DCONFIGURATION_NAME:STRING='git' \
-DCONFIGURATION_PACKAGE_SUFFIX:STRING='-git' \
-DQT_FORK_AWESOME_CONFIGURATION_TARGET_SUFFIX:STRING='git' \
2020-01-28 21:06:00 +01:00
-DLIB_SYNCTHING_CONNECTOR_CONFIGURATION_TARGET_SUFFIX:STRING='git' \
-DSYNCTHINGFILEITEMACTION_CONFIGURATION_TARGET_SUFFIX:STRING='git' \
-DLIB_SYNCTHING_MODEL_CONFIGURATION_TARGET_SUFFIX:STRING='git' \
-DSYNCTHINGPLASMOID_CONFIGURATION_TARGET_SUFFIX:STRING='git' \
-DSYNCTHINGWIDGETS_CONFIGURATION_TARGET_SUFFIX:STRING='git' \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DWEBVIEW_PROVIDER="${_webview_provider}" \
-DJS_PROVIDER="${_js_provider}" \
2017-03-21 01:02:22 +01:00
-DSYSTEMD_SUPPORT=ON \
-DBUILTIN_TRANSLATIONS:BOOL=ON \
-DBUILTIN_TRANSLATIONS_OF_QT:BOOL=OFF \
$additional_args \
.
2020-10-07 22:22:10 +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}"
QT_QPA_PLATFORM=offscreen 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}"
DESTDIR="${pkgdir}" ninja install
2016-09-11 23:37:58 +02:00
}