MSYS2-packages/flex/PKGBUILD
Christoph Reiter 38126d763e makedepend on autotools for packages using configure
In some cases this will introduce cycles which could likely be cleaned
up by only depending on some unix tools instead of the whole autotools.

Rebuilding doesn't make much sense at this point since it just adds a subset
of base-devel which is still installed by default.
2021-12-12 14:20:50 +01:00

60 lines
1.4 KiB
Bash

# Maintainer: Alexey Pavlov <alexpux@gmail.com>
pkgname=flex
pkgver=2.6.4
pkgrel=1
pkgdesc="A tool for generating text-scanning programs"
arch=('i686' 'x86_64')
url="https://github.com/westes/flex"
license=('custom')
groups=('base-devel')
depends=('m4' 'sh' 'libiconv' 'libintl')
makedepends=('libiconv-devel' 'gettext-devel' 'autotools')
options=('staticlibs')
install=flex.install
source=(https://github.com/westes/flex/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz
flex-2.5.38-msys2.patch)
sha256sums=('e87aae032bf07c26f85ac0ed3250998c37621d95f8bd748b31f15b33c45ee995'
'6ffcb831faa9c29c44b717825744887ea5b3945605153831339e0b8a37cbe5c3')
prepare() {
cd ${srcdir}/${pkgname}-${pkgver}
patch -p1 -i ${srcdir}/flex-2.5.38-msys2.patch
./autogen.sh
}
build() {
cd ${srcdir}/${pkgname}-${pkgver}
./configure \
--build=${CHOST} \
--prefix=/usr \
--without-libiconv-prefix \
--without-libintl-prefix \
--enable-static \
--disable-shared
make
}
check() {
cd ${srcdir}/${pkgname}-${pkgver}
make check
}
package() {
cd ${srcdir}/${pkgname}-${pkgver}
make DESTDIR=${pkgdir} install
if [ ! -f ${pkgdir}/usr/bin/flex++.exe ]; then
cp -f ${pkgdir}/usr/bin/flex.exe ${pkgdir}/usr/bin/flex++.exe
fi
if [ ! -f ${pkgdir}/usr/bin/lex.exe ]; then
cp -f ${pkgdir}/usr/bin/flex.exe ${pkgdir}/usr/bin/lex.exe
fi
install -Dm644 COPYING ${pkgdir}/usr/share/licenses/${pkgdir}/license.txt
}