summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3409c98c1db39c5cd727000d8320de520f70b4f9 (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
# Maintainer: Jef Roosens
# Contributor: Logan Magee <mageelog@gmail.com>
# Contributor: Dimitris Kiziridis <ragouel at outlook dot com>
# Contributor: whoami <whoami@systemli.org>
# Contributor: Jefferson González <jgmdev@gmail.com>
# Contributor: Chloe Kudryavtsev <toast@toastin.space>

pkgname=vlang-git
pkgver=0.4.5.r93.ga1d4712b0b
pkgrel=1
pkgdesc='Simple, fast, safe, compiled language for developing maintainable software (development version)'
arch=('x86_64' 'aarch64')
url='https://vlang.io'
license=('MIT')
depends=('glibc' 'libx11')
makedepends=('git')
optdepends=('glfw: Needed for graphics support'
            'freetype2: Needed for graphics support'
            'openssl: Needed for http support')
conflicts=('v' 'vlang' 'vlang-bin')
provides=('vlang')
source=('v::git+https://github.com/vlang/v')
sha256sums=('SKIP')

pkgver() {
  # Weekly tags are considered older than semantic tags that are older than
  # them, so to prevent version resolution problems we exclude weekly tags.
  git -C v describe --long --tags --exclude "weekly*" | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
    # `v up` should be disabled, as it can break the installed package.
    echo "println('v up is disabled; see the AUR page for more information.')" > 'v/cmd/tools/vup.v'
}

build() {
    cd v

    CFLAGS= LDFLAGS= make prod=1 

    # Compile all tools
    LDFLAGS= ./v build-tools
}

package() {
    cd v

    install -d "${pkgdir}/usr/lib/vlang" "${pkgdir}/usr/share/vlang" "${pkgdir}/usr/bin"
    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm755 v "${pkgdir}/usr/lib/vlang"
    cp -a cmd "${pkgdir}/usr/lib/vlang/"
    cp -a examples "${pkgdir}/usr/share/vlang/"
    cp -a thirdparty "${pkgdir}/usr/lib/vlang/"
    cp -a vlib "${pkgdir}/usr/lib/vlang/"
    cp v.mod "${pkgdir}/usr/lib/vlang/"
    ln -s /usr/lib/vlang/v "${pkgdir}/usr/bin/v"

    touch "${pkgdir}/usr/lib/vlang/cmd/tools/.disable_autorecompilation"
}

# vim: ft=bash