aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ee2081dd183d94173caead4931b9d599fa353ce8 (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
# Maintainer: ctrl-q <34975747+ctrl-q@users.noreply.github.com>
pkgname=notification-tray-git
pkgver=r81.a291c2a
pkgrel=1
pkgdesc="FreeDesktop-compliant notification daemon with grouping, DnD, batching, and persistence"
arch=('x86_64')
url="https://github.com/ctrl-q/notification-tray"
license=('custom')
depends=('qt5-base' 'qt5-multimedia' 'qt5-declarative' 'dbus' 'glib2')
makedepends=('cmake' 'gcc' 'make' 'git')
optdepends=('gtest: for running tests'
            'lxqt-config: for LXQt theming configuration'
            'hicolor-icon-theme: fallback icon theme'
            'lxqt-notificationd: for additional notification themes'
            'systemd: for running as a user service')
install=notification-tray.install
source=("${pkgname%-git}::git+https://github.com/ctrl-q/notification-tray.git")
sha256sums=('SKIP')
provides=('notification-tray')
conflicts=('notification-tray')

pkgver() {
    cd "$srcdir/${pkgname%-git}" || exit
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
    cd "${pkgname%-git}" || exit
    mkdir -p build
    cd build || exit
    cmake .. \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DENABLE_TESTING=OFF
    make
}

check() {
    cd "${pkgname%-git}/build" || exit
    # Only run tests if gtest is available
    if command -v gtest-config &> /dev/null; then
        make test || warning "Tests failed"
    fi
}

package() {
    cd "${pkgname%-git}/build" || exit
    make DESTDIR="$pkgdir" install
    
    # Install license if it exists
    if [ -f "$srcdir/${pkgname%-git}/LICENSE" ]; then
        install -Dm644 "$srcdir/${pkgname%-git}/LICENSE" "$pkgdir/usr/share/licenses/${pkgname%-git}/LICENSE"
    fi
    
    # Install README
    install -Dm644 "$srcdir/${pkgname%-git}/README.md" "$pkgdir/usr/share/doc/${pkgname%-git}/README.md"
}