summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7704ca8ffe59e9765a08b0411f649b52f33bcd6a (plain)
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
# Maintainer: rilian-la-te <ria.freelander@gmail.com>

_disable_mate=0
_disable_xfce=0
_disable_vala=0
_disable_budgie=0

pkgname=(
'genmon-plugin-common-git'
)

_opts=(
	--prefix=/usr
	--libdir=lib
	--libexecdir=lib
	-Dauto_features=disabled
)

makedepends=('meson' 'vala' 'gtk3')

if (("${_disable_mate}" == 0));then
	_opts+=(-Dmate=enabled)
	pkgname+=('mate-panel-genmon-git')
	makedepends+=('mate-panel')
#	msg "Mate applet enabled"
fi

if (("${_disable_xfce}" == 0));then
	_opts+=(-Dxfce=enabled)
	pkgname+=('xfce4-panel-genmon-ng-git')
	makedepends+=('xfce4-panel>=4.11.2')
#	msg "Xfce applet enabled"
fi

if (("${_disable_vala}" == 0));then
	_opts+=(-Dvalapanel=enabled)
	pkgname+=('vala-panel-genmon-git')
	makedepends+=('vala-panel>=0.4.60')
#	msg "Vala Panel applet enabled"
fi

if (("${_disable_budgie}" == 0));then
	_opts+=(-Dbudgie=enabled)
	pkgname+=('budgie-genmon-git')
	makedepends+=('budgie-desktop' 'gobject-introspection' 'libpeas')
#	msg "Budgie applet enabled"
fi


#msg "If you want to disable an applet, edit pkgbuild variables _disable_[applet]"

pkgbase=generic-monitor-plugin-git
_pkgbase=xfce4-genmon-plugin
pkgver=5.1.0.r41.gd8f2540
pkgrel=1
pkgdesc="Cyclically spawns a script/program, captures its output and displays the resulting string in the panel"
url="https://gitlab.com/vala-panel-project/xfce4-genmon-plugin"
arch=('i686' 'x86_64')
license=('LGPL')
source=("git+https://gitlab.com/vala-panel-project/${_pkgbase}.git")
sha256sums=('SKIP')

pkgver() {
  cd "${srcdir}/${_pkgbase}"
  ( set -o pipefail
    git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

build() {
  meson "${_opts[@]}" build "${srcdir}/${_pkgbase}"
  meson compile -C build
}

package_xfce4-panel-genmon-ng-git(){
	pkgdesc="Cyclically spawns a script/program, captures its output and displays the resulting string in the panel"
	depends=('gtk3' 'xfce4-panel>=4.11.2' 'genmon-plugin-common-git')
	DESTDIR="${pkgdir}" meson install -C build
	rm -rf ${pkgdir}/usr/share/{genmon,vala-panel,glib-2.0,locale,mate-panel,vala-panel-appmenu,doc,licenses}
	rm -rf ${pkgdir}/usr/lib/{mate-panel,vala-panel,budgie-desktop}
}

package_mate-panel-genmon-git(){
	pkgdesc="Cyclically spawns a script/program, captures its output and displays the resulting string in the panel"
	depends=('gtk3' 'mate-panel' 'genmon-plugin-common-git')
	DESTDIR="${pkgdir}" meson install -C build
	rm -rf ${pkgdir}/usr/share/{genmon,vala-panel,glib-2.0,locale,xfce4,vala-panel-appmenu,doc,licenses}
	rm -rf ${pkgdir}/usr/lib/{xfce4,vala-panel,budgie-desktop}
}

package_vala-panel-genmon-git(){
	pkgdesc="Cyclically spawns a script/program, captures its output and displays the resulting string in the panel"
	depends=('gtk3' 'vala-panel>=0.4.60' 'genmon-plugin-common-git')
	DESTDIR="${pkgdir}" meson install -C build
	rm -rf ${pkgdir}/usr/share/{genmon,xfce4,glib-2.0,locale,mate-panel,vala-panel-appmenu,doc,licenses}
	rm -rf ${pkgdir}/usr/lib/{mate-panel,xfce4,budgie-desktop}
}

package_budgie-genmon-git(){
	pkgdesc="Cyclically spawns a script/program, captures its output and displays the resulting string in the panel"
	depends=('budgie-desktop' 'gtk3' 'libpeas' 'genmon-plugin-common-git')
  	cd "${srcdir}/${_pkgbase}"
	DESTDIR="${pkgdir}" meson install -C build
	rm -rf "${pkgdir}/usr/share/"
	rm -rf ${pkgdir}/usr/lib/{mate-panel,vala-panel,xfce4}
}

package_genmon-plugin-common-git(){
	pkgdesc="Translations and script examples for GenMon"
	depends=('bash' 'perl')	
	optdepends=('xfce4-panel-genmon-git' 'mate-panel-genmon-git' 'vala-panel-genmon-git' 'budgie-genmon-git')
	arch=('any')
	DESTDIR="${pkgdir}" meson install -C build
	rm -rf ${pkgdir}/usr/share/{vala-panel,xfce4,mate-panel}
	rm -rf ${pkgdir}/usr/lib
}