summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: de4b0a3ae840e023609707a6d186137a23421813 (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
# Maintainer: Fabio 'Lolix' Loli <fabio.loli@disroot.org> -> https://github.com/FabioLolix
# Co-maintainer: Alex Potapenko <opotapenko@gmail.com>

pkgname=libusb0
_pkgname=libusb
pkgver=0.1.12
pkgrel=8
pkgdesc="Library to enable user space application programs to communicate with USB devices. 0.x branch. With Debian's patches."
arch=('i686' 'x86_64')
url="https://libusb.info/"
license=('LGPL')
provides=('libusb-compat')
conflicts=('libusb-compat')
_debianver_="35"
_debianver="${pkgver}-${_debianver_}"
depends=('glibc' 'sh')
source=("http://deb.debian.org/debian/pool/main/libu/libusb/libusb_${pkgver}.orig.tar.gz"
        "http://deb.debian.org/debian/pool/main/libu/libusb/libusb_${_debianver}.debian.tar.xz")
sha256sums=('37f6f7d9de74196eb5fc0bbe0aea9b5c939de7f500acba3af6fd643f3b538b44'
            '82636fa4e49fe8a886f5dbab4756e6c6855f1cb5173fa567848e3de9f47bf2bd')

prepare() {
    cd "${_pkgname}-${pkgver}"

     local patches=(
            00_packed.diff
            01_ansi.diff
            02_usbpp.diff
            03_const_buffers.diff
            04_infinite_loop.diff
            05_emdebian_libs.diff
            06_bsd.diff
            07_altsetting_alloc.diff
            08_bus_location.diff
            09_dummy.diff
            10_hurd.diff
            11_transfer_timeout.diff
            12_ENAMETOOLONG.diff
            91_ac_prog_cxx.diff

    )

    for i in "${patches[@]}"; do
        msg "Applying ${i} ..."
        patch -p1 -i "../debian/patches/${i}"
    done

    autoreconf -vif
}

build() {
    cd "${_pkgname}-${pkgver}"
    ./configure \
        --prefix=/usr
    make
}

package() {
    cd "${_pkgname}-${pkgver}"
    make DESTDIR="$pkgdir" install
    rm -f "$pkgdir"/usr/lib/libusbpp.a "$pkgdir"/usr/lib/libusbpp.so "$pkgdir"/usr/lib/libusbpp-0.1.so.* "$pkgdir"/usr/include/usbpp.h
}