summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ff70bc7fcb3a0bb41ead200e8a260021089ba3ad (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
# Maintainer: Will Price <will.price94+aur@gmail.com>

pkgname=boot-vhdl-git
pkgver=r48.883635b
pkgrel=1
pkgdesc="A VHDL simulator and synthesizer"
arch=('i686' 'x86_64')
license=('GPL')
url="http://freerangefactory.org/boot.html"
depends=('python2'
         'ghdl'
         'pywebkitgtk'
         'python2-mechanize'
         'python2-pygments')
source=('boot-vhdl::git+https://github.com/willprice/boot.git')
md5sums=('SKIP')

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

prepare() {
  _fix_python_invocations
}

package() {
  mkdir -p "$pkgdir"/usr/{bin,share/{applications,pixmaps,boot-vhdl}}
  cp -r "$srcdir"/boot-vhdl/boot_scr/*.py \
        "$pkgdir/usr/share/boot-vhdl/"
  cp -r "$srcdir/boot-vhdl/boot_scr/old" \
        "$pkgdir/usr/share/boot-vhdl/"
  cp -r "$srcdir/boot-vhdl/LICENSE" \
        "$pkgdir/usr/share/boot-vhdl/LICENSE"

  for _suffix in png svg; do
    cp "$srcdir/boot-vhdl/boot_scr/boot-icon.$_suffix" \
       "$pkgdir/usr/share/pixmaps"
  done

  cp "$srcdir/boot-vhdl/boot_scr/boot.desktop" \
     "$pkgdir/usr/share/applications"
 cat << EOF > "$pkgdir/usr/bin/boot"
#!/bin/sh
python2 /usr/share/boot-vhdl/boot.py
EOF
  chmod 755 "$pkgdir/usr/bin/boot"
}

_fix_python_invocations() {
  # | replaces / as it's easier to identify
  sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
      -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
      $(find $srcdir -name '*.py')
}