summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2fba69702a57b30a34c61027d3f03d7d57f8ba47 (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
# Maintainer: Andy Weidenbaum <archbaum@gmail.com>

pkgname=perl6-linenoise
pkgver=0.1.0
pkgrel=4
pkgdesc="Bindings to linenoise"
arch=('i686' 'x86_64')
depends=('perl6')
checkdepends=('perl')
makedepends=('git' 'make' 'perl6-librarymake')
groups=('perl6')
url="https://github.com/hoelzro/p6-linenoise"
license=('MIT')
source=($pkgname-$pkgver::git+https://github.com/hoelzro/p6-linenoise)
sha256sums=('SKIP')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  msg2 'Building...'
  mkdir -p blib/lib
  cat > build.p6 <<'EOF'
my $workdir = $*CWD;
my %vars = get-vars("$workdir/blib/lib");
%vars<helper> = 'resources/libraries/' ~ $*VM.platform-library-name('liblinenoise'.IO);
process-makefile("$workdir", %vars);
shell(%vars<MAKE>);
EOF
  perl6 -MLibraryMake build.p6
}

check() {
  cd "$srcdir/$pkgname-$pkgver"

  msg2 'Running tests...'
  PERL6LIB=lib prove -r -e perl6
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  msg2 'Installing license...'
  install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"

  msg2 'Installing documentation...'
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"

  msg2 'Installing...'
  export RAKUDO_LOG_PRECOMP=1
  export RAKUDO_RERESOLVE_DEPENDENCIES=0
  perl6-install-dist \
    --to="$pkgdir/usr/share/perl6/vendor" \
    --for=vendor \
    --from=.
}