summaryrefslogtreecommitdiff
path: root/perl-opengl/PKGBUILD
blob: d5090c45804a03445eee6cb7ad973d5ff38df570 (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
# Maintainer: Erich Eckner <arch at eckner dot net>
# Generator : neuesPerlPaket (54bfd7cca693b229aa53ffc98d551b62ea234aaa5be7e6717857610a2da6803b0be2dfe7ddfe9810cf320c477023b3b4356d47df7f8c202ed8c14d71b472c0bc)

pkgname='perl-opengl'
pkgver='0.70'
pkgrel=41
pkgdesc='Perl bindings to the OpenGL API, GLU, and GLUT/FreeGLUT'
arch=('x86_64' 'i686' 'pentium4')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
_pinned_dependencies=(
  'freeglut=3.4.0'
  'glibc>=2.31'
  'glu=9.0.2'
  'libGL.so=1'
  'libx11=1.8.2'
)
depends=(
  'perl>=5.36'
  'perl<5.37'
  "${_pinned_dependencies[@]}"
  'freeglut>=2.8.1'
  'glu>=9.0.0'
  'perl-test-simple'
  'libxmu')
makedepends=(
  'perl-extutils-makemaker'
  'mesa'
)
[ -z "$DISPLAY" ] && makedepends+=('xorg-server-xvfb')
url='https://metacpan.org/release/OpenGL'
_distdir="OpenGL-${pkgver}"
source=("https://cpan.metacpan.org/authors/id/C/CH/CHM/${_distdir}.tar.gz")
sha512sums=('7d418015b2553dd69805252b5957bc97013260617d5a358f692e29b8da884590421c81fbc71d4dd678c93a5c89047d6af8c32f15bf0bd0e4ce514c200e634af5')

prepare() {
  # 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
}

build() {
  cd "$srcdir/$_distdir"
  if [ -z "$DISPLAY" ]; then
    echo "Empty \$DISPLAY - falling back to xvfb-run (xorg-server-xvfb)"
    xvfb-run -a -s "+extension GLX -screen 0 1280x1024x24" /usr/bin/perl Makefile.PL
  else
    /usr/bin/perl Makefile.PL
  fi
  make

}

check() {
  cd "$srcdir/$_distdir"
  echo "" > test.pl # Disable random X11 windows
  if [ -z "$DISPLAY" ]; then
    echo "Empty \$DISPLAY - falling back to xvfb-run (xorg-server-xvfb)"
    xvfb-run -a -s "+extension GLX -screen 0 1280x1024x24" make test
  else
    make test
  fi
}

package() {
  cd "$srcdir/$_distdir"
  make install

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