[arch-commits] Commit in haskell-gtk2hs-buildtools/trunk (PKGBUILD gcc-11.patch)

Felix Yan felixonmars at archlinux.org
Fri May 14 13:39:06 UTC 2021


    Date: Friday, May 14, 2021 @ 13:39:05
  Author: felixonmars
Revision: 933977

upgpkg: haskell-gtk2hs-buildtools 0.13.8.0-99: add a patch for gcc-11

Added:
  haskell-gtk2hs-buildtools/trunk/gcc-11.patch
Modified:
  haskell-gtk2hs-buildtools/trunk/PKGBUILD

--------------+
 PKGBUILD     |   17 ++++++++++++-----
 gcc-11.patch |   37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 5 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-05-14 12:42:51 UTC (rev 933976)
+++ PKGBUILD	2021-05-14 13:39:05 UTC (rev 933977)
@@ -2,7 +2,7 @@
 
 pkgname=haskell-gtk2hs-buildtools
 pkgver=0.13.8.0
-pkgrel=98
+pkgrel=99
 pkgdesc="Tools to build the Gtk2Hs suite of User Interface libraries."
 url="https://hackage.haskell.org/package/gtk2hs-buildtools"
 license=('GPL2')
@@ -12,11 +12,18 @@
 provides=('gtk2hs-buildtools')
 conflicts=('gtk2hs-buildtools')
 replaces=('gtk2hs-buildtools')
-source=("https://hackage.haskell.org/packages/archive/gtk2hs-buildtools/${pkgver}/gtk2hs-buildtools-${pkgver}.tar.gz")
-sha512sums=('fa427979f20f10ca8baf38c80c28a5190d18b767046de347950ea799660e1d54939d668c01c469da36d2df6c347f7ba67e2e85f3a7000021f8d37852093e03fd')
+source=("https://hackage.haskell.org/packages/archive/gtk2hs-buildtools/${pkgver}/gtk2hs-buildtools-${pkgver}.tar.gz"
+        gcc-11.patch)
+sha512sums=('fa427979f20f10ca8baf38c80c28a5190d18b767046de347950ea799660e1d54939d668c01c469da36d2df6c347f7ba67e2e85f3a7000021f8d37852093e03fd'
+            'd7e2c4b9bb8ef71f4f2deda6e81aa1b7a0e5bc5f534334513fcd95be6386448b8c1516224be421f450f16e1efbc10aaeba30f485cb5f3a1c31ac2e3aa435733b')
 
+prepare() {
+    cd gtk2hs-buildtools-$pkgver
+    patch -p2 -i ../gcc-11.patch
+}
+
 build() {
-    cd "${srcdir}/gtk2hs-buildtools-${pkgver}"
+    cd gtk2hs-buildtools-$pkgver
 
     runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
         --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir="$pkgname" \
@@ -29,7 +36,7 @@
 }
 
 package() {
-    cd "${srcdir}/gtk2hs-buildtools-${pkgver}"
+    cd gtk2hs-buildtools-$pkgver
 
     install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
     install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh

Added: gcc-11.patch
===================================================================
--- gcc-11.patch	                        (rev 0)
+++ gcc-11.patch	2021-05-14 13:39:05 UTC (rev 933977)
@@ -0,0 +1,37 @@
+commit f4e880b934a2ddcb7f65a68185a84043f2f152a7
+Author: Felix Yan <felixonmars at archlinux.org>
+Date:   Fri May 14 21:28:55 2021 +0800
+
+    CLexer: 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.
+    
+    Backported from https://github.com/visq/language-c/commit/8133e1526750ab74ca4d5180fb140a7e172d473f
+
+diff --git a/tools/c2hs/c/CLexer.x b/tools/c2hs/c/CLexer.x
+index 0099af5c..9ed0bfba 100644
+--- a/tools/c2hs/c/CLexer.x
++++ b/tools/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)



More information about the arch-commits mailing list