summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d3a457cf0f0a4993c480aa6fa29b3d70878e392a (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
62
63
64
65
66
67
68
69
# Maintainer: Mark Collins <tera_1225 hat hotmail ðot com>
# Partially adapted from https://github.com/wasta-linux/lameta-snap
pkgname=lameta
pkgver=2.3.15_beta
_electron=electron27
pkgrel=1
pkgdesc="The Metadata Editor for Transparent Archiving of language document materials"
arch=('x86_64')
url="https://github.com/onset/lameta"
license=('MIT')
depends=(
  gcc-libs
  glibc
	bash
	"$_electron"
	nodejs
)
makedepends=(
	asar
	npm
	yarn
)
source=(
  "${pkgname}-${pkgver}.zip::${url}/archive/refs/tags/v${pkgver//_/-}.tar.gz"
	"${pkgname}.desktop"
  'no_node_pin.patch'
)
sha256sums=('b7f85b69abb980ff1fcf0a6467e1b737b170cb7f71e765f082fc09ea0699b9c1'
            '874e1acc986076e9c876c6ccd2efc7ee0dcda322733c018fb8e3d0bf010b8791'
            '7bc59aee62f8a77217d76ae42f6445ed51375f5c1c158c678aa56c208edbdc28')

prepare() {
	cd "${srcdir}/${pkgname}-${pkgver//_/-}"
	echo -e 'logFilters:\n  - code: "YN0013"\n    level: "discard"' >> .yarnrc.yml
  echo "Applying patch to unpin node and yarn versions"
  patch --forward --strip=1 --input="${srcdir}/no_node_pin.patch"
}

build() {
	cd "${srcdir}/${pkgname}-${pkgver//_/-}"
  yarn
  yarn install --frozen-lockfile
  yarn build
  yarn lingui-compile
	./node_modules/.bin/electron-builder \
	  --linux --x64 --dir \
    --config.electronDist=/usr/lib/"$_electron"
}

package() {
	cd "${srcdir}"
	install -Dm644 "${pkgname}.desktop" -t "${pkgdir}/usr/share/applications/"
	cd "${srcdir}/${pkgname}-${pkgver//_/-}"
  install -Dm644 "LICENSE" \
   "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
	install -Dm644 "assets/icon.png" \
		"$pkgdir/usr/share/icons/$pkgname/$pkgname.png"
	install -dm755 "${pkgdir}/var/log/lameta"
  install -d "$pkgdir/usr/lib/$pkgname/"
  asar e "release/linux-unpacked/resources/app.asar" "$pkgdir/usr/lib/$pkgname/"
  install -Dm755 /dev/null "${pkgdir}/usr/bin/$pkgname"
  cat >>"${pkgdir}/usr/bin/$pkgname" <<EOD
#! /usr/bin/sh
exec $_electron /usr/lib/$pkgname "\$@"
EOD
	echo "This build dir is rather large:"
  du -h -d0 "$(dirname "$srcdir/../")"
  echo "Maybe you should consider deleting it"
}