CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
libcap: updated to 2.25-2
[crossrootfs.git] / flex / Pkgfile
CommitLineData
6dca1d21
JB
1# Description: Fast Lexical Analyzer Generator
2# URL: http://flex.sourceforge.net/
3# Maintainer: CRUX System Team, core-ports at crux dot nu
b751b192 4# Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu
4c60cfdc 5# Depends on:
6dca1d21
JB
6
7name=flex
8ba9a35a 8version=2.6.3
fe8f5c15 9release=2
8ba9a35a
VM
10source=(https://github.com/westes/flex/releases/download/v$version/$name-$version.tar.gz
11 $name-$version-add_defines.patch)
6dca1d21
JB
12
13build() {
14 cd $name-$version
237e9a63 15
6dca1d21
JB
16 echo "ac_cv_func_malloc_0_nonnull=yes" > config.cache
17 echo "ac_cv_func_realloc_0_nonnull=yes" >> config.cache
237e9a63 18
8ba9a35a
VM
19 patch -p1 -i $SRC/$name-$version-add_defines.patch
20 touch doc/flex.1
21
22 # Don't build tests
23 sed '51d' -i Makefile.am
24
25 # Build stage1flex for current host
26 CC=gcc CFLAGS="" ./configure --disable-nls \
27 --prefix=/tools \
28 --enable-shared
29
30 make -C lib
31 make -C src stage1flex
32 mv src/stage1flex src/stage1flex.host
33 make distclean
34
6dca1d21
JB
35 ./configure --build=$CHOST \
36 --host=$CTARGET \
37 --prefix=/usr \
38 --disable-nls \
39 --cache-file=config.cache
237e9a63 40
8ba9a35a
VM
41 make -C lib
42 # Use stage1flex built for host
43 sed 's|./stage1flex$(EXEEXT) $(AM_LFLAGS)|./stage1flex.host$(EXEEXT) $(AM_LFLAGS)|g' -i src/Makefile
44 make -C src
6dca1d21 45 make DESTDIR=$PKG install
237e9a63 46
6dca1d21 47 ln -sf flex $PKG/usr/bin/lex
fe8f5c15 48 ln -sf flex.1.gz $PKG/usr/share/man/man1/lex.1.gz
237e9a63 49
fe8f5c15 50 rm -r $PKG/usr/share/{info,doc}
6dca1d21 51}