summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 59bc3ce18547565e30db1b6a8068944ce9f015eb (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
# Maintainer: Presence <dan465 at mail dot com>

pkgname=pyobd
pkgver=1.19
pkgrel=1
pkgdesc="An OBD-II compliant car diagnostic tool"
arch=('x86_64')
url="https://github.com/barracuda-fsh/pyobd"
license=('GPL-2.0-only')
makedepends=('pyinstaller' 'pyside6-tools' 'icoutils' 
	'python-wxpython' 'python-pyserial' 'python-numpy'
	'python-tornado' 'python-pint' 'pyside6' 'icoutils'
	'gendesk')
depends=('glibc' 'hicolor-icon-theme' 'zlib')
source=(https://github.com/barracuda-fsh/pyobd/archive/refs/tags/v${pkgver}.tar.gz)
sha256sums=('94ce6f7574cff7ed3a8412002c06a6bea2251fed0bb1f890db33ad080154d10f')

build() {
    cd "$srcdir/${pkgname}-${pkgver}"
    pyinstaller --onefile -w -i pyobd.ico --add-data "pyobd.ico:." pyobd.py
    gendesk -f --pkgname=$pkgname \
    --pkgdesc="$pkgdesc" \
    --name=$pkgname \
    --exec=$pkgname \
    --icon=$pkgname \
    --terminal=false \
    --categories=Development,Utilities

    mkdir -p "$srcdir/icons"
    icotool -x pyobd.ico -o "$srcdir/icons"
}

package() {
    cd "$srcdir/${pkgname}-${pkgver}"

    install -Dm755 "dist/$pkgname" "$pkgdir/usr/bin/$pkgname"
    install -Dm644 "$srcdir/${pkgname}-${pkgver}/$pkgname.desktop" "$pkgdir/usr/share/applications/$pkgname.desktop"
    cd "$srcdir/icons"
    export num=1
    for size in {16,24,32,48,64,72,96,128,256};
    do
    	install -Dm644 ${pkgname}_${num}_${size}x${size}x32.png "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/$pkgname.png"
    	export num=$(($num+1))
    done
}