summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c8ae7a8205f4ad8a6f383eaa63744e8702200854 (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
# Contributor: Swift Geek <swiftgeek «at» gmail.com>
pkgname=perl-extutils-cppguess
pkgver=0.09
pkgrel=1
pkgdesc="ExtUtils::CppGuess - guess C++ compiler and flags"
arch=('any')
url="https://metacpan.org/release/ExtUtils-CppGuess/"
license=('GPL' 'PerlArtistic')
depends=('perl' 'perl-capture-tiny')
makedepends=('perl-module-build')
provides=()
conflicts=()
replaces=()
backup=()
options=(!emptydirs)
install=
source=("https://cpan.metacpan.org/authors/id/E/ET/ETJ/ExtUtils-CppGuess-${pkgver}.tar.gz")
md5sums=('f8ada38ee4ad86a4f1e20d8525ce0c99')

prepare() {
  export _src_dir="$srcdir/ExtUtils-CppGuess-$pkgver"
  # 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 "$_src_dir"
sed -i  "135i    \$self->{guess}{extra_cflags} .= ' -DPERL_IMPLICIT_SYS' if \$Config::Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/;" lib/ExtUtils/CppGuess.pm
  /usr/bin/perl Makefile.PL
  make
}

check () {
  cd "$_src_dir"
  make test
}

package () {
  cd "$_src_dir"
  make install

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