[ghc-entropy] patch out TH from Setup and build on all archs (#992363)
Jens Petersen
petersen at fedoraproject.org
Fri Jul 11 04:33:57 UTC 2014
commit 96be48ec2d1461b069407e3c7a46b4e289317751
Author: Jens Petersen <petersen at redhat.com>
Date: Fri Jul 11 13:34:06 2014 +0900
patch out TH from Setup and build on all archs (#992363)
entropy-0.2.2.1-no-TH.patch | 30 ++++++++++++++++++++++++++++++
ghc-entropy.spec | 13 +++++++------
2 files changed, 37 insertions(+), 6 deletions(-)
---
diff --git a/entropy-0.2.2.1-no-TH.patch b/entropy-0.2.2.1-no-TH.patch
new file mode 100644
index 0000000..a0f9730
--- /dev/null
+++ b/entropy-0.2.2.1-no-TH.patch
@@ -0,0 +1,30 @@
+diff --git a/Setup.hs b/Setup.hs
+index cee008e..ff13514 100644
+--- a/Setup.hs
++++ b/Setup.hs
+@@ -1,4 +1,3 @@
+-{-# LANGUAGE TemplateHaskell #-}
+ import Distribution.Simple
+ import Distribution.Simple.LocalBuildInfo
+ import Distribution.Simple.Setup
+@@ -10,7 +9,6 @@ import System.Process
+ import System.Directory
+ import System.FilePath
+ import System.Exit
+-import Language.Haskell.TH (appE, varE, mkName, conE)
+
+ main = defaultMainWithHooks hk
+ where
+@@ -34,11 +32,7 @@ cArgsHC = map ("-optc" ++) cArgs
+
+ canUseRDRAND :: FilePath -> IO Bool
+ canUseRDRAND cc = do
+- -- Template haskell to call withTempDirectory in a backward compatible way
+- -- withTempDirectory normal False "" "testRDRAND" $ \tmpDir -> do
+- $(if cabalVersion >= Version [1,17,0] []
+- then appE (appE (varE $ mkName "withTempDirectory") (varE 'normal)) (conE (mkName "False"))
+- else appE (varE $ mkName "withTempDirectory") (varE 'normal)) "" "testRDRAND" $ \tmpDir -> do
++ withTempDirectory normal "" "testRDRAND" $ \tmpDir -> do
+ writeFile (tmpDir ++ "/testRDRAND.c")
+ (unlines [ "#include <stdint.h>"
+ , "int main() {"
diff --git a/ghc-entropy.spec b/ghc-entropy.spec
index 46e4fac..c85017c 100644
--- a/ghc-entropy.spec
+++ b/ghc-entropy.spec
@@ -7,22 +7,19 @@
Name: ghc-%{pkg_name}
Version: 0.2.2.1
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: A platform independent entropy source
License: BSD
URL: http://hackage.haskell.org/package/%{pkg_name}
Source0: http://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
+Patch1: entropy-0.2.2.1-no-TH.patch
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
# Begin cabal-rpm deps:
BuildRequires: ghc-bytestring-devel
# End cabal-rpm deps
-# Setup uses TH
-ExclusiveArch: %{ghc_arches_with_ghci}
-ExcludeArch: armv7hl
-BuildRequires: ghc-template-haskell-devel
%description
A platform independent method to obtain cryptographically strong entropy
@@ -44,7 +41,7 @@ This package provides the Haskell %{pkg_name} library development files.
%prep
%setup -q -n %{pkg_name}-%{version}
-
+%patch1 -p1 -b .orig
%build
%ghc_lib_build
@@ -70,6 +67,10 @@ This package provides the Haskell %{pkg_name} library development files.
%changelog
+* Fri Jul 11 2014 Jens Petersen <petersen at redhat.com> - 0.2.2.1-4
+- drop use of TemplateHaskell from Setup with patch from 0.2.2.2
+ so no longer need to restrict arch's (#992363)
+
* Tue Jul 8 2014 Jens Petersen <petersen at redhat.com> - 0.2.2.1-3
- update to cblrpm-0.8.11
- exclude arm due to TH segfault
More information about the scm-commits
mailing list