<?xml version="1.0"?>
<package name="flex">
	<description>A fast lexical analyzer generator</description>
	<releases>
		<release version="2.6.4" revision="3" tag="stage2">
			<build>
				<script>
					<archive name="flex-$VERSION">
						<!-- crosscompile fix -->
						<cmd>echo "ac_cv_func_malloc_0_nonnull=yes" &gt; config.cache</cmd>
						<cmd>echo "ac_cv_func_realloc_0_nonnull=yes" &gt;&gt; config.cache</cmd>

						<!-- fix cross-build with GCC 15 -->
						<cmd>sed -i -e 's/malloc ()/malloc (size_t n)/' lib/malloc.c</cmd>

						<!-- fix build with glibc 2.26 -->
						<cmd>sed -i -e 's/ reallocarray//' configure</cmd>

						<cmd>./configure --build=$HOST --host=$TARGET --disable-nls --disable-shared --cache-file=config.cache</cmd>
						<cmd>make</cmd>
						<cmd>touch doc/flex.1</cmd>
						<cmd>make install</cmd>
						<cmd check="no">echo "exec /stage2/bin/flex -l \"\$@\"" &gt; /stage2/bin/lex</cmd>
						<cmd>chmod 755 /stage2/bin/lex</cmd>
					</archive>
				</script>
			</build>
		</release>
		<release version="2.6.4" revision="2">
			<build>
				<script>
					<archive name="flex-$VERSION">
						<!-- fix build with glibc 2.26 -->
						<cmd>sed -i -e 's/ reallocarray//' configure</cmd>

						<cmd>./configure --disable-shared</cmd>
						<cmd>make</cmd>
						<cmd>touch doc/flex.1</cmd>
						<cmd>make install</cmd>
						<cmd check="no">echo "exec /usr/bin/flex -l \"\$@\"" &gt; /usr/bin/lex</cmd>
						<cmd>chmod 755 /usr/bin/lex</cmd>
					</archive>
				</script>
			</build>
		</release>
	</releases>
</package>
