1 |
commit: 62c95511627bb27be1f5eca75a78d7ddbfdccfb1 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 25 23:23:57 2015 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 25 23:24:15 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62c95511 |
7 |
|
8 |
dev-haskell/gtk2hs-buildtools: add support for '__builtin_offsetof (struct sigcontext, sc_gr[0])', bug #498638 |
9 |
|
10 |
Bug: https://bugs.gentoo.org/498638 |
11 |
|
12 |
Package-Manager: portage-2.2.20 |
13 |
|
14 |
.../files/gtk2hs-buildtools-0.13.0.4-ia64.patch | 47 ++++++++++++++++++++++ |
15 |
.../gtk2hs-buildtools-0.13.0.4-r3.ebuild | 38 +++++++++++++++++ |
16 |
2 files changed, 85 insertions(+) |
17 |
|
18 |
diff --git a/dev-haskell/gtk2hs-buildtools/files/gtk2hs-buildtools-0.13.0.4-ia64.patch b/dev-haskell/gtk2hs-buildtools/files/gtk2hs-buildtools-0.13.0.4-ia64.patch |
19 |
new file mode 100644 |
20 |
index 0000000..3caf5f7 |
21 |
--- /dev/null |
22 |
+++ b/dev-haskell/gtk2hs-buildtools/files/gtk2hs-buildtools-0.13.0.4-ia64.patch |
23 |
@@ -0,0 +1,47 @@ |
24 |
+ia64 is is a special showflake. |
25 |
+ |
26 |
+Technically does nothing bad, |
27 |
+but it alone uses '__builtin_offsetof (struct sigcontext' |
28 |
+in system headers. c2hs does not handle that. |
29 |
+ |
30 |
+https://bugs.gentoo.org/498638 |
31 |
+diff --git a/c2hs/c/C.hs b/c2hs/c/C.hs |
32 |
+index f79b6d9..aa1b5e4 100644 |
33 |
+--- a/c2hs/c/C.hs |
34 |
++++ b/c2hs/c/C.hs |
35 |
+@@ -1 +1,2 @@ |
36 |
++{-# LANGUAGE CPP, PatternGuards #-} |
37 |
+ -- C->Haskell Compiler: interface to C processing routines |
38 |
+@@ -94,2 +95,20 @@ isuffix = ".i" |
39 |
+ |
40 |
++-- This stanza workarounds very specific limitation |
41 |
++-- of c2hs of not being able to expang __builtin_offsetof |
42 |
++-- used by all glib/gtk headers at least on ia64. |
43 |
++raw_mangle :: String -> String |
44 |
++raw_mangle s = case s of |
45 |
++ [] -> [] |
46 |
++#ifdef ia64_HOST_ARCH |
47 |
++ _ | Just (h, rest) <- chop_head "__builtin_offsetof (struct sigcontext, sc_gr[0])" |
48 |
++ "200" -- ia64/linux/glibc, sigh |
49 |
++ -> h ++ raw_mangle rest |
50 |
++#endif /* ia64_HOST_ARCH */ |
51 |
++ (h:t) -> h : raw_mangle t |
52 |
++ where chop_head prefix new_prefix = |
53 |
++ case splitAt p_len s of |
54 |
++ (h, t) | h == prefix -> Just (new_prefix, t) |
55 |
++ _ -> Nothing |
56 |
++ where p_len = length prefix |
57 |
++ |
58 |
+ -- given a file name (with suffix), parse that file as a C header and do the |
59 |
+@@ -106,3 +124,3 @@ loadAttrC fname = do |
60 |
+ traceInfoRead fname |
61 |
+- contents <- readFileCIO fname |
62 |
++ contents <- raw_mangle `fmap` readFileCIO fname |
63 |
+ |
64 |
+@@ -126,4 +144,4 @@ loadAttrC fname = do |
65 |
+ errmsgs <- showErrors |
66 |
+- fatal ("C header contains \ |
67 |
+- \errors:\n\n" ++ errmsgs) -- fatal error |
68 |
++ fatal ("C header contains " ++ |
69 |
++ "errors:\n\n" ++ errmsgs) -- fatal error |
70 |
+ else do |
71 |
|
72 |
diff --git a/dev-haskell/gtk2hs-buildtools/gtk2hs-buildtools-0.13.0.4-r3.ebuild b/dev-haskell/gtk2hs-buildtools/gtk2hs-buildtools-0.13.0.4-r3.ebuild |
73 |
new file mode 100644 |
74 |
index 0000000..8397870 |
75 |
--- /dev/null |
76 |
+++ b/dev-haskell/gtk2hs-buildtools/gtk2hs-buildtools-0.13.0.4-r3.ebuild |
77 |
@@ -0,0 +1,38 @@ |
78 |
+# Copyright 1999-2015 Gentoo Foundation |
79 |
+# Distributed under the terms of the GNU General Public License v2 |
80 |
+# $Id$ |
81 |
+ |
82 |
+EAPI=5 |
83 |
+ |
84 |
+# ebuild generated by hackport 0.4.5.9999 |
85 |
+ |
86 |
+CABAL_FEATURES="bin" |
87 |
+inherit haskell-cabal |
88 |
+ |
89 |
+DESCRIPTION="Tools to build the Gtk2Hs suite of User Interface libraries" |
90 |
+HOMEPAGE="http://projects.haskell.org/gtk2hs/" |
91 |
+SRC_URI="mirror://hackage/packages/archive/${PN}/${PV}/${P}.tar.gz" |
92 |
+ |
93 |
+LICENSE="GPL-2" |
94 |
+SLOT="0" |
95 |
+KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86" |
96 |
+IUSE="+closuresignals" |
97 |
+ |
98 |
+RDEPEND="dev-haskell/random:= |
99 |
+ >=dev-lang/ghc-7.4.1:= |
100 |
+ || ( ( >=dev-lang/ghc-7.7:= dev-haskell/hashtables:= ) <dev-lang/ghc-7.7:= ) |
101 |
+" |
102 |
+DEPEND="${RDEPEND} |
103 |
+ dev-haskell/alex |
104 |
+ >=dev-haskell/cabal-1.8 |
105 |
+ dev-haskell/happy |
106 |
+" |
107 |
+ |
108 |
+src_prepare() { |
109 |
+ epatch "${FILESDIR}"/${P}-ia64.patch |
110 |
+} |
111 |
+ |
112 |
+src_configure() { |
113 |
+ haskell-cabal_src_configure \ |
114 |
+ $(cabal_flag closuresignals closuresignals) |
115 |
+} |