summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 862b3290c9a643318264db4679adfbb032e88f4a (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
# Contributor: Swift Geek <swiftgeek «at» gmail.com>
pkgname=perl-wx-glcanvas
pkgver=0.09
pkgrel=1
pkgdesc="Wx::GLCanvas - interface to wxWidgets' OpenGL canvas"
arch=('any')
url="https://metacpan.org/release/Wx-GLCanvas/"
license=('GPL' 'PerlArtistic')
depends=('perl>=5.10.0' 'perl-wx')
makedepends=('perl-alien-wxwidgets')
[ -z "$DISPLAY" ] && makedepends+=('xorg-server-xvfb')
provides=()
conflicts=()
replaces=()
backup=()
options=(!emptydirs)
install=
source=("http://search.cpan.org/CPAN/authors/id/M/MB/MBARBON/Wx-GLCanvas-${pkgver}.tar.gz")
md5sums=('4f6475010bd6e4231e2dbb3fb52bc642')
_src_dir='$srcdir/Wx-GLCanvas-$pkgver'

build() {
  # Setting these env variables overwrites any command-line-options we don't want...
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null
  #TODO: how to reload PATH?
  if [[ "$PATH" != *"vendor_perl"* ]]; then
    warning "Fresh installation of perl detected, please relogin/reboot"
    source /etc/profile.d/perlbin.sh
  fi
  eval cd "$_src_dir"
  /usr/bin/perl Makefile.PL || true
  make
}

check () {
  eval cd "$_src_dir"
  warning "If tests do fail - uninstall this package before compiling"
  if [ -z "$DISPLAY" ]; then
    warning "Empty \$DISPLAY - falling back to xvfb-run (xorg-server-xvfb)"
    xvfb-run -a -s "+extension GLX -screen 0 1280x1024x24" prove -Iblib/arch -Iblib/lib/ t/
  else
    prove -Iblib/arch -Iblib/lib/ t/
  fi
}

package () {
  eval cd "$_src_dir"
  pwd
  make install

  # remove perllocal.pod and .packlist
  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}