summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 034b63fbf4ae42f5f142a5cd1ac358e35c1d098f (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
70
71
72
73
74
75
76
# Maintainer: Kaizhao Zhang <zhangkaizhao@gmail.com>

_srcname=hatch

pkgname=python-hatch
pkgver=0.11.0
pkgrel=2
pkgdesc="A modern project, package, and virtual env manager"
arch=('any')
url="https://github.com/ofek/hatch"
license=('MIT' 'APACHE')
depends=(
  'python-appdirs'
  'python-atomicwrites'
  'python-click'
  'python-colorama'
  'python-coverage'
  'python-pexpect'
  'python-pip>=9.0.1'
  'python-pytest'
  'python-semver>=2.7.8'
  'python-setuptools>=36.0.0'
  'python-sortedcontainers>=1.5.7'
  'python-toml>=0.9.3'
  'twine>=1.9.1'
  'python-userpath>=1.1.0'
  'python-virtualenv'
  'python-wheel>=0.27.0'
)
provides=('python-hatch')
options=(!emptydirs)
source=(
  "https://github.com/ofek/hatch/archive/${pkgver}.tar.gz"
  'hatch_complete.sh'
  'hatch_complete.zsh'
)
sha256sums=(
  '89eb2417503125919f5536b0c50390affa2536b193ddcfc826ad96a4d17e7678'
  'b87254c621719188907a2062b0aa3c4eb078088872d1de7d53d6a6d61a679c44'
  'a43679d72ebb7b5c029192519597eff835586d0b6ed9d1e3dfc93270b8720e71'
)

prepare() {
  cd "${srcdir}/${_srcname}-${pkgver}"
  # no need to include tests files
  rm tests/__init__.py
}

build() {
  cd "${srcdir}/${_srcname}-${pkgver}"
  python setup.py build
}

package() {
  cd "${srcdir}/${_srcname}-${pkgver}"
  python setup.py install --root="${pkgdir}/" --optimize=1 --skip-build
  install -Dm644 COMMANDS.rst "${pkgdir}/usr/share/doc/${pkgname}/COMMANDS.rst"
  install -Dm644 CONFIG.rst "${pkgdir}/usr/share/doc/${pkgname}/CONFIG.rst"
  install -Dm644 HISTORY.rst "${pkgdir}/usr/share/doc/${pkgname}/HISTORY.rst"
  install -Dm644 README.rst "${pkgdir}/usr/share/doc/${pkgname}/README.rst"
  install -Dm644 LICENSE-MIT "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-MIT"
  install -Dm644 LICENSE-APACHE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE-APACHE"

  cd "${srcdir}"

  # Tab completions.
  # via https://github.com/ofek/hatch/issues/57 and https://click.palletsprojects.com/en/7.x/bashcomplete/

  # Tab completion for Bash.
  # Generated by `_HATCH_COMPLETE=source hatch > hatch_complete.sh`
  install -Dm644 hatch_complete.sh "${pkgdir}/usr/share/bash-completion/completions/${_srcname}"

  # Tab completion for Zsh.
  # Generated by `_HATCH_COMPLETE=source_zsh hatch > hatch_complete.zsh`
  install -Dm644 hatch_complete.zsh "${pkgdir}/usr/share/zsh/site-functions/_${_srcname}"
}