makedeb


vlang-bin 0.2.4-2


Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero dependencies

Click here to go back to the commit logs for vlang-bin.

Commit:


Hash: 92dee0b3f2f9d886fe8e933f4b03fa43ee556be4

Message: yes

Diff


diff --git a/PKGBUILD b/PKGBUILD
index c7f3727..e3d3322 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,24 +1,47 @@
-pkgname=vlang-bin
-pkgver=0.2.2
+pkgname=vlang-git
+pkgver=0.2.2.r796.gfbc02cbc5
 pkgrel=1
-pkgdesc='Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero dependencies'
+pkgdesc='Simple, fast, safe, compiled language for developing maintainable software'
 arch=('x86_64')
-url="https://vlang.io"
+url='https://vlang.io'
 license=('MIT')
+depends=('')
+makedepends=('git')
 provides=('vlang')
-depends=('libc-bin')
-source=("${pkgname}-${pkgver}.zip::https://github.com/vlang/v/releases/download/${pkgver}/v_linux.zip")
-sha256sums=('d791102173b35f8af1446b7a6207b326dc8d3ddf3f43f433979616550e85d56d')
+conflicts=('v' 'vlang' 'vlang-bin')
+source=('vlang::git+https://github.com/vlang/v')
+sha256sums=('SKIP')
+
+pkgver() {
+  cd "${srcdir}/vlang"
+  # Weekly tags are considered older than semantic tags that are older than
+  # them, so to prevent version resolution problems we exclude weekly tags.
+  git describe --long --tags --exclude "weekly*" | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+build() {
+  cd "${srcdir}/vlang"
+  # We don't require optimizations when compiling the bootstrap executable and
+  # -O2 actually breaks `./v self` (resulting in "cgen error:"), so we empty
+  # CFLAGS and LDFLAGS to ensure successful compilation.
+  CFLAGS="" LDFLAGS="" prod=1 make
+
+  # vpm and vdoc fail to compile with "unsupported linker option" when LDFLAGS
+  # is set
+  LDFLAGS="" ./v build-tools
+}
 
 package() {
+  cd "${srcdir}/vlang"
   install -d "$pkgdir/usr/lib/vlang" "$pkgdir/usr/share/vlang" "$pkgdir/usr/bin"
-  install -Dm644 v/LICENSE "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
-  install -Dm755 v/v "$pkgdir/usr/lib/vlang"
-  cp -avR v/cmd "$pkgdir/usr/lib/vlang/"
-  chmod -R 777 "$pkgdir/usr/lib/vlang/cmd"
-  cp -avR v/examples "$pkgdir/usr/share/vlang/"
-  cp -avR v/thirdparty "$pkgdir/usr/lib/vlang/"
-  cp -avR v/vlib "$pkgdir/usr/lib/vlang/"
-  cp v/v.mod "$pkgdir/usr/lib/vlang/"
+  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"
 }