summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: aee783007b0d45c1c4189c1c9ca06d5597168376 (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
# Maintainer: webstrand <webstrand at gmail dot com>
pkgname=perl6-panda
pkgver=2016.02.r0.g5f3781d
pkgrel=1
pkgdesc="Perl 6 module manager."
arch=('any')
url="http://moarvm.com/"
license=(MIT)
depends=("rakudo>=2016.02")
source=("$pkgname::git+https://github.com/tadzik/panda.git#tag=2016.02"
        "PERL6LIB_bootstrap.patch")
sha512sums=('SKIP'
            'f4bf18b5f25c809e275a98db69310328e600694722c3f6a7da0ed28e473f6432566bb8b820d1e770bcf0b7083be69913ca6331da8d8d8c107dda4c609bc52837')

provides=('perl6-file-find'
          'perl6-shell-command'
          'perl6-json-fast')

conflicts=('perl6-file-find'
           'perl6-shell-command'
           'perl6-json-fast')

pkgver() {
    cd "$pkgname"
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    cd "$pkgname"
    patch -p0 < "$srcdir/PERL6LIB_bootstrap.patch"
}

build() {
    cd "$pkgname"
    RAKUDO_PREFIX="$srcdir/install/" ./bootstrap.pl
}

package() {
    # Move the installation into /usr/share/perl6/vendor
    mkdir -p "$pkgdir/usr/share/perl6"
    cp -r "$srcdir/install/site/" "$pkgdir/usr/share/perl6"
    mv "$pkgdir/usr/share/perl6/site" "$pkgdir/usr/share/perl6/vendor"

    # Remove the lockfile, vendor is not a writable repo.
    rm "$pkgdir/usr/share/perl6/vendor/repo.lock"

    # Make symlinks to the panda binaries
    mkdir -p "$pkgdir/usr/bin"
    cd "$pkgdir/usr/share/perl6/vendor/bin"
    for _file in *; do
        ln -s "/usr/share/perl6/vendor/bin/$_file" "$pkgdir/usr/bin/$_file"
    done

    install -Dm 644 "$srcdir/$pkgname/LICENSE" -t "$pkgdir/usr/share/licenses/$pkgname"
    install -Dm 644 "$srcdir/$pkgname/README.md" -t "$pkgdir/usr/share/doc/$pkgname"
}