summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 58a567cfaf010884c5fc7e2fa8511517991cc5ff (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
# Maintainer: Rodrigo Bezerra <rodrigobezerra21 at gmail dot com>
# Contributor: orumin <dev at orum.in>

_basename=libgphoto2
pkgname=lib32-libgphoto2
pkgver=2.5.31
pkgrel=2
pkgdesc="Digital camera access library (32-bit)"
url="http://www.gphoto.org/"
arch=(x86_64)
license=(LGPL)
depends=(curl lib32-libexif lib32-libltdl lib32-libusb lib32-libxml2 libgphoto2)
makedepends=(autoconf-archive git)
_commit=ba28af2d22fd4cb7fa76a8ff569ba498e8021db5  # tags/libgphoto2-2_5_31-release
source=("git+https://github.com/gphoto/libgphoto2#commit=$_commit")
sha256sums=('SKIP')
validpgpkeys=('7C4AFD61D8AAE7570796A5172209D6902F969C95') # Marcus Meissner

pkgver() {
    cd $_basename

    git describe --tags | sed 's/^libgphoto2-//;s/-release//;s/^v//;s/_/./g;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
    cd $_basename

    autoreconf -fvi
}

build() {
    export CC='gcc -m32'
    export CXX='g++ -m32'
    export PKG_CONFIG_PATH='/usr/lib32/pkgconfig'

    local configure_options=(
        --build=i686-pc-linux-gnu
        --prefix=/usr
        --libdir=/usr/lib32
        --sysconfdir=/etc
        --localstatedir=/var
        --disable-rpath
        --with-gdlib=no
    )

    cd $_basename

    ./configure "${configure_options[@]}"

    sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool

    make
}

package() {
    cd $_basename

    make DESTDIR="$pkgdir" install

    rm -r "$pkgdir"/usr/bin
    rm -r "$pkgdir"/usr/include
    rm -r "$pkgdir"/usr/share

    # Remove unused udev helper
    rm -rv "$pkgdir/usr/lib32/udev"
}