[arch-commits] Commit in haskell-language-c/repos (3 files)

Felix Yan felixonmars at archlinux.org
Sun Nov 26 09:22:45 UTC 2017


    Date: Sunday, November 26, 2017 @ 09:22:43
  Author: felixonmars
Revision: 268864

archrelease: copy trunk to community-staging-x86_64

Added:
  haskell-language-c/repos/community-staging-x86_64/
  haskell-language-c/repos/community-staging-x86_64/PKGBUILD
    (from rev 268863, haskell-language-c/trunk/PKGBUILD)
  haskell-language-c/repos/community-staging-x86_64/float128.patch
    (from rev 268863, haskell-language-c/trunk/float128.patch)

----------------+
 PKGBUILD       |   50 ++++++++++++++++
 float128.patch |  171 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 221 insertions(+)

Copied: haskell-language-c/repos/community-staging-x86_64/PKGBUILD (from rev 268863, haskell-language-c/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2017-11-26 09:22:43 UTC (rev 268864)
@@ -0,0 +1,50 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
+
+_hkgname=language-c
+pkgname=haskell-language-c
+pkgver=0.6.1
+pkgrel=8
+pkgdesc="Analysis and generation of C code"
+url="http://visq.github.io/language-c/"
+license=("custom:BSD3")
+arch=('x86_64')
+depends=('ghc-libs' "haskell-syb")
+makedepends=('happy' 'alex' 'ghc')
+source=("https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz"
+        float128.patch)
+sha512sums=('e20711aaf4206fedd8dbd37b0093f0b7cda1ea67971f05875cd895949cd892f1e10a9d554880508781a37323386c043742219377d0de5b1a27748b4cc8d183dc'
+            '71498a0578c7f318d2d62e652c5498d60895a9b480a31e3b4629e66d33bd4c0e55502b72d077ce1411722b102375420349fc3ccfe80fc9cc10a64e6394f32df6')
+
+prepare() {
+    cd $_hkgname-$pkgver
+    # https://github.com/visq/language-c/pull/33
+    patch -p1 -i ../float128.patch
+}
+
+build() {
+    cd "${srcdir}/${_hkgname}-${pkgver}"
+
+    rm -fr dist
+
+    runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
+        --prefix=/usr --docdir="/usr/share/doc/${pkgname}" \
+        --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid \
+            -fseparatesyb -fusebytestrings -fsplitbase
+    runhaskell Setup build
+    runhaskell Setup register --gen-script
+    runhaskell Setup unregister --gen-script
+    sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
+    sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
+}
+
+package() {
+    cd "${srcdir}/${_hkgname}-${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"
+    runhaskell Setup copy --destdir="${pkgdir}"
+    install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+    rm -f "${pkgdir}/usr/share/doc/${pkgname}/LICENSE"
+}

Copied: haskell-language-c/repos/community-staging-x86_64/float128.patch (from rev 268863, haskell-language-c/trunk/float128.patch)
===================================================================
--- community-staging-x86_64/float128.patch	                        (rev 0)
+++ community-staging-x86_64/float128.patch	2017-11-26 09:22:43 UTC (rev 268864)
@@ -0,0 +1,171 @@
+From a53a3225bfd588e1a9b2cd00c5e4d0fe2c9bb2f1 Mon Sep 17 00:00:00 2001
+From: Fangrui Song <i at maskray.me>
+Date: Sun, 21 May 2017 14:23:49 -0700
+Subject: [PATCH] Add __float128
+
+`stddef.h` shipped by GCC 7.1.0 [1] adds when `__i386__` is defined.  This change breaks a lot packages depending on c2hs (which in turn depends on language-c).
+
+[1]: https://github.com/gcc-mirror/gcc/commit/9b5c49ef97e63cc63f1ffa13baf771368105ebe2
+---
+ README                          | 3 +--
+ src/Language/C/Parser/Lexer.x   | 6 ++++--
+ src/Language/C/Parser/Parser.y  | 2 ++
+ src/Language/C/Parser/Tokens.hs | 3 +++
+ src/Language/C/Pretty.hs        | 1 +
+ src/Language/C/Syntax/AST.hs    | 5 +++++
+ 6 files changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/README b/README
+index 9ea1084..2a4bf71 100644
+--- a/README
++++ b/README
+@@ -33,7 +33,6 @@ Currently unsupported C11 constructs:
+ 
+ Currently unsupported GNU C extensions:
+  - __auto_type
+- - __float128
+  - __builtin_offsetof
+    char a[__builtin_offsetof (struct S, sa->f)
+  - _Decimal32
+@@ -54,4 +53,4 @@ A couple of small examples are available in /examples
+ A couple of regression tests can be run via
+ > cd test/harness; make
+ 
+-For more tests, see test/README.
+\ No newline at end of file
++For more tests, see test/README.
+diff --git a/src/Language/C/Parser/Lexer.x b/src/Language/C/Parser/Lexer.x
+index 54f918e..ebebc29 100644
+--- a/src/Language/C/Parser/Lexer.x
++++ b/src/Language/C/Parser/Lexer.x
+@@ -119,7 +119,8 @@ $infname  = . # [ \\ \" ]             -- valid character in a filename
+ @hexmant   = @hexdigits?\. at hexdigits|@hexdigits\.
+ @binexp    = [pP][\+\-]?@digits
+ 
+- at floatsuffix    = [fFlL]
++-- Suffixes `qQwW` are GNU floating type extensions: <https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html>
++ at floatsuffix    = [fFlLqQwW]
+ @floatgnusuffix = @floatsuffix at gnusuffix?|@gnusuffix at floatsuffix?
+ 
+ -- clang version literals with a major.minor.rev
+@@ -297,7 +298,7 @@ label __label__
+ (CTokGnuC GnuCOffsetof) __builtin_offsetof
+ (CTokGnuC GnuCTyCompat) __builtin_types_compatible_p
+ -}
+--- Tokens: _Alignas _Alignof __alignof alignof __alignof__ __asm asm __asm__ _Atomic auto break _Bool case char __const const __const__ continue _Complex __complex__ default do double else enum extern float for _Generic goto if __inline inline __inline__ int __int128 long _Noreturn  _Nullable __nullable _Nonnull __nonnull register __restrict restrict __restrict__ return short __signed signed __signed__ sizeof static _Static_assert struct switch typedef __typeof typeof __typeof__ __thread _Thread_local union unsigned void __volatile volatile __volatile__ while __label__ __attribute __attribute__ __extension__ __real __real__ __imag __imag__ __builtin_va_arg __builtin_offsetof __builtin_types_compatible_p
++-- Tokens: _Alignas _Alignof __alignof alignof __alignof__ __asm asm __asm__ _Atomic auto break _Bool case char __const const __const__ continue _Complex __complex__ default do double else enum extern float __float128 for _Generic goto if __inline inline __inline__ int __int128 long _Noreturn  _Nullable __nullable _Nonnull __nonnull register __restrict restrict __restrict__ return short __signed signed __signed__ sizeof static _Static_assert struct switch typedef __typeof typeof __typeof__ __thread _Thread_local union unsigned void __volatile volatile __volatile__ while __label__ __attribute __attribute__ __extension__ __real __real__ __imag __imag__ __builtin_va_arg __builtin_offsetof __builtin_types_compatible_p
+ idkwtok ('_' : 'A' : 'l' : 'i' : 'g' : 'n' : 'a' : 's' : []) = tok 8 CTokAlignas
+ idkwtok ('_' : 'A' : 'l' : 'i' : 'g' : 'n' : 'o' : 'f' : []) = tok 8 CTokAlignof
+ idkwtok ('_' : 'A' : 't' : 'o' : 'm' : 'i' : 'c' : []) = tok 7 CTokAtomic
+@@ -337,6 +338,7 @@ idkwtok ('e' : 'n' : 'u' : 'm' : []) = tok 4 CTokEnum
+ idkwtok ('_' : '_' : 'e' : 'x' : 't' : 'e' : 'n' : 's' : 'i' : 'o' : 'n' : '_' : '_' : []) = tok 13 (CTokGnuC GnuCExtTok)
+ idkwtok ('e' : 'x' : 't' : 'e' : 'r' : 'n' : []) = tok 6 CTokExtern
+ idkwtok ('f' : 'l' : 'o' : 'a' : 't' : []) = tok 5 CTokFloat
++idkwtok ('_' : '_' : 'f' : 'l' : 'o' : 'a' : 't' : '1' : '2' : '8' : []) = tok 10 CTokFloat128
+ idkwtok ('f' : 'o' : 'r' : []) = tok 3 CTokFor
+ idkwtok ('g' : 'o' : 't' : 'o' : []) = tok 4 CTokGoto
+ idkwtok ('i' : 'f' : []) = tok 2 CTokIf
+diff --git a/src/Language/C/Parser/Parser.y b/src/Language/C/Parser/Parser.y
+index 9b40bf6..dfe6de0 100644
+--- a/src/Language/C/Parser/Parser.y
++++ b/src/Language/C/Parser/Parser.y
+@@ -201,6 +201,7 @@ else		{ CTokElse	_ }
+ enum		{ CTokEnum	_ }
+ extern		{ CTokExtern	_ }
+ float		{ CTokFloat	_ }
++"__float128"	{ CTokFloat128	_ }
+ for		{ CTokFor	_ }
+ "_Generic"      { CTokGeneric   _ }
+ goto		{ CTokGoto	_ }
+@@ -872,6 +873,7 @@ basic_type_name
+   | "_Bool"			{% withNodeInfo $1 $ CBoolType }
+   | "_Complex"			{% withNodeInfo $1 $ CComplexType }
+   | "__int128"      {% withNodeInfo $1 $ CInt128Type }
++  | "__float128"      {% withNodeInfo $1 $ CFloat128Type }
+ 
+ 
+ -- A mixture of type qualifiers, storage class and basic type names in any
+diff --git a/src/Language/C/Parser/Tokens.hs b/src/Language/C/Parser/Tokens.hs
+index f9b6c1a..be5013e 100644
+--- a/src/Language/C/Parser/Tokens.hs
++++ b/src/Language/C/Parser/Tokens.hs
+@@ -92,6 +92,7 @@ data CToken = CTokLParen   !PosLength            -- `('
+             | CTokEnum     !PosLength            -- `enum'
+             | CTokExtern   !PosLength            -- `extern'
+             | CTokFloat    !PosLength            -- `float'
++            | CTokFloat128 !PosLength            -- `__float128'
+             | CTokFor      !PosLength            -- `for'
+             | CTokGeneric  !PosLength            -- `_Generic'
+             | CTokGoto     !PosLength            -- `goto'
+@@ -224,6 +225,7 @@ posLenOfTok (CTokElse     pos  ) = pos
+ posLenOfTok (CTokEnum     pos  ) = pos
+ posLenOfTok (CTokExtern   pos  ) = pos
+ posLenOfTok (CTokFloat    pos  ) = pos
++posLenOfTok (CTokFloat128 pos  ) = pos
+ posLenOfTok (CTokFor      pos  ) = pos
+ posLenOfTok (CTokGeneric  pos  ) = pos
+ posLenOfTok (CTokGoto     pos  ) = pos
+@@ -330,6 +332,7 @@ instance Show CToken where
+   showsPrec _ (CTokEnum     _  ) = showString "enum"
+   showsPrec _ (CTokExtern   _  ) = showString "extern"
+   showsPrec _ (CTokFloat    _  ) = showString "float"
++  showsPrec _ (CTokFloat128 _  ) = showString "__float128"
+   showsPrec _ (CTokFor      _  ) = showString "for"
+   showsPrec _ (CTokGeneric  _  ) = showString "_Generic"
+   showsPrec _ (CTokGoto     _  ) = showString "goto"
+diff --git a/src/Language/C/Pretty.hs b/src/Language/C/Pretty.hs
+index b7ce31e..aa32d5b 100644
+--- a/src/Language/C/Pretty.hs
++++ b/src/Language/C/Pretty.hs
+@@ -244,6 +244,7 @@ instance Pretty CTypeSpec where
+     pretty (CIntType _)         = text "int"
+     pretty (CLongType _)        = text "long"
+     pretty (CFloatType _)       = text "float"
++    pretty (CFloat128Type _)    = text "__float128"
+     pretty (CDoubleType _)      = text "double"
+     pretty (CSignedType _)      = text "signed"
+     pretty (CUnsigType _)       = text "unsigned"
+diff --git a/src/Language/C/Syntax/AST.hs b/src/Language/C/Syntax/AST.hs
+index 39ea2e5..b257b7e 100644
+--- a/src/Language/C/Syntax/AST.hs
++++ b/src/Language/C/Syntax/AST.hs
+@@ -434,6 +434,7 @@ data CTypeSpecifier a
+   | CIntType     a
+   | CLongType    a
+   | CFloatType   a
++  | CFloat128Type a
+   | CDoubleType  a
+   | CSignedType  a
+   | CUnsigType   a
+@@ -1028,6 +1029,7 @@ instance CNode t1 => CNode (CTypeSpecifier t1) where
+         nodeInfo (CIntType d) = nodeInfo d
+         nodeInfo (CLongType d) = nodeInfo d
+         nodeInfo (CFloatType d) = nodeInfo d
++        nodeInfo (CFloat128Type d) = nodeInfo d
+         nodeInfo (CDoubleType d) = nodeInfo d
+         nodeInfo (CSignedType d) = nodeInfo d
+         nodeInfo (CUnsigType d) = nodeInfo d
+@@ -1050,6 +1052,7 @@ instance Functor CTypeSpecifier where
+         fmap _f (CIntType a1) = CIntType (_f a1)
+         fmap _f (CLongType a1) = CLongType (_f a1)
+         fmap _f (CFloatType a1) = CFloatType (_f a1)
++        fmap _f (CFloat128Type a1) = CFloat128Type (_f a1)
+         fmap _f (CDoubleType a1) = CDoubleType (_f a1)
+         fmap _f (CSignedType a1) = CSignedType (_f a1)
+         fmap _f (CUnsigType a1) = CUnsigType (_f a1)
+@@ -1070,6 +1073,7 @@ instance Annotated CTypeSpecifier where
+         annotation (CIntType n) = n
+         annotation (CLongType n) = n
+         annotation (CFloatType n) = n
++        annotation (CFloat128Type n) = n
+         annotation (CDoubleType n) = n
+         annotation (CSignedType n) = n
+         annotation (CUnsigType n) = n
+@@ -1088,6 +1092,7 @@ instance Annotated CTypeSpecifier where
+         amap f (CIntType a_1) = CIntType (f a_1)
+         amap f (CLongType a_1) = CLongType (f a_1)
+         amap f (CFloatType a_1) = CFloatType (f a_1)
++        amap f (CFloat128Type a_1) = CFloat128Type (f a_1)
+         amap f (CDoubleType a_1) = CDoubleType (f a_1)
+         amap f (CSignedType a_1) = CSignedType (f a_1)
+         amap f (CUnsigType a_1) = CUnsigType (f a_1)


More information about the arch-commits mailing list