alex, happy: fix build for gcc 4.8.0

Alex and happy use CPP to generate some internal template files, but the code
is unprepared for the output from CPP 4.8.0, which generates LINE pragmas that
contain more information than they thought it would.
This commit is contained in:
Peter Simons 2013-04-19 14:14:40 +02:00
parent 4914e63a89
commit 2b56b020c7
10 changed files with 32 additions and 0 deletions

View File

@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
isExecutable = true;
buildTools = [ perl ];
doCheck = false;
patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
meta = {
homepage = "http://www.haskell.org/alex/";
description = "Alex is a tool for generating lexical analysers in Haskell";

View File

@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
isExecutable = true;
buildTools = [ perl ];
doCheck = false;
patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
meta = {
homepage = "http://www.haskell.org/alex/";
description = "Alex is a tool for generating lexical analysers in Haskell";

View File

@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
isExecutable = true;
buildTools = [ perl ];
doCheck = false;
patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
meta = {
homepage = "http://www.haskell.org/alex/";
description = "Alex is a tool for generating lexical analysers in Haskell";

View File

@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
isExecutable = true;
buildTools = [ perl ];
doCheck = false;
patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
meta = {
homepage = "http://www.haskell.org/alex/";
description = "Alex is a tool for generating lexical analysers in Haskell";

View File

@ -0,0 +1,12 @@
diff -ubr alex-2.3.5-orig/Setup.lhs alex-2.3.5/Setup.lhs
--- alex-2.3.5-orig/Setup.lhs 2013-04-19 12:00:15.812606335 +0000
+++ alex-2.3.5/Setup.lhs 2013-04-19 12:05:41.635450321 +0000
@@ -25,7 +25,7 @@
-- hack to turn cpp-style '# 27 "GenericTemplate.hs"' into
-- '{-# LINE 27 "GenericTemplate.hs" #-}'.
crazy_perl_regexp =
- "s/^#\\s+(\\d+)\\s+(\"[^\"]*\")/{-# LINE \\1 \\2 #-}/g;s/\\$(Id:.*)\\$/\\1/g"
+ "s/^#\\s+(\\d+)\\s+(\"[^\"]*\").*/{-# LINE \\1 \\2 #-}/g;s/\\$(Id:.*)\\$/\\1/g"
myPostBuild _ flags _ lbi = do
let runProgram p = rawSystemProgramConf (buildVerbose flags) p (withPrograms lbi)

View File

@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
isExecutable = true;
buildDepends = [ mtl ];
buildTools = [ perl ];
patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
meta = {
homepage = "http://www.haskell.org/happy/";
description = "Happy is a parser generator for Haskell";

View File

@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
isExecutable = true;
buildDepends = [ mtl ];
buildTools = [ perl ];
patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
meta = {
homepage = "http://www.haskell.org/happy/";
description = "Happy is a parser generator for Haskell";

View File

@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
isExecutable = true;
buildDepends = [ mtl ];
buildTools = [ perl ];
patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
meta = {
homepage = "http://www.haskell.org/happy/";
description = "Happy is a parser generator for Haskell";

View File

@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
isExecutable = true;
buildDepends = [ mtl ];
buildTools = [ perl ];
patches = [ ./adapt-crazy-perl-regex-for-cpp-4.8.0.patch ];
meta = {
homepage = "http://www.haskell.org/happy/";
description = "Happy is a parser generator for Haskell";

View File

@ -0,0 +1,12 @@
diff -ubr happy-1.18.6-orig/Setup.lhs happy-1.18.6/Setup.lhs
--- happy-1.18.6-orig/Setup.lhs 2013-04-19 14:17:10.865999210 +0200
+++ happy-1.18.6/Setup.lhs 2013-04-19 14:17:15.285214809 +0200
@@ -25,7 +25,7 @@
-- hack to turn cpp-style '# 27 "GenericTemplate.hs"' into
-- '{-# LINE 27 "GenericTemplate.hs" #-}'.
crazy_perl_regexp =
- "s/^#\\s+(\\d+)\\s+(\"[^\"]*\")/{-# LINE \\1 \\2 #-}/g;s/\\$(Id:.*)\\$/\\1/g"
+ "s/^#\\s+(\\d+)\\s+(\"[^\"]*\").*/{-# LINE \\1 \\2 #-}/g;s/\\$(Id:.*)\\$/\\1/g"
myPostBuild _ flags _ lbi = do
let runProgram p = rawSystemProgramConf (buildVerbose flags) p (withPrograms lbi)