add fix-bang-pattern.diff patch from Debian to fix build on ppc

epel9
Jens Petersen 13 years ago
parent 31ca8edfec
commit 328d974755

@ -0,0 +1,53 @@
# Author : Erik de Castro Lopo <erikd@mega-nerd.com>
# Description : Fix generated haskell code so it doesn't fail with -Werror.
# Debian Version : 2.3.5
# Date : Sun, 17 Apr 2011 15:45:41 +1000
--- a/templates/GenericTemplate.hs
+++ b/templates/GenericTemplate.hs
@@ -9,7 +9,7 @@
#ifdef ALEX_GHC
#define ILIT(n) n#
-#define FAST_INT_BINDING(n) (n)
+#define FAST_INT_BINDING(n) (!(n))
#define IBOX(n) (I# (n))
#define FAST_INT Int#
#define LT(n,m) (n <# m)
@@ -57,10 +57,10 @@
ALEX_IF_BIGENDIAN
narrow16Int# i
where
- i = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low)
- high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))
- low = int2Word# (ord# (indexCharOffAddr# arr off'))
- off' = off *# 2#
+ !i = word2Int# ((high `uncheckedShiftL#` 8#) `or#` low)
+ !high = int2Word# (ord# (indexCharOffAddr# arr (off' +# 1#)))
+ !low = int2Word# (ord# (indexCharOffAddr# arr off'))
+ !off' = off *# 2#
ALEX_ELSE
indexInt16OffAddr# arr off
ALEX_ENDIF
--- a/src/Scan.x
+++ b/src/Scan.x
@@ -11,7 +11,7 @@
-------------------------------------------------------------------------------
{
-{-# OPTIONS_GHC -w #-}
+{-# OPTIONS_GHC -w -XBangPatterns #-}
module Scan(lexer, AlexPosn(..), Token(..), Tkn(..), tokPosn) where
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -203,7 +203,7 @@
hPutStrLn hdl code
optsToInject :: Target -> [CLIFlags] -> String
-optsToInject GhcTarget _ = "{-# LANGUAGE CPP,MagicHash #-}\n"
+optsToInject GhcTarget _ = "{-# LANGUAGE CPP,MagicHash,BangPatterns #-}\n"
optsToInject _ _ = "{-# LANGUAGE CPP #-}\n"
importsToInject :: Target -> [CLIFlags] -> String

@ -1,7 +1,7 @@
Name: alex
# part of haskell-platform
Version: 3.0.1
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A lexer generator for Haskell
Group: Development/Tools
@ -13,6 +13,7 @@ BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
BuildRequires: autoconf docbook-style-xsl libxslt
BuildRequires: ghc-QuickCheck-devel
Patch1: alex-ghc74-fix-bang-pattern.patch
%description
Alex is a tool for generating lexical analysers in Haskell, given a
@ -22,6 +23,9 @@ expressions. It is similar to the tool lex or flex for C/C++.
%prep
%setup -q
%ifarch ppc
%patch1 -p1 -b .orig
%endif
%build
@ -45,6 +49,9 @@ cd ..
%changelog
* Wed Jun 6 2012 Jens Petersen <petersen@redhat.com> - 3.0.1-2
- add fix-bang-pattern.diff patch from Debian to fix build on ppc
* Tue Mar 20 2012 Jens Petersen <petersen@redhat.com> - 3.0.1-1
- update to 3.0.1
- depends on QuickCheck

Loading…
Cancel
Save