LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File ghc-prepare-binary-distributions.spec of Package ghc-prepare-binary-distributions (Project home:bigironman:branches:devel:languages:haskell:bootstrap)

#
# spec file for package ghc-prepare-binary-distributions
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%global unregisterised_archs s390 s390s
%define armv7 armv7l armv7hl

%ifarch %{ix86}
%define longarch i386
%endif
%ifarch %{armv7}
%define longarch arm
%endif
%ifarch aarch64
%define longarch aarch64
%endif
%ifarch ppc
%define longarch powerpc
%endif
%ifarch ppc64
%define longarch powerpc64
%endif
%ifarch ppc64le
%define longarch powerpc64le
%endif
%ifarch s390
%define longarch s390
%endif
%ifarch s390x
%define longarch s390x
%endif
%ifarch x86_64
%define longarch x86_64
%endif
%ifarch s390 s390x
%define sysname ibm
%else
%define sysname unknown
%endif

Name:           ghc-prepare-binary-distributions
Version:        8.4.3
Release:        0
Url:            http://haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.xz
Summary:        The Glorious Glasgow Haskell Compiler binary distribution
License:        BSD-3-Clause
Group:          Development/Languages/Other

%ifarch x86_64 %arm ppc s390x
# ghc currently does not work with pie - the upstream packages come non-pie
# and there is no sane way to pass build flags to build a compiler with pic
# libraries
#!BuildIgnore:  gcc-PIE
%endif
BuildRequires:  ghc-bytestring-devel
BuildRequires:  ghc-compiler
BuildRequires:  ghc-binary-devel
BuildRequires:  ghc-containers-devel
BuildRequires:  ghc-directory-devel
BuildRequires:  ghc-pretty-devel
BuildRequires:  ghc-process-devel
BuildRequires:  ghc-transformers-devel
BuildRequires:  gcc
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  binutils-devel
BuildRequires:  glibc-devel
BuildRequires:  gmp-devel
BuildRequires:  libelf-devel
BuildRequires:  ncurses-devel
BuildRequires:  pkg-config
%ifarch aarch64 %{arm}
BuildRequires:  llvm6-devel
%endif
%ifarch s390x
BuildRequires:  libffi-devel
%define system_libffi 1
%endif

# ignore failures with unregisterised compilers (s390x)
BuildRequires:  -post-build-checks

Source:         http://haskell.org/ghc/dist/%{version}/ghc-%{version}-src.tar.xz
# PATCH-FIX-UPSTREAM  add_armv6l_and_armv7l_target.patch - add armv6l and armv7l target to llvm targets
Patch0:         add_armv6l_and_armv7l_target.patch
# PATCH-FIX-OPENSUSE fix-build-using-unregisterized-v8.2.patch ptrommler@icloud.com -- Fix bootstrap with GHC older than 8.4. Can be dropped once we bootstrap with 8.4.3. Debian patch.
Patch2:         fix-build-using-unregisterized-v8.2.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Haskell is the standard purely functional programming language; the
current language version is Haskell 98, agreed in December 1998.

GHC is a state-of-the-art programming suite for Haskell.  Included is
an optimising 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 collection of libraries, and support for various
language extensions, including concurrency, exceptions, and foreign
language interfaces (C, C++, etc).

A wide variety of Haskell related resources (tutorials, libraries,
specifications, documentation, compilers, interprbeters, references,
contact information, links to research groups) are available from the
Haskell home page at <http://www.haskell.org/>.



%prep
%setup -q -n ghc-%{version}
# workaround bogus gcc warning that causes unregistered builds to be rejected
# by OBS - rpmlint filters do not work with OBS checks
sed -i -e '/SRC_CC_OPTS/s/$/ -Wno-return-type/' mk/warnings.mk
%patch0 -p1
%patch2 -p1

%build

cat > mk/build.mk <<EOF
%ifnarch %{unregisterised_archs}
BuildFlavour = perf
%endif
GhcLibWays = v
DYNAMIC_GHC_PROGRAMS = NO
%ifarch %{unregisterised_archs}
GhcUnregisterised=YES
%endif
HADDOCK_DOCS = NO
HSCOLOUR_SRCS = NO
EOF

./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
  --bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \
  --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \
  --libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
  %{?system_libffi:--with-system-libffi} \
  --sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir}
make %{?_smp_mflags}
make binary-dist

%install
mkdir -p %{buildroot}%{_datadir}/ghc
cp ghc-%{version}-%{longarch}-%{sysname}-linux.tar.xz %{buildroot}%{_datadir}/ghc

%check
cd /tmp
tar -Jxvf %{buildroot}%{_datadir}/ghc/ghc-%{version}-%{longarch}-%{sysname}-linux.tar.xz
cd ghc-%{version}
./configure --prefix=/tmp/disttest
make install

%files
%defattr(-,root,root,-)
%dir %{_datadir}/ghc
%{_datadir}/ghc/ghc-%{version}-%{longarch}-%{sysname}-linux.tar.xz


%changelog