summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d11a5f165a8408e660f01ab3f18c1cca683b2a91 (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
# Maintainer: Yunhui Fu <yhfudev@gmail.com>
# Contributor: Adam Goldsmith <contact@adamgoldsmith.name>
pkgname=libarcus
pkgver=15.06.03
pkgrel=1
pkgdesc="A library designed to facilitate the communication between Cura and its backend and similar code."
arch=('i686' 'x86_64' 'arm')
url="https://github.com/Ultimaker/libArcus"
license=('GPL2')
provides=('libarcus')
conflicts=('libarcus-git')
depends=('protobuf3')
makedepends=('git' 'cmake')

source=(
    #"${pkgname}::git+https://github.com/Ultimaker/libArcus.git#commit=${pkgver}"
    "${pkgname}-${pkgver}.tar.gz::https://github.com/Ultimaker/libArcus/archive/${pkgver}.tar.gz"
    )
md5sums=(
    'c61fafaa82f71cef5e0f6780688f853e'
    )

pkgver_git() {
    cd "${srcdir}/${pkgname}"
    local ver="$(git show | grep commit | awk '{print $2}' )"
    #printf "r%s" "${ver//[[:alpha:]]}"
    echo ${ver:0:7}
}

pkgver_svn() {
    cd "${srcdir}/${pkgname}"
    #printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
    local ver="$(svn info | grep Revision | awk '{print $2}' )"
    #printf "r%s" "${ver//[[:alpha:]]}"
    echo ${ver:0:7}
}

#pkgver() {
#    pkgver_git
#}

build4git() {
    cd "${srcdir}/${pkgname}"
    mkdir -p build
    cd build
    cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF ..
    make
}

build4release() {
    cd "${srcdir}/libArcus-${pkgver}"
    mkdir -p build
    cd build
    cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF ..
    make
}

build() {
    build4release
}

package4git() {
    cd "${srcdir}/${pkgname}/build"
    make DESTDIR="$pkgdir/" install

    mv "$pkgdir/usr/local/lib64/" "$pkgdir/usr/lib/"
}

package4release() {
    cd "${srcdir}/libArcus-${pkgver}/build"
    make DESTDIR="$pkgdir/" install

    mv "$pkgdir/usr/local/lib64/" "$pkgdir/usr/lib/"
}

package() {
    package4release
}

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