summaryrefslogtreecommitdiff
path: root/pcr/pencil2d/PKGBUILD
blob: 944792e9169f080fadeaf2cba2f1b0db7cfd7f64 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Maintainer: Márcio Silva <coadde@parabola.nu>

pkgname=pencil2d
pkgver=0.5.4.git20140720
pkgcommit=52528802ed2b33f60ae6d4370e6fe09f66ccb45c # July 20, 2014
pkgrel=1
pkgdesc='Pencil is an animation/drawing software'
arch=(
  x86_64
  i686
)
url=http://http://www.pencil2d.org/
license=GPL2
depends=(
  desktop-file-utils
  ming
  qt5-multimedia
  qt5-svg
  shared-mime-info
  xdg-utils
)
makedepends=(
  git
  qt5-tools
)
install=$pkgname.install
options=(!libtool)
source=(
  $pkgname-$pkgver::git+https://github.com/pencil2d/pencil#commit=$pkgcommit
  ${pkgname%2d}.{desktop,png,xml}
)
sha512sums=(
  SKIP
  bd291f9f484077260751220de4723f1f005f97f4340904283ba7ecda52888dd2562e5d6424e3063b1e72b5ffd0af4c658b09742473106262910f1f50aec0dfff
  2158141d405290ef018d5fa19e35c9b909c8e85b0f2d41e74a652eab35749727fa9b15993b594fff78659954d30a7df71323a563ea10ac17c17d3ce86a15f687
  654a2adc27c015414d122b11f70c9381097abc9f972a914c01f8fefa18c3f8ab7e97aa4b573115d9c8ff70115af21c5e6f3daa535a84a7a1044c56daa97444f8
)
no3rdlib=no # !!! unstable build !!!
[ $no3rdlib == yes ] && depends+=(quazip) # build with qt4 (zlib included)
nostaticlib=no # !!! crash in test and app compilation !!!
               # $srcdir/$pkgname-$pkgver/{app,tests}/../core_lib//libcore_lib.so: undefined reference to `vtable for LayerImage'

prepare() {
  cd $srcdir/$pkgname-$pkgver

  if [ $no3rdlib == yes ]; then
    # remove unused 3rdlib (quazip and zlib) source
    rm -vr 3rdlib
    sed -i '\|^quazip|d
            \|^zlib|d
            \|^SUBDIRS| s| quazip zlib||
            \|core_lib.depends|d
           ' pencil.pro
    sed -i '\|DEPENDPATH| s|$$PWD/../3rdlib/quazip|/usr/lib|
            \|DEPENDPATH| s|$$PWD/../3rdlib/zlib|/usr/lib|
            \|INCLUDEPATH| s|$$PWD/../3rdlib/quazip|/usr/include/quazip|
            \|INCLUDEPATH| s|$$PWD/../3rdlib/zlib|/usr/include|
            \|LIBS| s|$$OUT_PWD/../3rdlib/quazip/|/usr/lib|
            \|LIBS| s|$$OUT_PWD/../3rdlib/zlib/ -lzlib|/usr/lib|
            \|PRE_TARGETDEPS| s|$$OUT_PWD/../3rdlib/quazip/libquazip.a|/usr/lib/libquazip.so|
            \|PRE_TARGETDEPS| s|$$OUT_PWD/../3rdlib/zlib/libzlib.a|/usr/lib/libz.so|
           ' app/app.pro core_lib/core_lib.pro tests/tests.pro
  fi

  if [ $nostaticlib == yes ]; then
    # remove staticlib configuration
    sed -i '\|^CONFIG| s| staticlib||
            s|libcore_lib.a|libcore_lib.so|
           ' core_lib/core_lib.pro
  fi
}

build() {
  cd $srcdir/$pkgname-$pkgver
  export QTDIR=/usr
  qmake-qt5 PREFIX=$pkgdir/usr && make
}

package() {
  cd $srcdir/$pkgname-$pkgver
  make DESTDIR=$pkgdir install

  # package executable files that's not added in Makefile
  install -vd $pkgdir/usr/bin
  install -vD $srcdir/$pkgname-$pkgver/app/Pencil2D	$pkgdir/usr/bin/pencil2d
  install -vD $srcdir/$pkgname-$pkgver/tests/tests	$pkgdir/usr/bin/pencil2d-tests

  # remove 3rdlib conflicting headers
  [ $no3rdlib == no ] && rm -vr $pkgdir/usr/include

  if [ $nostaticlib == yes ]; then
    # package library files that's not added in Makefile
    install -vd $pkgdir/usr/lib
    install -vD $srcdir/$pkgname-$pkgver/core_lib/libcore_lib.so	$pkgdir/usr/lib
    install -vD $srcdir/$pkgname-$pkgver/core_lib/libcore_lib.so.1	$pkgdir/usr/lib
    install -vD $srcdir/$pkgname-$pkgver/core_lib/libcore_lib.so.1.0	$pkgdir/usr/lib
    install -vD $srcdir/$pkgname-$pkgver/core_lib/libcore_lib.so.1.0.0	$pkgdir/usr/lib
  else
    # remove unused lib files
    rm -vr $pkgdir/usr/lib
  fi

  install -vdp $pkgdir/usr/share/{applications,mime/packages,pixmaps}
  install -vD $srcdir/${pkgname%2d}.desktop	$pkgdir/usr/share/applications
  install -vD $srcdir/${pkgname%2d}.png		$pkgdir/usr/share/mime/packages
  install -vD $srcdir/${pkgname%2d}.xml		$pkgdir/usr/share/pixmaps
}