summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ee9f968bc4fa35cec67d82b2c1d6411c5657edc0 (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
# Maintainer: Evgeny Shvits <tony.darko@gmail.com>

pkgname=ch341eepromtool
pkgver=0.5
pkgrel=3
_git_commit="6b41e07"
pkgdesc="An i2c serial EEPROM programming tool for the WCH CH341A"
arch=('i686' 'x86_64')
url="https://github.com/stefanct/ch341eepromtool"
license=('GPL3')
depends=('libusb>=1')
source=("git+https://github.com/stefanct/ch341eepromtool.git#commit=${_git_commit}"
        "libusb_set_option.patch"
        "extern_readbuf.patch")
md5sums=('SKIP'
         '9c2db0e0c9e72be4d9d8e6544e75c34b'
         '5409cb99d67bbe4decab130e4c688c74')

prepare() {
  cd "${srcdir}/${pkgname}"
  patch -p1 --input="${srcdir}/libusb_set_option.patch"
  patch -p1 --input="${srcdir}/extern_readbuf.patch"
}

build() {
  cd "${srcdir}/${pkgname}"
  gcc ${CFLAGS} -o ch341eeprom ch341eeprom.c ch341funcs.c ${LDFLAGS} -lusb-1.0
}

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

  # Install the program
  install -Dm755 ch341eeprom "${pkgdir}/usr/bin/ch341eeprom"
  install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
}

# vim:set ft=sh ts=2 sw=2 et: