summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fb2cd5dde683bb9f7fd89bfbae3236d316d1459b (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
# Contributor: Honghao Li <hh.li99@outlook.com>
# Contributor: Michael Yang <ohmyarchlinux@pm.me>
# Maintainer: Kuan-Yen Chou <kuanyenchou at gmail dot com>

pkgname=vcpkg-git
pkgver=2023.06.20.r43.g288e8bebf4
pkgrel=1
pkgdesc='C++ library manager for Windows, Linux, and MacOS'
depends=('curl' 'zip' 'unzip')
makedepends=('git' 'cmake>=3.3.0' 'ninja')
optdepends=()
arch=('x86_64')
url='https://github.com/microsoft/vcpkg'
license=('MIT')
provides=('vcpkg')
conflicts=('vcpkg')
source=("$pkgname"::'git+https://github.com/microsoft/vcpkg'
        'vcpkg.sh'
        'vcpkg.conf')
sha256sums=('SKIP'
            'a26b2b4472e3e7c3372617ada9ca2d4c33094c5c5004880e0f3b32bcf5086a25'
            '02a6d2bca471adedfc7acc9ba57860d976ec5115b282cb1a96341850e1c7b221')
install=$pkgname.install

pkgver() {
    cd "$srcdir/$pkgname"
    if git describe --long --tags >/dev/null 2>&1; then
        git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
    else
        printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git describe --always)"
    fi
}

build() {
    "$srcdir/$pkgname/bootstrap-vcpkg.sh" -disableMetrics
}

package() {
    export VCPKG_ROOT=/opt/vcpkg
    export VCPKG_DOWNLOADS=/var/cache/vcpkg

    # executable entry point
    install -Dm755 "$srcdir/vcpkg.sh" "$pkgdir/usr/bin/vcpkg"

    # vcpkg root
    install -Dm755 "$srcdir/$pkgname/vcpkg" "$pkgdir/$VCPKG_ROOT/vcpkg"
    cp --preserve=mode -r \
        "$srcdir/$pkgname"/{ports,scripts,triplets,.vcpkg-root} \
        "$pkgdir/$VCPKG_ROOT/"

    # default downloads root directory
    install -dm1777 "$pkgdir/$VCPKG_DOWNLOADS"

    # reset ownerships and permissions
    chmod -R g+w "$pkgdir/$VCPKG_ROOT"
    chgrp -hR 499 "$pkgdir/$VCPKG_ROOT" "$pkgdir/$VCPKG_DOWNLOADS"

    # license
    install -Dm644 "$srcdir/$pkgname/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
    # systemd-sysusers.service
    install -Dm644 "$srcdir/vcpkg.conf" "$pkgdir/usr/lib/sysusers.d/vcpkg.conf"
}

# vim: set sw=4 ts=4 et: