summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a84d3a70da255ee79623cd8b194da0de8f6059d3 (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
# Maintainer: 
# Contributor: Mark Wagie <mark dot wagie at tutanota dot com>
# Contributor: dracorp aka Piotr Rogoza <piotr.r.public at gmail.com>
pkgname=perl-wx
pkgver=0.9932
pkgrel=6
pkgdesc="Interface to the wxWidgets cross-platform GUI toolkit"
arch=('x86_64')
url="https://metacpan.org/dist/Wx"
license=('GPL' 'PerlArtistic')
depends=('perl-alien-wxwidgets' 'perl-extutils-xspp' 'wxgtk3')
makedepends=('perl-module-build' 'dos2unix')
checkdepends=('xorg-server-xvfb')
options=('!emptydirs')
source=("https://cpan.metacpan.org/authors/id/M/MD/MDOOTSON/Wx-$pkgver.tar.gz"
        'https://src.fedoraproject.org/rpms/perl-Wx/raw/rawhide/f/Wx-0.9932-Undefine-BOM_UTF8.patch'
        'https://src.fedoraproject.org/rpms/perl-Wx/raw/rawhide/f/gtk3.patch'
        'https://src.fedoraproject.org/rpms/perl-Wx/raw/rawhide/f/wxWidgets_3.2_MakeMaker.patch'
        'https://src.fedoraproject.org/rpms/perl-Wx/raw/rawhide/f/wxWidgets_3.2_port.patch'
        )
sha256sums=('1cfdb6535a0f4676e6f1aab2c9d8e16d577be3eb3b7cc04c8074d685e6651b70'
            'db9a10e52a91c754ea95a1ee0f37249947ebc12190566ee46221c48e416bb9b6'
            '61fca0928af91231988779b74b2aa735f92bea40804c3c50aaa8cac4ac5b3f1b'
            'bc579d66dab5e497aa165c297ea77ae42d6b30e42e958f3fcc7fd82d4f1ea20e'
            'e185d46ef500618e98898e189be65ece769efbc330beebb6a03112736289a5ed')

prepare() {
  cd "Wx-$pkgver"

  # Fix from fedora package
  msg2 "Fix line endings"
  dos2unix MANIFEST
  dos2unix typemap


  # Fixes for GTK3 compatibility
  for patch in ../*.patch; do
    msg2 "Applying $patch"
    patch -Np1 -i $patch
  done
}

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'" \
    WX_CONFIG=/usr/bin/wx-config \
    MODULEBUILDRC=/dev/null

  cd "Wx-$pkgver"
  perl Makefile.PL
  make
}

# Use makepkg --nocheck to disable check()
check(){
  cd "Wx-$pkgver"
  if [[ -z "$DISPLAY" || -x /usr/bin/xvfb-run ]]; then
#     warning '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 "Wx-$pkgver"
  make DESTDIR="$pkgdir" install
}