summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0c936594fff7050a6bcb3f4e721ff55e6ba370ed (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
# Maintainer: graysky <therealgraysky AT protonmail DOT com>
# Contributor: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Jaroslav Lichtblau <svetlemodry@archlinux.org>
# Contributor: Geoffroy Carrier <geoffroy@archlinux.org>
# Contributor: Joël Schaerer <joel.schaerer@laposte.net>
# Contributor: Daniel J Griffiths <ghost1227@archlinux.us>

pkgname=autojump
pkgver=22.5.3
pkgrel=9
pkgdesc="A faster way to navigate your filesystem from the command line"
arch=('any')
url="https://github.com/wting/autojump"
license=('GPL3')
depends=('python>=3.3')
conflicts=('shonenjump')
source=($pkgname-$pkgver.tar.gz::https://github.com/wting/$pkgname/archive/release-v$pkgver.tar.gz)
sha256sums=('00daf3698e17ac3ac788d529877c03ee80c3790472a85d0ed063ac3a354c37b1')
install=readme.install

prepare() {
  cd $pkgname-release-v$pkgver
  sed -i "s:/env python:/python3:g" bin/$pkgname
}

package() {
  cd $pkgname-release-v$pkgver

  # https://wiki.archlinux.org/index.php/Python_package_guidelines#Using_site-packages
  local _site_packages=$(python -c "import site; print(site.getsitepackages()[0])")

  SHELL=/bin/bash ./install.py --destdir "${pkgdir}" \
    --prefix 'usr/' \
    --zshshare 'usr/share/zsh/site-functions'

  cd "${pkgdir}/usr/share/$pkgname"
  for i in $pkgname.*
    do ln -s "/usr/share/$pkgname/$i" "${pkgdir}/etc/profile.d/$i"
  done

  # FS#60929
  install -d "${pkgdir}/$_site_packages"
  mv ${pkgdir}/usr/bin/*.py "${pkgdir}/$_site_packages"
  python -m compileall -d /usr/lib "${pkgdir}/usr/lib"
  python -O -m compileall -d /usr/lib "${pkgdir}/usr/lib"

  # FS#49601
  install -d "${pkgdir}"/usr/share/fish/functions
  mv "${pkgdir}"/etc/profile.d/$pkgname.fish "${pkgdir}"/usr/share/fish/functions

  # https://github.com/joelthelion/autojump/pull/339
  sed -i "s:/usr/local/:/usr/:g" "${pkgdir}/etc/profile.d/$pkgname.sh"
  sed -i "s:/build/autojump/pkg/autojump/:/:g" "${pkgdir}/etc/profile.d/$pkgname.sh"

  # FS#43762
  sed -i '27,31d' "${pkgdir}/etc/profile.d/$pkgname.sh"
}