summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 76d5e2bc7694134f81edc6c1d45916a2cc797c1c (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
# Maintainer: Herbert Rusznak <herbert.rusznak@gmail.com>
# Contributor: Tyler Anderson <unlimitedbacon@gmail.com>

pkgname=stl-thumb-git
pkgver=212.73a456a
pkgrel=1
license=('MIT')
pkgdesc="A fast lightweight thumbnail generator for STL files"
url='https://github.com/rowanfr/stl-thumb.git'
source=("${pkgname}::git+https://github.com/rowanfr/stl-thumb.git#branch=master")
depends=('libgl')
makedepends=("rust" "git")
provides=("stl-thumb")
conflicts=("stl-thumb")
arch=("i386" "x86_64")
sha256sums=('SKIP')

pkgver() {
    cd "$srcdir/$pkgname"
    echo "$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}

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

    git checkout master
    git pull origin master
	# Remove cargo config
	# This file has gcc paths specifically for building on Debian/ARM
	# Removing it allows this package to build on Arch Linux Arm
	rm .cargo/config

	cargo build --release
}

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

	install -Dm755 target/release/stl-thumb       "${pkgdir}/usr/bin/stl-thumb"
	install -Dm755 target/release/libstl_thumb.so "${pkgdir}/usr/lib/libstl_thumb.so"
	install -Dm644 target/release/libstl_thumb.a  "${pkgdir}/usr/lib/libstl_thumb.a"
	install -Dm644 stl-thumb.thumbnailer          "${pkgdir}/usr/share/thumbnailers/stl-thumb.thumbnailer"
	install -Dm644 libstl_thumb.h                 "${pkgdir}/usr/include/libstl_thumb.h"
}