Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Mar 2017 20:29:13 +0000 (UTC)
From:      "Tobias C. Berner" <tcberner@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r436914 - in head/devel: hs-c2hs hs-c2hs/files hs-gtk2hs-buildtools hs-gtk2hs-buildtools/files hs-ncurses hs-ncurses/files
Message-ID:  <201703252029.v2PKTD8Z069385@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tcberner
Date: Sat Mar 25 20:29:13 2017
New Revision: 436914
URL: https://svnweb.freebsd.org/changeset/ports/436914

Log:
  Fixup devel/hs-c2hs and devel/hs-gtk2hs-buildtools to pass -std=c99 to the preprocessor
  
  The ports using c2hs and gtk2hs fail to build with modern compilers as the c11 features of the FreeBSD system headers are not hidden, yet the tools only understand c99.
  * revert change to devel/hs-ncurses from r436451
  * patch devel/hs-c2hs to pass -std=c99.
  * patch devel/hs-gtk2-buildtools to pass -std=c99.
  
  This should fix compilation of
  * devel/hs-ncurses
  * dns/hs-gnuidn
  * graphics/hs-cairo
  * x11-toolkits/hs-vte
  * devel/hs-gconf
  
  PR:		216707
  Reviewed by:	rakuco
  Approved by:	portmgr (antoine)
  Differential Revision:	https://reviews.freebsd.org/D10081

Added:
  head/devel/hs-c2hs/files/
  head/devel/hs-c2hs/files/patch-src_C2HS_Config.hs   (contents, props changed)
  head/devel/hs-gtk2hs-buildtools/files/patch-c2hs_toplevel_C2HSConfig.hs   (contents, props changed)
Deleted:
  head/devel/hs-ncurses/files/
Modified:
  head/devel/hs-c2hs/Makefile
  head/devel/hs-gtk2hs-buildtools/Makefile
  head/devel/hs-gtk2hs-buildtools/files/patch-c2hs__c__CAST.hs
  head/devel/hs-ncurses/Makefile

Modified: head/devel/hs-c2hs/Makefile
==============================================================================
--- head/devel/hs-c2hs/Makefile	Sat Mar 25 19:25:13 2017	(r436913)
+++ head/devel/hs-c2hs/Makefile	Sat Mar 25 20:29:13 2017	(r436914)
@@ -3,6 +3,7 @@
 
 PORTNAME=	c2hs
 PORTVERSION=	0.28.1
+PORTREVISION=	1
 CATEGORIES=	devel haskell
 
 MAINTAINER=	haskell@FreeBSD.org

Added: head/devel/hs-c2hs/files/patch-src_C2HS_Config.hs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/hs-c2hs/files/patch-src_C2HS_Config.hs	Sat Mar 25 20:29:13 2017	(r436914)
@@ -0,0 +1,30 @@
+Hide the scary c11 features from c2hs, which does not understand them:
+
+gtk2hsC2hs: Error in C header file.
+/usr/include/sys/_types.h:104: (column 61) [FATAL]
+  >>> Syntax error!
+  The symbol `long' does not fit here.
+*** Error code 1
+
+--- src/C2HS/Config.hs.orig	2017-03-21 18:33:51 UTC
++++ src/C2HS/Config.hs
+@@ -56,14 +56,17 @@ cpp  = case os of
+ --   understood at least on Linux, FreeBSD, and Solaris and seems to make a
+ --   difference over the default language setting on FreeBSD
+ --
++-- * Pass -std=c99 as c2hs get's confused by the c11 parts in the FreeBSD
++--   system headers.
++--
+ -- * @-P@ would suppress @#line@ directives
+ --
+ cppopts :: [String]
+ cppopts  = case (os,cpp) of
+   -- why is gcc different between all these platforms?
+   ("openbsd","cpp") -> ["-xc"]
+-  (_,"cpp")         -> ["-x", "c"]
+-  (_,"gcc")         -> ["-E", "-x", "c"]
++  (_,"cpp")         -> ["-x", "c", "-std=c99"]
++  (_,"gcc")         -> ["-E", "-x", "c", "-std=c99"]
+   _                 -> []
+
+ -- | C2HS Library file name

Modified: head/devel/hs-gtk2hs-buildtools/Makefile
==============================================================================
--- head/devel/hs-gtk2hs-buildtools/Makefile	Sat Mar 25 19:25:13 2017	(r436913)
+++ head/devel/hs-gtk2hs-buildtools/Makefile	Sat Mar 25 20:29:13 2017	(r436914)
@@ -2,6 +2,7 @@
 
 PORTNAME=	gtk2hs-buildtools
 PORTVERSION=	0.13.0.4
+PORTREVISION=	1
 CATEGORIES=	devel haskell
 
 MAINTAINER=	haskell@FreeBSD.org

Modified: head/devel/hs-gtk2hs-buildtools/files/patch-c2hs__c__CAST.hs
==============================================================================
--- head/devel/hs-gtk2hs-buildtools/files/patch-c2hs__c__CAST.hs	Sat Mar 25 19:25:13 2017	(r436913)
+++ head/devel/hs-gtk2hs-buildtools/files/patch-c2hs__c__CAST.hs	Sat Mar 25 20:29:13 2017	(r436914)
@@ -1,6 +1,6 @@
---- ./c2hs/c/CAST.hs.orig	2012-11-12 00:26:43.000000000 +0100
-+++ ./c2hs/c/CAST.hs	2013-05-28 11:02:33.000000000 +0200
-@@ -1125,6 +1125,9 @@
+--- c2hs/c/CAST.hs.orig	2017-03-21 18:15:30 UTC
++++ c2hs/c/CAST.hs
+@@ -1125,6 +1125,9 @@ instance Binary CStorageSpec where
      put_ bh (CTypedef ae) = do
              putByte bh 4
              put_ bh ae
@@ -10,7 +10,7 @@
      get bh = do
              h <- getByte bh
              case h of
-@@ -1143,6 +1146,9 @@
+@@ -1143,6 +1146,9 @@ instance Binary CStorageSpec where
                4 -> do
                      ae <- get bh
                      return (CTypedef ae)

Added: head/devel/hs-gtk2hs-buildtools/files/patch-c2hs_toplevel_C2HSConfig.hs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/hs-gtk2hs-buildtools/files/patch-c2hs_toplevel_C2HSConfig.hs	Sat Mar 25 20:29:13 2017	(r436914)
@@ -0,0 +1,29 @@
+Hide the scary c11 features from c2hs, which does not understand them:
+
+c2hs: C header contains errors:
+/usr/include/sys/_types.h:104: (column 61) [ERROR]  >>> Syntax error !
+  The symbol `long' does not fit here.
+*** Error code 1
+
+--- c2hs/toplevel/C2HSConfig.hs.orig	2017-03-21 18:17:37 UTC
++++ c2hs/toplevel/C2HSConfig.hs
+@@ -64,14 +64,17 @@ cpp  = case os of
+ -- * `-x c' forces CPP to regard the input as C code; this option seems to be
+ --   understood at least on Linux, FreeBSD, and Solaris and seems to make a
+ --   difference over the default language setting on FreeBSD
++--
++-- * Pass -std=c99 as c2hs get's confused by the c11 parts in the FreeBSD
++--   system headers.
+ --
+ -- * `-P' would suppress `#line' directives
+ --
+ cppopts :: [String]
+ cppopts  = case (os,cpp) of
+   ("openbsd","cpp") -> ["-xc", "-w"]
+-  (_,"cpp")         -> ["-x", "c", "-w"]
+-  (_,"gcc")         -> ["-E", "-x", "c", "-w"]
++  (_,"cpp")         -> ["-x", "c", "-w", "-std=c99"]
++  (_,"gcc")         -> ["-E", "-x", "c", "-w", "-std=c99"]
+   _                 -> []
+
+ -- C preprocessor option for including only definitions (EXPORTED)

Modified: head/devel/hs-ncurses/Makefile
==============================================================================
--- head/devel/hs-ncurses/Makefile	Sat Mar 25 19:25:13 2017	(r436913)
+++ head/devel/hs-ncurses/Makefile	Sat Mar 25 20:29:13 2017	(r436914)
@@ -3,6 +3,7 @@
 
 PORTNAME=	ncurses
 PORTVERSION=	0.2.16
+PORTREVISION=	1
 CATEGORIES=	devel haskell
 
 MAINTAINER=	haskell@FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703252029.v2PKTD8Z069385>