Files
MSYS2-packages/patch/PKGBUILD
2016-10-11 21:10:36 +01:00

59 lines
1.5 KiB
Bash

# Maintainer: Alexey Pavlov <alexpux@gmail.com>
pkgname=patch
pkgver=2.7.5
pkgrel=1
pkgdesc="A utility to apply patch files to original sources"
arch=('i686' 'x86_64')
url="https://www.gnu.org/software/patch/patch.html"
license=('GPL')
groups=('base-devel')
depends=('msys2-runtime')
makedepends=('ed')
optdepends=('ed: for patch -e functionality')
source=(https://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.xz{,.sig}
msys2-patch-2.7.1.patch
msys2-patch-manifest.patch)
sha256sums=('fd95153655d6b95567e623843a0e77b81612d502ecf78a489a4aed7867caa299'
'SKIP'
'9be45bcfb141c17b7501ed10cc88d50967d6c2cc1bba2f1273a47ca7e316ffe0'
'714da1a384d3e0acca5351980b0b3b1b09b66140fabe2e74dfd313652f964de9')
prepare() {
cd ${srcdir}/${pkgname}-${pkgver}
[[ -f src/patch.manifest ]] && rm -f src/patch.manifest
[[ -f src/patch.rc ]] && rm -f src/patch.rc
patch -Np1 -i ${srcdir}/msys2-patch-2.7.1.patch
patch -Np2 -i ${srcdir}/msys2-patch-manifest.patch
local _arch=
if [ "${CARCH}" == 'x86_64' ]; then
_arch='amd64'
elif [ "${CARCH}" == 'i686' ]; then
_arch='x86'
fi
sed -e "s|@ARCH@|${_arch}|g" -i src/patch.manifest
autoreconf -fi
}
build() {
cd ${srcdir}/${pkgname}-${pkgver}
./configure \
--build=${CHOST} \
--prefix=/usr \
ac_cv_func_setmode_dos=yes
make
}
check() {
cd ${srcdir}/${pkgname}-${pkgver}
make check
}
package() {
cd ${srcdir}/${pkgname}-${pkgver}
make DESTDIR=$pkgdir install
}