summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0379534b656baeaabdda4f7bf33d7b17c8b9630b (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
# Maintainer: Shayne Hartford <shayneehartford@gmail.com>

_pkgname=smuview
pkgname=${_pkgname}-git
pkgver=0.0.4.r350.ga5ffb66
pkgrel=2
pkgdesc="SmuView is a Qt-based source measurement unit GUI for sigrok."
arch=($CARCH)
url="https://github.com/knarfS/$_pkgname"
license=('GPL-3.0-or-later')
depends=(
    gcc-libs
    glib2
    glibc
    glibmm
    hicolor-icon-theme
    libsigrok-git
    #     libsigrok
    qt5-base
    qwt
    python
    python-time-machine
    #     python-pdoc
)
makedepends=(
    asciidoctor
    asciidoctor-pdf
    git
    boost
    cmake
    ninja
    qt5-svg
    qt5-tools
    pkgconf
    pybind11
)
provides=($_pkgname)
conflicts=($_pkgname)
source=("git+$url.git")
md5sums=('SKIP')

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

prepare() {
    git -C "${srcdir}/${_pkgname}" clean -dfx
}

build() {
    cd "$srcdir/$_pkgname"

    # Workaround - libsigrok-git
    #     sed -i 's/option(DISABLE_WERROR "Build without -Werror" FALSE)/option(DISABLE_WERROR "Build without -Werror" TRUE)/' CMakeLists.txt

    # see:https://wiki.archlinux.org/title/CMake_package_guidelines

    cmake -DCMAKE_BUILD_TYPE=None \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DDISABLE_WERROR=FALSE \
        -DENABLE_TESTS=TRUE \
        -B build \
        -G Ninja \
        -Wno-dev
    ninja -C build

    cd manual
    cmake -DCMAKE_BUILD_TYPE=None \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -Wno-dev
    make manual
    make manual-publish

}

package() {
    DESTDIR="${pkgdir}" ninja -C "${srcdir}"/${_pkgname}/build install
    DESTDIR="${pkgdir}" cmake --install "${srcdir}"/${_pkgname}/manual
    #     install -Dm755 "$srcdir/$_pkgname/build/smuview" "$pkgdir/usr/bin/$_pkgname"
    #     install -Dm644 "$srcdir/$_pkgname/contrib/org.sigrok.SmuView.desktop" "$pkgdir/usr/share/applications/$_pkgname.desktop"
    #     install -Dm644 "$srcdir/$_pkgname/icons/smuview.svg" "$pkgdir/usr/share/icons/hicolor/scalable/apps/$_pkgname.svg"
}