blob: 147d54091a926cff7b84a02c2f1690c6fb4c740d (
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
|
#!/usr/bin/env bash
# shellcheck disable=SC2034
# shellcheck disable=SC2154
# The PKGBUILD for dprint-plugin-typescript.
# Maintainer: Matheus <matheusgwdl@protonmail.com>
# Contributor: Matheus <matheusgwdl@protonmail.com>
pkgname="dprint-plugin-typescript"
pkgver="0.93.3"
pkgrel="1"
pkgdesc="TypeScript and JavaScript code formatting plugin for dprint."
arch=("any")
url="https://github.com/dprint/${pkgname}"
license=("MIT")
depends=("dprint")
makedepends=("rust" "rust-wasm")
source=("${pkgname}-v${pkgver}.tar.gz::${url}/archive/refs/tags/${pkgver}.tar.gz")
sha512sums=("e09a32582789f93cddb2abb91c347446b750a9acd67fc904c3a29854e469daff4f29fa776895e9e76df9756c08f40ba03f25d9da5d6cd7b8b2a78078c726644f")
prepare()
{
cd "${srcdir}"/"${pkgname}"-"${pkgver}"/ || exit 1
cargo fetch --locked --target "${CARCH}-unknown-linux-gnu"
}
build()
{
cd "${srcdir}"/"${pkgname}"-"${pkgver}"/ || exit 1
export CARGO_TARGET_DIR="target/"
export RUSTUP_TOOLCHAIN="stable"
cargo build --frozen -F wasm -r --target wasm32-unknown-unknown
}
package()
{
# Assure that the directories exist.
mkdir -p "${pkgdir}"/usr/lib/dprint/
mkdir -p "${pkgdir}"/usr/share/doc/"${pkgname}"/
mkdir -p "${pkgdir}"/usr/share/licenses/"${pkgname}"/
# Install the software.
install -Dm755 "${srcdir}"/"${pkgname}"-"${pkgver}"/target/wasm32-unknown-unknown/release/"${pkgname//-/_}".wasm "${pkgdir}"/usr/lib/dprint/
# Install the documentation.
install -Dm644 "${srcdir}"/"${pkgname}"-"${pkgver}"/README.md "${pkgdir}"/usr/share/doc/"${pkgname}"/
# Install the license.
install -Dm644 "${srcdir}"/"${pkgname}"-"${pkgver}"/LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"/
}
|