# Contributor: Michał Polański # Maintainer: Michał Polański pkgname=esbuild pkgver=0.19.0 pkgrel=0 pkgdesc="Extremely fast JavaScript bundler and minifier" url="https://esbuild.github.io/" license="MIT" arch="all" makedepends="go nodejs" source="https://github.com/evanw/esbuild/archive/v$pkgver/esbuild-$pkgver.tar.gz" options="net" # fetch dependencies export GOPATH="$srcdir" export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}" export GOTMPDIR="${GOTMPDIR:-"$srcdir"}" export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}" build() { go build \ -ldflags="-X main.version=$pkgver" \ -v ./cmd/esbuild node scripts/esbuild.js npm/esbuild/package.json --version node scripts/esbuild.js ./esbuild --neutral # binary path override sed -i '1s#^#var ESBUILD_BINARY_PATH = "/usr/bin/esbuild";\n#' \ npm/esbuild/lib/main.js } check() { go test ./... } package() { install -Dm755 esbuild "$pkgdir"/usr/bin/esbuild local destdir=/usr/lib/node_modules/esbuild install -d \ "$pkgdir"/$destdir/bin \ "$pkgdir"/$destdir/lib install -Dm644 -t "$pkgdir"/$destdir npm/esbuild/package.json install -Dm644 -t "$pkgdir"/$destdir/lib npm/esbuild/lib/* ln -s /usr/bin/esbuild "$pkgdir"/$destdir/bin/esbuild } sha512sums=" 8bc55ca78374c01984220c88c79e9f062164770465eecf5c432eee2fcdc6ed2ac1dd0ee5bf9f0bcc72581cdc52110b165d9469fb2b21cafe0982e7aa9c7d9ddd esbuild-0.19.0.tar.gz "