Accepting request 210908 from devel:languages:haskell:platform

- fix docs packaging (RPM macros v 1.2)
- fix ppc64 LLVM backend
- package Postscript and PDF manuals (forwarded request 210907 from ptrommler)

OBS-URL: https://build.opensuse.org/request/show/210908
OBS-URL: https://build.opensuse.org/package/show/devel:languages:haskell/ghc?expand=0&rev=146
This commit is contained in:
Peter Trommler 2013-12-15 07:35:30 +00:00 committed by Git OBS Bridge
parent 011c369f27
commit 96aeeb4228
4 changed files with 68 additions and 3 deletions

View File

@ -0,0 +1,13 @@
--- ghc-7.6.3/utils/ghc-cabal/Main.hs~ 2013-04-19 06:22:47.000000000 +0900
+++ ghc-7.6.3/utils/ghc-cabal/Main.hs 2013-10-29 12:35:18.916340631 +0900
@@ -180,8 +180,8 @@
libsubdir = toPathTemplate "$pkgid",
docdir = toPathTemplate $
if relocatableBuild
- then "$topdir/../doc/html/libraries/$pkgid"
- else (myDocdir </> "$pkgid"),
+ then "$topdir/../doc/html/libraries/$pkg"
+ else (myDocdir </> "$pkg"),
htmldir = toPathTemplate "$docdir"
}
progs = withPrograms lbi

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Sat Dec 14 08:38:43 UTC 2013 - peter.trommler@ohm-hochschule.de
- Add llvm-powerpc64-datalayout.patch
* fix LLVM backend for powerpc64
- build and test LLVM backend on powerpc64
-------------------------------------------------------------------
Fri Dec 13 21:59:10 UTC 2013 - peter.trommler@ohm-hochschule.de
- Add cabal-unversion-docdir.patch
* ghc-rpm-macros don't include versions in package docdirs
starting with version 1.0
- use standard docdir for ghc
- package pdf and ps manuals
-------------------------------------------------------------------
Mon Oct 28 18:24:46 UTC 2013 - peter.trommler@ohm-hochschule.de

View File

@ -74,9 +74,13 @@ BuildRequires: glibc-devel
BuildRequires: gmp-devel
BuildRequires: libelf-devel
BuildRequires: libffi-devel
%ifarch ppc64
BuildRequires: llvm
%endif
BuildRequires: ncurses-devel
BuildRequires: pkg-config
%if %{undefined without_manual}
BuildRequires: dblatex
BuildRequires: docbook-utils
BuildRequires: docbook-xsl-stylesheets
BuildRequires: libxslt
@ -102,6 +106,10 @@ Patch5: 0001-Fix-detection-of-library-for-shm-on-openSUSE.patch
Patch6: 0001-Delete-spurious-comma-in-configure.ac.patch
# PATCH-FIX-UPSTREAM peter.trommler@ohm-hochschule.de - Fix Haskell trac #8134.
Patch7: ghc-fix-infinite-loop-big-endian.patch
# PATCH-FIX-UPSTREAM peter.trommler@ohm-hochschule.de - Add target datalayout for llvm on powerpc 64.
Patch8: llvm-powerpc64-datalayout.patch
# PATCH-FIX-OPENSUSE peter.trommler@ohm-hochschule.de - Remove versions in library docdirs. Required for compatibility with ghc-rpm-macros 1.0 and up. Can be removed once we move to ghc 7.8.x. Fedora patch 16.
Patch9: ghc-cabal-unversion-docdir.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -203,6 +211,8 @@ rm -r ghc-tarballs/libffi
%patch5 -p1 -b .shm
%patch6 -p1 -b .comma
%patch7 -p1
%patch8 -p1
%patch9 -p1
%build
# required for patch and patch1
@ -234,7 +244,7 @@ make clean
# http://hackage.haskell.org/trac/ghc/wiki/Platforms
# cf https://github.com/gentoo-haskell/gentoo-haskell/tree/master/dev-lang/ghc
cat > mk/build.mk << EOF
%ifnarch %{unregisterised_archs}
%ifnarch ppc64
BuildFlavour = perf
%endif
GhcLibWays = v %{!?ghc_without_shared:dyn} %{!?without_prof:p}
@ -260,7 +270,6 @@ export CFLAGS="${CFLAGS:-%optflags}"
--datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \
--libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
--sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
--docdir=%{ghcdocroot} \
%{?ghc_boot:--with-ghc=%{_builddir}/ghc-boot/bin/ghc} \
--with-system-libffi \
--with-gcc=%{_bindir}/gcc
@ -331,6 +340,13 @@ echo 'main = putStrLn "Foo"' > testghc/foo.hs
inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo -O2
[ "$(testghc/foo)" = "Foo" ]
rm testghc/*
%ifarch ppc64
# test LLVM backend
echo 'main = putStrLn "Foo"' > testghc/foo.hs
inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo -O2 -fllvm
[ "$(testghc/foo)" = "Foo" ]
rm testghc/*
%endif
%if %{undefined ghc_without_shared}
echo 'main = putStrLn "Foo"' > testghc/foo.hs
inplace/bin/ghc-stage2 testghc/foo.hs -o testghc/foo -dynamic
@ -394,7 +410,7 @@ fi
%{ghclibdir}/runghc
%{ghclibdir}/template-hsc.h
%{ghclibdir}/unlit
%dir %{ghcdocroot}
%dir %{_datadir}/doc/ghc
%dir %{ghcdocbasedir}
%dir %{ghcdocbasedir}/libraries
%{_mandir}/man1/ghc.*
@ -405,6 +421,8 @@ fi
%{ghclibdir}/latex
%{ghclibdir}/haddock
%if %{undefined without_manual}
%{_datadir}/doc/ghc/haddock.*
%{_datadir}/doc/ghc/users_guide.*
%{ghcdocbasedir}/haddock
%{ghcdocbasedir}/users_guide
%endif

View File

@ -0,0 +1,18 @@
Index: ghc-7.6.3/compiler/llvmGen/LlvmCodeGen/Ppr.hs
===================================================================
--- ghc-7.6.3.orig/compiler/llvmGen/LlvmCodeGen/Ppr.hs
+++ ghc-7.6.3/compiler/llvmGen/LlvmCodeGen/Ppr.hs
@@ -68,6 +68,13 @@ moduleLayout =
$+$ text "target triple = \"arm-unknown-linux-gnueabi\""
#endif
+#elif defined (powerpc64_TARGET_ARCH)
+
+#if linux_TARGET_OS
+ text "target datalayout = \"E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64\""
+ $+$ text "target triple = \"powerpc64-unknown-linux-gnu\""
+#endif
+
#else
-- FIX: Other targets
empty