commit:     885d1e4a0d09e6316a0c98fa8c983751fb0864a7
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 15 19:32:10 2021 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Mon Mar 15 22:32:52 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=885d1e4a

dev-haskell/gtk2hs-buildtools: allow gcc-11

Package-Manager: Portage-3.0.17, Repoman-3.0.2
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 .../files/gtk2hs-buildtools-0.13.8.0-gcc-11.patch  | 32 +++++++++++++++++++
 .../gtk2hs-buildtools-0.13.8.0-r1.ebuild           | 37 ++++++++++++++++++++++
 2 files changed, 69 insertions(+)

diff --git 
a/dev-haskell/gtk2hs-buildtools/files/gtk2hs-buildtools-0.13.8.0-gcc-11.patch 
b/dev-haskell/gtk2hs-buildtools/files/gtk2hs-buildtools-0.13.8.0-gcc-11.patch
new file mode 100644
index 00000000000..123c1359ff1
--- /dev/null
+++ 
b/dev-haskell/gtk2hs-buildtools/files/gtk2hs-buildtools-0.13.8.0-gcc-11.patch
@@ -0,0 +1,32 @@
+Same fix as https://github.com/visq/language-c/issues/74
+
+"""
+Lexer: allow zeros as line numbers in preprocessed directives
+
+Starting from `gcc-11` initial line numbers not related to
+actual files are marked as zeros. See the "preprocessor:
+Better line info for <builtin> & <command-line>"
+https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=6bf2ff0d52a9
+
+language-c's grammar did not allow it (by accident)
+
+```
+Prelude> Language.C.parseC (Data.ByteString.Char8.pack "# 0 \"/dev/null\"\n") 
Language.C.nopos
+Left <no file>:: [ERROR]  >>> Syntax Error !
+  Lexical error !
+  The character '#' does not fit here.
+```
+
+The change allows '0' in line numbers as well.
+"""
+--- a/c2hs/c/CLexer.x
++++ b/c2hs/c/CLexer.x
+@@ -130,7 +130,7 @@ $white+                                    ;
+ --  * allows further ints after the file name a la GCC; as the GCC CPP docu
+ --   doesn't say how many ints there can be, we allow an unbound number
+ --
+-\#$space*@int$space*(\"($infname|@charesc)*\"$space*)?(@int$space*)*$eol
++\#$space*@digits$space*(\"($infname|@charesc)*\"$space*)?(@int$space*)*$eol
+   { \pos len str -> setPos (adjustPos (take len str) pos) >> lexToken }
+ 
+ -- #pragma directive (K&R A12.8)

diff --git a/dev-haskell/gtk2hs-buildtools/gtk2hs-buildtools-0.13.8.0-r1.ebuild 
b/dev-haskell/gtk2hs-buildtools/gtk2hs-buildtools-0.13.8.0-r1.ebuild
new file mode 100644
index 00000000000..30ffca890e9
--- /dev/null
+++ b/dev-haskell/gtk2hs-buildtools/gtk2hs-buildtools-0.13.8.0-r1.ebuild
@@ -0,0 +1,37 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+# ebuild generated by hackport 0.6.4
+
+CABAL_FEATURES="lib profile haddock hoogle hscolour"
+inherit haskell-cabal
+
+DESCRIPTION="Tools to build the Gtk2Hs suite of User Interface libraries"
+HOMEPAGE="http://projects.haskell.org/gtk2hs/";
+SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz";
+
+LICENSE="GPL-2"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="+closuresignals"
+
+RDEPEND=">=dev-haskell/cabal-1.24.0.0:=[profile?]
+       dev-haskell/fail:=[profile?]
+       dev-haskell/hashtables:=[profile?]
+       dev-haskell/random:=[profile?]
+       >=dev-lang/ghc-7.8.2:=
+"
+DEPEND="${RDEPEND}
+       dev-haskell/alex
+       >=dev-haskell/cabal-1.18.1.3
+       dev-haskell/happy
+"
+
+PATCHES=("${FILESDIR}"/${PN}-0.13.8.0-gcc-11.patch)
+
+src_configure() {
+       haskell-cabal_src_configure \
+               $(cabal_flag closuresignals closuresignals)
+}

Reply via email to