summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3c3a78ec705fc2f937b09fef82a9d5442792c4f0 (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
# Maintainer: taotieren <admin@taotieren.com>

pkgbase=logicanalyzer-git
pkgname=({logicanalyzer,clcapture}-git)
pkgver=6.0.0.1.r0.g8d63379
pkgrel=2
epoch=
pkgdesc="24 channel, 100Msps logic analyzer hardware and software "
arch=($CARCH)
url="https://github.com/gusmanb/logicanalyzer"
license=('GPL-3.0-only')
replaces=()
depends=()
makedepends=(git
    dotnet-sdk
    ttf-dejavu)
backup=()
options=(!strip !debug)
install=
source=("${pkgbase}::git+${url}.git")
sha256sums=('SKIP')
noextract=()

pkgver() {
    cd "${srcdir}/${pkgbase}"
    git describe --long --tags | sed 's/^[vV]//g;s/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    #     cd "${srcdir}/${pkgname-git}/Software/LogicAnalyzer"
    #
    #     if [ "$CARCH" == "aarch64" ]; then
    #     msg2 "build for arm64"
    #         dotnet publish  -r linux-arm64 -c Release -o artifact
    #     else
    #     msg2 "build for x64"
    #         dotnet publish  -r linux-x64 -c Release -o artifact
    #     fi

    #first step, prepare the structure
    mkdir -pv "${srcdir}/${pkgbase}/Software/LogicAnalyzer/artifact/LogicAnalyzer/analyzers"
    mkdir -pv "${srcdir}/${pkgbase}/Software/LogicAnalyzer/artifact/CLCapture"

    if [ "$CARCH" == "aarch64" ]; then
        msg2 "build for arm64"

        # compile LogicAnalyzer
        cd "${srcdir}/${pkgbase}/Software/LogicAnalyzer/LogicAnalyzer"
        dotnet publish -r linux-arm64 -c Release --self-contained true -p:DebugType=None -p:DebugSymbols=false -o "${srcdir}/${pkgbase}/Software/LogicAnalyzer/artifact/LogicAnalyzer"

        # compile CLCapture
        cd "${srcdir}/${pkgbase}/Software/LogicAnalyzer/CLCapture"
        dotnet publish -r linux-arm64 -c Release -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true -p:DebugType=None -p:DebugSymbols=false -o "${srcdir}/${pkgbase}/Software/LogicAnalyzer/artifact/CLCapture"
    else
        msg2 "build for x64"
        # compile LogicAnalyzer
        cd "${srcdir}/${pkgbase}/Software/LogicAnalyzer/LogicAnalyzer"
        dotnet publish -r linux-x64 -c Release --self-contained true -p:DebugType=None -p:DebugSymbols=false -o "${srcdir}/${pkgbase}/Software/LogicAnalyzer/artifact/LogicAnalyzer"

        # compile CLCapture
        cd "${srcdir}/${pkgbase}/Software/LogicAnalyzer/CLCapture"
        dotnet publish -r linux-x64 -c Release -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true -p:DebugType=None -p:DebugSymbols=false -o "${srcdir}/${pkgbase}/Software/LogicAnalyzer/artifact/CLCapture"
    fi
}

package_logicanalyzer-git() {
    provides=(${pkgname%-git})
    conflicts=(${pkgname%-git})

    cd "${srcdir}/${pkgbase}/Software/LogicAnalyzer/artifact/"

    #     install -Dm0755 LogicAnalyzer/LogicAnalyzer "${pkgdir}/usr/bin/logicanalyzer"

    install -dm0755 ${pkgdir}/usr/share/${pkgname%-git}

    install -Dm0755 /dev/stdin "${pkgdir}/usr/bin/${pkgname%-git}" <<EOF
export COREHOST_TRACE=1

cd /usr/share/logicanalyzer/
LC_ALL=C ./LogicAnalyzer
EOF

    cp -rv LogicAnalyzer/* ${pkgdir}/usr/share/${pkgname%-git}

    install -Dm644 "$srcdir/logicanalyzer-git/Software/LogicAnalyzer/LogicAnalyzer/Assets/Logo.png" "$pkgdir/usr/share/icons/hicolor/256x256/apps/${pkgname%-git}.png"

    install -Dm0644 /dev/stdin "${pkgdir}/usr/share/applications/${pkgname%-git}.desktop" <<EOF
[Desktop Entry]
Name=${pkgname%-git}
Name[zh_CN]=${pkgname%-git}
Comment=${pkgdesc}
#MimeType=application/x-${pkgname%-git};
Exec=${pkgname%-git}
Type=Application
Categories=Development;Tool;
Terminal=false
Icon=${pkgname%-git}
Version=1
EOF

}

package_clcapture-git() {
    provides=(${pkgname%-git})
    conflicts=(${pkgname%-git})

    cd "${srcdir}/${pkgbase}/Software/LogicAnalyzer/artifact/"

    install -Dm0755 CLCapture/CLCapture "${pkgdir}/usr/bin/clcapture"
}