summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3884c38b7048f0367d8f41647b29d863273f2440 (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
# Maintainer: Danijel Zlaus <danijel.zlaus@gmail.com>

pkgname='meshmixer-wine'
pkgver=3.5
_pkgver=$(echo $pkgver | sed 's/\./p/g')
pkgrel=4
pkgdesc="Meshmixer is state-of-the-art software for working with triangle meshes"
arch=('x86_64')
url="http://www.meshmixer.com"
license=('proprietary')
provides=($pkgname)
depends=(wine winetricks)
makedepends=(p7zip imagemagick icoutils)
source=(meshmixer
	meshmixer.desktop
	${url}/downloads/Autodesk_Meshmixer_v${_pkgver}_Win64.exe)
sha256sums=('07bb0d678fc153c60f51a30176ca557d4533f6163b29a320855eeaf8afc45e93'
            '6bd305f5b9d05d33c15bedbdd9192a9856ee32b49bc39d0d62e4ffa71a79fdce'  
            '5d08cb6254e4d4280137d6d37ec689fc3f0c61dad08bbc978a451ac16b7f271c')
noextract=('Autodesk_Meshmixer_v${_pkgver}_Win64.exe')
options=(!strip)

prepare() {
	7z x -aoa -o$pkgname Autodesk_Meshmixer_v${_pkgver}_Win64.exe > /dev/null
	wrestool -x -t 14 Autodesk_Meshmixer_v3p5_Win64.exe > icons.ico
}

package() {
    mkdir -p "${pkgdir}/opt/${pkgname}"
    mkdir -p "${pkgdir}/usr/bin"
    mkdir -p "${pkgdir}/usr/share/applications"
    mkdir -p "${pkgdir}/usr/share/icons/hicolor"

    cp -R $pkgname ${pkgdir}/opt

    find ${pkgdir}/opt/${pkgname} -type d -exec chmod 755 "{}" \;
    find ${pkgdir}/opt/${pkgname} -type f -exec chmod 644 "{}" \;

    install -m755 meshmixer $pkgdir/usr/bin/meshmixer
    install -m644 meshmixer.desktop $pkgdir/usr/share/applications
    #Extract icons
    IFS=$'\n'
    local cnt=0
    for i in $(identify icons.ico); do 
     dim=$(echo $i | gawk 'match($0, /([0-9]+)x[0-9]+/ , a) {print a[1]}')
     ico_dir=${pkgdir}/usr/share/icons/hicolor/${dim}x${dim}/apps
     mkdir -p "${ico_dir}"
     convert icons.ico[$cnt] -thumbnail ${dix}x${dim} -flatten ${ico_dir}/meshmixer.png
     cnt=$((cnt+1))
    done
}