summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 500db4279c38af586bad4ad2b0efaa0ee8798f6f (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
# Maintainer: Glucy2 <glucy-2@outlook.com>
pkgname=sast-evento

pkgver=2.0.74
pkgrel=1
pkgdesc='An event management system developed and used by NJUPT SAST'
license=("${srcdir}/sast-evento/LICENSE")
url="https://github.com/NJUPT-SAST/sast-evento"
conflicts=("${pkgname}-git" "${pkgname}-bin")

makedepends=(
    'git'
    'base-devel'
    'cmake'
    'qt5-base'
    'boost'
    'nlohmann-json'
    'spdlog'
    'liburing'
    'libsecret'
    'tomlplusplus'
    'autoconf-archive'
    'libxcb'
    'libxrender'
    'libxi'
    'libxkbcommon'
    'libxkbcommon-x11'
    )
depends=('boost' 'qt6-base' 'slint-cpp-bin')
arch=('x86_64')

prepare() {
    rm -rf "${srcdir}/sast-evento/build" "${srcdir}/build"
    if [[
        -d ${srcdir}/sast-evento

        &&

        $(git -C "${srcdir}/sast-evento" config --get remote.origin.url) \
            = "https://github.com/NJUPT-SAST/sast-evento.git"
        
        &&

        $(git -C "${srcdir}/sast-evento" branch --show-current) = "main"
         ]] ; then
        
        cd "${srcdir}/sast-evento"
        git pull
        git submodule update --init --recursive
    else
        rm -rf "${srcdir}/sast-evento"
        cd "${srcdir}"
        git clone --recursive -b main https://github.com/NJUPT-SAST/sast-evento.git
    fi
}

build() {
    cd "${srcdir}/sast-evento"
    cmake -B build \
        -DSLINT_FEATURE_RENDERER_SKIA=ON \
        -DSLINT_FEATURE_RENDERER_FEMTOVG=OFF \
        -DSlint_DIR=${srcdir}/Slint-cpp-${_slintver}-Linux-x86_64/lib/cmake/Slint
    cmake --build build
    cmake --install ./build --prefix "${srcdir}/build"
}

package() {
    rm "${srcdir}/build/sast-evento-version.txt"
    install -Dm755 -t "${pkgdir}/usr/bin" "${srcdir}/build/bin/"*
    install -Dm644 -t "${pkgdir}/usr/lib" "${srcdir}/build/lib/"*
    install -Dm644 "${srcdir}/build/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    cp -r "${srcdir}/build/include" "${pkgdir}/usr/"
    cp -r "${srcdir}/build/locale" "${pkgdir}/usr/share/locale/"
    mkdir -p "${pkgdir}/usr/share/applications"
    cat > "${pkgdir}/usr/share/applications/${pkgname}.desktop" << EOF
[Desktop Entry]
Name=SAST Evento
Version=$pkgver
Comment=An event management system developed and used by NJUPT SAST
Exec=sast-evento
Icon=sast-evento
Terminal=false
Type=Application
Categories=Education;
Terminal=false
EOF
    chmod -R 644 \
        "${pkgdir}/usr/share/applications/${pkgname}.desktop"
    install -Dm644 "${srcdir}/sast-evento/ui/assets/image/icon/evento.svg" \
        "${pkgdir}/usr/share/icons/hicolor/scalable/apps/sast-evento.svg"
}