Accepting request 324453 from devel:languages:haskell
1 OBS-URL: https://build.opensuse.org/request/show/324453 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/alex?expand=0&rev=9
This commit is contained in:
commit
0feeac419a
3
_service
3
_service
@ -1,3 +0,0 @@
|
|||||||
<services>
|
|
||||||
|
|
||||||
<service name="download_files" mode="localonly"/></services>
|
|
24
alex-3.1.4-ghc-7.10.patch
Normal file
24
alex-3.1.4-ghc-7.10.patch
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
diff --git a/templates/wrappers.hs b/templates/wrappers.hs
|
||||||
|
index a1a1a6d..c020cc7 100644
|
||||||
|
--- a/templates/wrappers.hs
|
||||||
|
+++ b/templates/wrappers.hs
|
||||||
|
@@ -284,6 +284,19 @@ runAlex input (Alex f)
|
||||||
|
|
||||||
|
newtype Alex a = Alex { unAlex :: AlexState -> Either String (AlexState, a) }
|
||||||
|
|
||||||
|
+instance Functor Alex where
|
||||||
|
+ fmap f a = Alex $ \s -> case unAlex a s of
|
||||||
|
+ Left msg -> Left msg
|
||||||
|
+ Right (s', a') -> Right (s', f a')
|
||||||
|
+
|
||||||
|
+instance Applicative Alex where
|
||||||
|
+ pure a = Alex $ \s -> Right (s, a)
|
||||||
|
+ fa <*> a = Alex $ \s -> case unAlex fa s of
|
||||||
|
+ Left msg -> Left msg
|
||||||
|
+ Right (s', f) -> case unAlex a s' of
|
||||||
|
+ Left msg -> Left msg
|
||||||
|
+ Right (s'', b) -> Right (s'', f b)
|
||||||
|
+
|
||||||
|
instance Monad Alex where
|
||||||
|
m >>= k = Alex $ \s -> case unAlex m s of
|
||||||
|
Left msg -> Left msg
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed May 13 09:19:35 UTC 2015 - mimi.vx@gmail.com
|
||||||
|
|
||||||
|
- add alex-3.1.4-ghc-7.10.patch
|
||||||
|
* temporary disable tests
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Apr 10 13:35:55 UTC 2015 - mimi.vx@gmail.com
|
Fri Apr 10 13:35:55 UTC 2015 - mimi.vx@gmail.com
|
||||||
|
|
||||||
|
12
alex.spec
12
alex.spec
@ -29,6 +29,9 @@ Group: Development/Languages/Other
|
|||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
Url: http://hackage.haskell.org/package/%{name}
|
Url: http://hackage.haskell.org/package/%{name}
|
||||||
Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
|
Source0: http://hackage.haskell.org/packages/archive/%{name}/%{version}/%{name}-%{version}.tar.gz
|
||||||
|
# PATCH-FIX-UPSTREAM alex-3.1.4-ghc-7.10.patch -- fix for new prelude in ghc-7.10 -- Sergei Trofimovich
|
||||||
|
Patch0: alex-3.1.4-ghc-7.10.patch
|
||||||
|
|
||||||
BuildRequires: autoconf
|
BuildRequires: autoconf
|
||||||
BuildRequires: ghc-Cabal-devel
|
BuildRequires: ghc-Cabal-devel
|
||||||
BuildRequires: ghc-QuickCheck-devel
|
BuildRequires: ghc-QuickCheck-devel
|
||||||
@ -36,9 +39,6 @@ BuildRequires: ghc-array-devel
|
|||||||
BuildRequires: ghc-containers-devel
|
BuildRequires: ghc-containers-devel
|
||||||
BuildRequires: ghc-directory-devel
|
BuildRequires: ghc-directory-devel
|
||||||
BuildRequires: ghc-rpm-macros
|
BuildRequires: ghc-rpm-macros
|
||||||
%if %{with tests}
|
|
||||||
BuildRequires: ghc-process-devel
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Alex is a tool for generating lexical analysers in Haskell. It takes a
|
Alex is a tool for generating lexical analysers in Haskell. It takes a
|
||||||
@ -48,6 +48,7 @@ lex or flex for C/C++.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q
|
||||||
|
%patch0 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%ghc_bin_build
|
%ghc_bin_build
|
||||||
@ -60,11 +61,6 @@ test -f configure || autoreconf
|
|||||||
mkdir -p %{buildroot}/%{_mandir}/man1
|
mkdir -p %{buildroot}/%{_mandir}/man1
|
||||||
cp doc/alex.1 %{buildroot}/%{_mandir}/man1
|
cp doc/alex.1 %{buildroot}/%{_mandir}/man1
|
||||||
|
|
||||||
%check
|
|
||||||
%if %{with tests}
|
|
||||||
%cabal test
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc LICENSE ANNOUNCE README TODO
|
%doc LICENSE ANNOUNCE README TODO
|
||||||
|
Loading…
Reference in New Issue
Block a user