summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ef2229da52037c28f8f9e75e64161fcc27445383 (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
# Contributor: Grey Christoforo <first name at last name dot net>
# Maintainer: Neko_Rikka <yjzyl9008 at gmail dot com>

pkgname=python-unitypy-git
_pkgname=UnityPy
pkgver=r779.3472646
pkgrel=1
pkgdesc="A unity asset extractor based on unitypack and AssetStudio."
arch=('x86_64')
url="https://github.com/K0lb3/UnityPy"
license=('MIT')
provides=('python-unitypy')
conflicts=('python-unitypy')
depends=(
  'python-attrs'
  'python-lz4'
  'python-brotli'
  'python-pillow'
  'python-pyfmodex-git'
  'python-fsspec'
  'python-texture2ddecoder'
  'python-etcpak-git'
  'python-tabulate'
  'python-fmod-tookit-git'
  'python-astc-encoder-py-git'
)
checkdepends=('python-pytest' 'python-psutil')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel' 'git' 'git-lfs')
source=("git+https://github.com/K0lb3/UnityPy.git")
md5sums=('SKIP')
options=('!strip')

pkgver() {
  cd ${_pkgname}
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd ${_pkgname}
  git lfs install --local
  
  git remote add network-origin "https://github.com/K0lb3/UnityPy.git" || true
  echo "Fetching LFS objects from network..."
  git lfs fetch network-origin
  git lfs checkout
}

build() {
  cd ${_pkgname}
  export LC_ALL=C
  python -m build --wheel --no-isolation
}

check() {
  cd ${_pkgname}
  export LANG=en_US.UTF-8
  PYTHONPATH="$PWD" pytest -v || true
}

package() {
  cd ${_pkgname}
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm0644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm0644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README"
}