[ghc/f13/master] provide ghc-devel, use ghc_without_shared, strip all dynlinked files
Jens Petersen
petersen at fedoraproject.org
Tue Mar 29 07:56:56 UTC 2011
commit dfffa76225ad67e9264f100d823d816781446adc
Author: Jens Petersen <petersen at redhat.com>
Date: Tue Mar 29 16:56:02 2011 +0900
provide ghc-devel, use ghc_without_shared, strip all dynlinked files
- provide ghc-devel for compatibility with cabal2spec-0.22.5
- use ghc_without_shared
- drop buildroot and buildroot cleaning
- smp build with max 4 cpus
- strip all dynlinked files not just shared objects (ghc-rpm-macros-0.5.9)
ghc.spec | 58 ++++++++++++++++++++++++++++++++--------------------------
1 files changed, 32 insertions(+), 26 deletions(-)
---
diff --git a/ghc.spec b/ghc.spec
index 26e7e9d..d9ad390 100644
--- a/ghc.spec
+++ b/ghc.spec
@@ -1,8 +1,6 @@
+# shared haskell libraries supported for x86* archs (enabled in ghc-rpm-macros)
+
## default enabled options ##
-# experimental shared libraries support available in ghc-6.12 for x86
-%ifarch %{ix86} x86_64
-%bcond_without shared
-%endif
%bcond_without doc
# test builds can made faster and smaller by disabling profiled libraries
# (currently libHSrts_thr_p.a breaks no prof build)
@@ -18,13 +16,13 @@
# include colored html src
%bcond_with hscolour
-# the debuginfo subpackage is currently empty anyway, so don't generate it
+# ghc does not output dwarf format so debuginfo is not useful
%global debug_package %{nil}
Name: ghc
# part of haskell-platform-2010.1.0.0
Version: 6.12.1
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: Glasgow Haskell Compilation system
# fedora ghc has only been bootstrapped on the following archs:
ExclusiveArch: %{ix86} x86_64 ppc alpha
@@ -35,13 +33,14 @@ Source0: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.bz2
Source1: http://www.haskell.org/ghc/dist/%{version}/ghc-%{version}-src-extralibs.tar.bz2
%endif
URL: http://haskell.org/ghc/
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# introduced for f11
Obsoletes: haddock < 2.4.2-3, ghc-haddock-devel < 2.4.2-3
BuildRequires: ghc, happy, ghc-rpm-macros >= 0.5.6
BuildRequires: gmp-devel, ncurses-devel
Requires: gcc, gmp-devel
-%if %{with shared}
+# for forwards compatibility
+Provides: ghc-devel = %{version}-%{release}
+%if %{undefined ghc_without_shared}\
# not sure if this is actually needed:
BuildRequires: libffi-devel
Requires: %{name}-libs = %{version}-%{release}
@@ -56,7 +55,7 @@ Patch1: ghc-6.12.1-gen_contents_index-haddock-path.patch
%description
GHC is a state-of-the-art programming suite for Haskell, a purely
-functional programming language. It includes an optimising compiler
+functional programming language. It includes an optimizing compiler
generating good code for a variety of platforms, together with an
interactive system for convenient, quick development. The
distribution includes space and time profiling facilities, a large
@@ -112,19 +111,19 @@ rm -r ghc-tarballs/{mingw,perl}
%build
cat > mk/build.mk << EOF
-GhcLibWays = v %{?with_prof:p} %{?with_shared:dyn}
+GhcLibWays = v %{?with_prof:p} %{!?ghc_without_shared:dyn}
%if %{without doc}
-HADDOCK_DOCS = NO
+HADDOCK_DOCS = NO
%endif
%if %{without manual}
BUILD_DOCBOOK_HTML = NO
%endif
%if %{with quick}
-SRC_HC_OPTS = -H64m -O0 -fasm
-GhcStage1HcOpts = -O -fasm
-GhcStage2HcOpts = -O0 -fasm
-GhcLibHcOpts = -O0 -fasm
-SplitObjs = NO
+SRC_HC_OPTS = -H64m -O0 -fasm
+GhcStage1HcOpts = -O -fasm
+GhcStage2HcOpts = -O0 -fasm
+GhcLibHcOpts = -O0 -fasm
+SplitObjs = NO
%endif
%if %{without hscolour}
HSCOLOUR_SRCS = NO
@@ -137,14 +136,14 @@ export CFLAGS="${CFLAGS:-%optflags}"
--datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \
--libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
--sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
- %{?with_shared:--enable-shared}
+ %{!?ghc_without_shared:--enable-shared}
-# 8 cpus seems to break build
-#make %{_smp_mflags}
-make
+# 4 cpus or more sometimes breaks build
+[ -z "$RPM_BUILD_NCPUS" ] && RPM_BUILD_NCPUS=$(/usr/bin/getconf _NPROCESSORS_ONLN)
+[ "$RPM_BUILD_NCPUS" -gt 4 ] && RPM_BUILD_NCPUS=4
+make -j$RPM_BUILD_NCPUS
%install
-rm -rf $RPM_BUILD_ROOT
make DESTDIR=${RPM_BUILD_ROOT} install
SRC_TOP=$PWD
@@ -177,6 +176,9 @@ for i in hsc2hs runhaskell; do
fi
done
+%ghc_strip_dynlinked
+
+
%check
# stolen from ghc6/debian/rules:
# Do some very simple tests that the compiler actually works
@@ -190,16 +192,13 @@ echo 'main = putStrLn "Foo"' > testghc/foo.hs
inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo -O2
[ "$(testghc/foo)" = "Foo" ]
rm testghc/*
-%if %{with shared}
+%if %{undefined ghc_without_shared}
echo 'main = putStrLn "Foo"' > testghc/foo.hs
inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo -dynamic
[ "$(testghc/foo)" = "Foo" ]
rm testghc/*
%endif
-%clean
-rm -rf $RPM_BUILD_ROOT
-
%post
# Alas, GHC, Hugs, and nhc all come with different set of tools in
# addition to a runFOO:
@@ -271,6 +270,13 @@ fi
%endif
%changelog
+* Mon Mar 28 2011 Jens Petersen <petersen at redhat.com> - 6.12.1-7
+- provide ghc-devel for compatibility with cabal2spec-0.22.5
+- use ghc_without_shared
+- drop buildroot and buildroot cleaning
+- smp build with max 4 cpus
+- strip all dynlinked files not just shared objects (ghc-rpm-macros-0.5.9)
+
* Fri Apr 30 2010 Jens Petersen <petersen at redhat.com>
- drop the ghc-utf8-string obsoletes (#571478)
@@ -337,7 +343,7 @@ fi
- add bcond for manual and extralibs
- reenable ppc secondary arch
- don't provide ghc-haddock-*
-- remove obsoltete post requires policycoreutils
+- remove obsolete post requires policycoreutils
- add vanilla v to GhcLibWays when building without prof
- handle without hscolour
- can't smp make currently
More information about the scm-commits
mailing list