summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2fd61fa1c3b0a30c1fce3426533ccc3fde87be5f (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
# Maintainer: Index Dev Team <devteam@dogelonindex.org>

_distro="index"
_namespace="indexdevteam"
_pkg="tokenlists-org"
_pkgname="${_distro}-${_pkg}"
pkgname="${_pkgname}"
pkgver=1.0
pkgrel=1
pkgdesc='A site for browsing featured token lists.'
url="https://${_namespace}.github.io/${_pkg}"
_url="https://github.com/${_namespace}/${_pkg}"
license=('MIT')
arch=('any')
depends=('apache')
provides=("${_pkg}")
makedepends=('npm' 'nodejs' 'yarn')
source=("${_pkg}::git+${_url}#tag=${pkgver}"
	"${_pkg}.sh"
        "bg.png")
sha256sums=('SKIP'
            '4a8bebdd02389f8a21945831c90cdbd5a91ceffb408fb1891ae738738706f034'
            'd2ef7330273922b849682fcab38a220eb23337fb0e5a2373ec32efa76b6d933e')

prepare() {
  cp "bg.png" "${srcdir}/${_pkg}/src"
}

build() {
  cd "${srcdir}/${_pkg}" || exit
  NODE_OPTIONS="--openssl-legacy-provider" npm install --production \
                                                       react-scripts@4.0.3
  NODE_OPTIONS="--openssl-legacy-provider" npm audit fix || true
  NODE_OPTIONS="--openssl-legacy-provider" npm install .
  NODE_OPTIONS="--openssl-legacy-provider" npm audit fix || true
  NODE_OPTIONS="--openssl-legacy-provider" npm run-script build
}

package() {
  cd "${srcdir}"
  local _dest="${pkgdir}/usr/share/${_pkg}"
  local _bin="${pkgdir}/usr/bin"
  mkdir -p "${_dest}"
  mkdir -p "${_bin}"
  cp -r "${_pkg}/build/"* "${_dest}"
  install -Dm755 "${_pkg}.sh" "${_bin}/${_pkg}"
}