# Maintainer (Arch):  Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor (Arch): jwwolf <jwwolf+arch@gmail.com>
# Contributor (Arch): Bernhard Walle <bernhard@bwalle.de>
# Maintainer: fauno <fauno@kiwwwi.com.ar>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Márcio Silva <coadde@hyperbola.info>
# Contributor: Josh Branning <lovell.joshyyy@gmail.com>

# parabola changes and rationale:
#  - add linux-libre kernel support
#  - corrected license

pkgname=crosstool-ng
pkgver=1.23.0
pkgrel=1.parabola1
pkgdesc='Versatile (cross-)toolchain generator, with Linux-libre kernel support'
arch=('i686' 'x86_64' 'armv7h')
url='http://crosstool-ng.org/'
license=('GPL2')
depends=('make' 'gperf' 'wget')
makedepends=('help2man')
options=('!makeflags')
source=("http://crosstool-ng.org/download/$pkgname/$pkgname-$pkgver.tar.bz2"
        ctng-libre.patch)
md5sums=('dc861702ecce216d1855c8185f0f1873'
         '83658f8044ca95b1670860ff18865033')
sha256sums=('1b76404960f2b35471b6385ba707b8a4712431820fe30063e435dad97ccb02b4'
            '36070c7691a150068ab47f01ba59716a1ffc69a08d88347f30c5d60c416adcfc')

prepare() {
  cd "$pkgname-$pkgver"
  patch -Np1 -i ../ctng-libre.patch
}

build() {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr
  make
}

package() {
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
  install -Dm644 ct-ng.comp "$pkgdir"/usr/share/bash-completion/completions/ct-ng
}
