From 2b56b020c7e68727e6ffcd15818802076e608fc1 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Fri, 19 Apr 2013 14:14:40 +0200 Subject: [PATCH] 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. --- pkgs/development/tools/parsing/alex/2.3.1.nix | 1 + pkgs/development/tools/parsing/alex/2.3.2.nix | 1 + pkgs/development/tools/parsing/alex/2.3.3.nix | 1 + pkgs/development/tools/parsing/alex/2.3.5.nix | 1 + .../alex/adapt-crazy-perl-regex-for-cpp-4.8.0.patch | 12 ++++++++++++ pkgs/development/tools/parsing/happy/1.18.4.nix | 1 + pkgs/development/tools/parsing/happy/1.18.5.nix | 1 + pkgs/development/tools/parsing/happy/1.18.6.nix | 1 + pkgs/development/tools/parsing/happy/1.18.8.nix | 1 + .../happy/adapt-crazy-perl-regex-for-cpp-4.8.0.patch | 12 ++++++++++++ 10 files changed, 32 insertions(+) create mode 100644 pkgs/development/tools/parsing/alex/adapt-crazy-perl-regex-for-cpp-4.8.0.patch create mode 100644 pkgs/development/tools/parsing/happy/adapt-crazy-perl-regex-for-cpp-4.8.0.patch diff --git a/pkgs/development/tools/parsing/alex/2.3.1.nix b/pkgs/development/tools/parsing/alex/2.3.1.nix index 92db61e08a2..7be36a2bf3c 100644 --- a/pkgs/development/tools/parsing/alex/2.3.1.nix +++ b/pkgs/development/tools/parsing/alex/2.3.1.nix @@ -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"; diff --git a/pkgs/development/tools/parsing/alex/2.3.2.nix b/pkgs/development/tools/parsing/alex/2.3.2.nix index 2ec395d463f..d05daf83ee0 100644 --- a/pkgs/development/tools/parsing/alex/2.3.2.nix +++ b/pkgs/development/tools/parsing/alex/2.3.2.nix @@ -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"; diff --git a/pkgs/development/tools/parsing/alex/2.3.3.nix b/pkgs/development/tools/parsing/alex/2.3.3.nix index 920c5fd9cc2..fe8ed57189d 100644 --- a/pkgs/development/tools/parsing/alex/2.3.3.nix +++ b/pkgs/development/tools/parsing/alex/2.3.3.nix @@ -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"; diff --git a/pkgs/development/tools/parsing/alex/2.3.5.nix b/pkgs/development/tools/parsing/alex/2.3.5.nix index 3635b248787..366988d8d14 100644 --- a/pkgs/development/tools/parsing/alex/2.3.5.nix +++ b/pkgs/development/tools/parsing/alex/2.3.5.nix @@ -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"; diff --git a/pkgs/development/tools/parsing/alex/adapt-crazy-perl-regex-for-cpp-4.8.0.patch b/pkgs/development/tools/parsing/alex/adapt-crazy-perl-regex-for-cpp-4.8.0.patch new file mode 100644 index 00000000000..1e5942bfbef --- /dev/null +++ b/pkgs/development/tools/parsing/alex/adapt-crazy-perl-regex-for-cpp-4.8.0.patch @@ -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) diff --git a/pkgs/development/tools/parsing/happy/1.18.4.nix b/pkgs/development/tools/parsing/happy/1.18.4.nix index cc5c60a3d43..12eb1837635 100644 --- a/pkgs/development/tools/parsing/happy/1.18.4.nix +++ b/pkgs/development/tools/parsing/happy/1.18.4.nix @@ -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"; diff --git a/pkgs/development/tools/parsing/happy/1.18.5.nix b/pkgs/development/tools/parsing/happy/1.18.5.nix index 41532651c99..5cee8d7fc78 100644 --- a/pkgs/development/tools/parsing/happy/1.18.5.nix +++ b/pkgs/development/tools/parsing/happy/1.18.5.nix @@ -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"; diff --git a/pkgs/development/tools/parsing/happy/1.18.6.nix b/pkgs/development/tools/parsing/happy/1.18.6.nix index 60b8d253659..c50eee13fd0 100644 --- a/pkgs/development/tools/parsing/happy/1.18.6.nix +++ b/pkgs/development/tools/parsing/happy/1.18.6.nix @@ -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"; diff --git a/pkgs/development/tools/parsing/happy/1.18.8.nix b/pkgs/development/tools/parsing/happy/1.18.8.nix index b1ba0b165dd..1caf80a94bd 100644 --- a/pkgs/development/tools/parsing/happy/1.18.8.nix +++ b/pkgs/development/tools/parsing/happy/1.18.8.nix @@ -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"; diff --git a/pkgs/development/tools/parsing/happy/adapt-crazy-perl-regex-for-cpp-4.8.0.patch b/pkgs/development/tools/parsing/happy/adapt-crazy-perl-regex-for-cpp-4.8.0.patch new file mode 100644 index 00000000000..8bc4db0f405 --- /dev/null +++ b/pkgs/development/tools/parsing/happy/adapt-crazy-perl-regex-for-cpp-4.8.0.patch @@ -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)