# Contributor (Arch): Ninez <triplesquarednine AT gmail DOT com>
# Contributor (Arch): N30N <archlinux@alunamation.com>
# Contributor (Arch): sekret (AUR)
# Maintainer (Arch): SanskritFritz (gmail)
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

pkgname="tupi"
pkgver=0.2.9
pkgrel=1
pkgdesc="A design and authoring tool for digital artists interested in 2D animation."
url="http://www.maefloresta.com/tupi"
license=("GPL3")
arch=("i686" "x86_64")
depends=("qt5-multimedia" "qt5-svg" "quazip" "ffmpeg" "shared-mime-info")
makedepends=("ruby" "zlib" "libgl")
source=("http://sourceforge.net/projects/tupi2d/files/Source%20Code/tupi-$pkgver.tar.gz" 
        "quazip5.patch")
sha256sums=('c4e93fe29ab277d1d0800e6f0bef0beb69c00087e58a943d863da3b099f9e30a'
            '263e93c6cc54c6a5e19fa0b05d3f51b75e23a8f6259fe0159174152090a9efcb')

prepare() {
	cd tupi-$pkgver
	patch -p1 -i ../quazip5.patch
}

build() {
	cd tupi-$pkgver
	./configure \
		--libdir="/usr/lib" \
		--sharedir="/usr/share/tupi" \
		--without-debug
	make
}

package() {
	cd tupi-$pkgver
	make DESTDIR="$pkgdir" install

	sed "s|$pkgdir||" -i "$pkgdir/usr/bin/tupi"
	mkdir -p "$pkgdir/etc/ld.so.conf.d"
	echo "/usr/lib/tupi" > "$pkgdir/etc/ld.so.conf.d/tupi.conf"
}
