blob: 9486913cb03ac9332c26bdca86404044e4e1a650 (
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.2"
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=("fae035363cdff5db8593b45cb88879e142a9743ea5c687a180a0e131911e65f12b70b6eac3768ebd2eb3aa2372cf25039b6d0b6d72c621e8b563ed84bf603742")
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}"/
}
|