spim: fix package (#9699)

* spim: fix template

* spim: add flex 2.6 compatibility patch

Closes #9518
This commit is contained in:
avoidr 2017-12-02 08:24:24 +01:00 committed by Juan RP
parent 7deb27c0f7
commit 6d9dbc37f0
2 changed files with 28 additions and 7 deletions

View file

@ -0,0 +1,20 @@
Description: Fix parsing when built with flex 2.6
Origin: https://sourceforge.net/p/spimsimulator/code/679/
Bug: https://sourceforge.net/p/spimsimulator/bugs/66/
Bug-Debian: https://bugs.debian.org/860011
Last-Update: 2017-04-20
Index: spim-8.0+dfsg/CPU/scanner.l
===================================================================
--- ./CPU/scanner.l
+++ ./CPU/scanner.l
@@ -316,7 +316,8 @@ initialize_scanner (FILE *in_file)
yyin = in_file;
#ifdef FLEX_SCANNER
yyrestart(in_file);
-#if (YY_FLEX_MAJOR_VERSION==2 && YY_FLEX_MINOR_VERSION==5 && YY_FLEX_SUBMINOR_VERSION>=33)
+#define YY_FLEX_VERSION (YY_FLEX_MAJOR_VERSION * 1000 + YY_FLEX_MINOR_VERSION * 100 + YY_FLEX_SUBMINOR_VERSION)
+#if YY_FLEX_VERSION >= 2533
/* flex 2.5.33 flipped the polarity of this flag (sigh) */
yy_init = 0;
#else

View file

@ -20,13 +20,14 @@ pre_configure() {
-e 's:CFLAGS =:CFLAGS +=:' \
-e 's:LDFLAGS =:LDFLAGS +=:' \
-e 's:CC = gcc:CC ?= gcc:' \
-e "s:BIN_DIR = .*:BIN_DIR = ${DESTDIR}/usr/bin/:" \
-e "s:EXCEPTION_DIR = .*:EXCEPTION_DIR = ${DESTDIR}/usr/share/spim/:" \
-e "s:MAN_DIR = .*:MAN_DIR = ${DESTDIR}/usr/share/man/man1/:" \
-e "s:spim.man:spim.1:"
mv ../Documentation/{spim.man,spim.1}
-e 's:EXCEPTION_DIR = .*:EXCEPTION_DIR = /usr/share/spim:' \
-e 's:spim.man:spim.1:'
# EXCEPTION_DIR affects DEFAULT_EXCEPTION_HANDLER in spim.c
}
post_install() {
vlicense LICENSE
do_install() {
vbin spim
vman ../Documentation/spim.man spim.1
vlicense LICENSE LICENSE.BSD
vinstall ../CPU/exceptions.s 644 /usr/share/spim/
}