summaryrefslogtreecommitdiff
path: root/core/patch/PKGBUILD
blob: 8174e80ebc6201a97fcdf1817fa268fb07d23d6b (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
# $Id: PKGBUILD 174021 2013-01-01 15:15:16Z foutrelis $
# Maintainer: Allan McRae <allan@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>

pkgname=patch
pkgver=2.7.1
pkgrel=2
pkgdesc="A utility to apply patch files to original sources"
arch=('i686' 'x86_64' 'mips64el')
url="http://www.gnu.org/software/patch/patch.html"
license=('GPL')
groups=('base-devel')
depends=('glibc')
makedepends=('ed')
optdepends=('ed: for patch -e functionality')
source=(ftp://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz{,.sig}
        patch-2.7.1-initialize-data-structures-early-enough.patch)
md5sums=('e9ae5393426d3ad783a300a338c09b72'
         'b12189e0de3cb2af25268441647ec517'
         'dc6367a7cd49933d4006c246789e98da')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  # Fix segfault on non-numeric strip-count
  # (also segfaults on nonexistent directory passed to -d)
  # http://savannah.gnu.org/bugs/?37500
  patch -Np1 -i \
    $srcdir/patch-2.7.1-initialize-data-structures-early-enough.patch

  ./configure --prefix=/usr
  make
}

check() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make check
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=$pkgdir install
}