summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 73443e6cb2d7a06fe4afb8728c5129a49f4b06eb (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: dracorp aka Piotr Rogoza <piotr.r.public at gmail.com>

pkgname=brew-git
_pkgname=brew
pkgver=2.0.6.r74.gdb02f93bb
pkgrel=1
pkgdesc='The missing package manager for macOS (or Linux)'
arch=(x86_64)
url='https://github.com/Homebrew/brew'
license=(BSD CCPL)
depends=(
ruby-irb
java-runtime
)
makedepends=(git)
provides=(brew)
conflicts=(linuxbrew-git linuxbrew brew)
source=(
"git+$url"
brew4archlinux.diff::https://patch-diff.githubusercontent.com/raw/Homebrew/brew/pull/5926.diff
)
_gitname='brew'
md5sums=('SKIP'
         '50a4929331b39fe7d1591342bd873248')

pkgver(){
  if [ -d "$srcdir"/$_gitname ]; then
    cd "$srcdir"/$_gitname
    ( set -o pipefail
    git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" )
  fi
}
prepare(){
  cd "$srcdir"/$_gitname
  patch -p1 -i "$srcdir"/brew4archlinux.diff
}
package() {
    cd "$srcdir/$_pkgname"

    install -dm777 "$pkgdir/opt/$_pkgname"
    install -dm777 "$pkgdir/opt/$_pkgname/bin"
    cp -a "$srcdir/$_pkgname/." "$pkgdir/opt/$_pkgname"

    install -dm755 "$pkgdir/usr/bin"
    ln -sf /opt/$_pkgname/bin/brew "$pkgdir/usr/bin/brew"

    install -dm755 "$pkgdir/usr/share/man/man1"
    ln -sf /opt/$_pkgname/manpages/brew{,-cask}.1 -t "$pkgdir/usr/share/man/man1"

    install -dm755 "$pkgdir/etc/bash_completion.d"
    ln -sf "/opt/$_pkgname/completions/bash/brew" -t "$pkgdir/etc/bash_completion.d/"

    install -dm755 "$pkgdir/usr/share/zsh/site-functions"
    ln -sf /opt/$_pkgname/completions/zsh/_brew{,_cask} -t "$pkgdir/usr/share/zsh/site-functions"
}