2007-11-18 15:41:39 +00:00
|
|
|
#
|
2012-01-27 10:47:59 +00:00
|
|
|
# spec file for package ghc
|
|
|
|
#
|
2023-03-30 08:26:17 +00:00
|
|
|
# Copyright (c) 2023 SUSE LLC
|
2012-01-27 10:47:59 +00:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2018-11-07 09:45:55 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2012-01-27 10:47:59 +00:00
|
|
|
#
|
|
|
|
|
2016-09-28 14:53:35 +00:00
|
|
|
|
2023-04-19 12:56:42 +00:00
|
|
|
%define full_version 9.4.5
|
|
|
|
%define short_version 9.4.5
|
2023-03-30 08:26:17 +00:00
|
|
|
|
|
|
|
%ifnarch s390x
|
2018-05-14 13:15:35 +00:00
|
|
|
%define with_libnuma 1
|
|
|
|
%else
|
|
|
|
%define with_libnuma 0
|
|
|
|
%endif
|
2023-01-23 11:01:36 +00:00
|
|
|
# Keep in sync with ghc-bootstrap.spec
|
2023-03-30 08:26:17 +00:00
|
|
|
%if 0%{?suse_version} > 1550
|
|
|
|
%global llvm_major 14
|
2022-07-17 10:32:39 +00:00
|
|
|
%else
|
|
|
|
%global llvm_major 9
|
|
|
|
%endif
|
2023-03-30 08:26:17 +00:00
|
|
|
|
|
|
|
# conditionals
|
|
|
|
|
|
|
|
# disable prof, docs, perf build
|
|
|
|
# bcond_with for production builds: disable quick build
|
|
|
|
%bcond_with quickbuild
|
|
|
|
|
|
|
|
# make sure ghc libraries' ABI hashes unchanged (ghcX.Y not supported yet)
|
|
|
|
%bcond_with abicheck
|
|
|
|
|
|
|
|
# bcond_without for production builds: use Hadrian buildsystem
|
|
|
|
%bcond_without hadrian
|
|
|
|
|
|
|
|
# bcond_without for production builds: build hadrian
|
|
|
|
%bcond_without build_hadrian
|
|
|
|
|
|
|
|
# bcond_without for production builds: enable debuginfo
|
|
|
|
%bcond_without ghc_debuginfo
|
|
|
|
|
|
|
|
%if %{without ghc_debuginfo}
|
|
|
|
%undefine _enable_debug_packages
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# build profiling libraries
|
|
|
|
# build haddock
|
|
|
|
# perf production build (disable for quick build)
|
|
|
|
%if %{with quickbuild}
|
|
|
|
%undefine with_ghc_prof
|
|
|
|
%undefine with_haddock
|
|
|
|
%bcond_with perf_build
|
|
|
|
%else
|
|
|
|
%bcond_without ghc_prof
|
|
|
|
%bcond_without haddock
|
|
|
|
%bcond_without manual
|
|
|
|
%bcond_without perf_build
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{without hadrian}
|
|
|
|
# locked together since disabling haddock causes no manuals built
|
|
|
|
# and disabling haddock still created index.html
|
|
|
|
# https://gitlab.haskell.org/ghc/ghc/-/issues/15190
|
|
|
|
%{?with_haddock:%bcond_without manual}
|
|
|
|
%endif
|
|
|
|
|
2023-05-03 09:19:44 +00:00
|
|
|
%global ghc_llvm_archs s390x riscv64
|
|
|
|
%global ghc_unregisterized_arches noarch
|
2023-03-30 08:26:17 +00:00
|
|
|
|
2023-04-19 12:56:42 +00:00
|
|
|
%global base_ver 4.17.1.0
|
2023-03-30 08:26:17 +00:00
|
|
|
%global ghc_compact_ver 0.1.0.0
|
|
|
|
%global hpc_ver 0.6.1.0
|
2023-04-07 13:11:21 +00:00
|
|
|
%global hsc2hs_ver 0.68.8
|
2013-09-27 14:30:03 +00:00
|
|
|
|
2012-01-27 10:47:59 +00:00
|
|
|
Name: ghc
|
2023-03-30 08:26:17 +00:00
|
|
|
Version: %{short_version}
|
2012-11-06 16:12:44 +00:00
|
|
|
Release: 0
|
2023-03-30 08:26:17 +00:00
|
|
|
Summary: The Glorious Glasgow Haskell Compiler
|
|
|
|
License: BSD-3-Clause
|
2020-09-04 15:09:50 +00:00
|
|
|
URL: https://www.haskell.org/ghc/
|
|
|
|
Source: https://downloads.haskell.org/~ghc/%{full_version}/ghc-%{version}-src.tar.xz
|
|
|
|
Source2: ghc-rpmlintrc
|
2023-03-30 08:26:17 +00:00
|
|
|
Source3: 9_2_3-bootstrap-sources.tar.gz
|
|
|
|
Source5: ghc-pkg.man
|
|
|
|
Source6: haddock.man
|
|
|
|
Source7: runghc.man
|
2022-07-17 10:32:39 +00:00
|
|
|
Source9: ghc.keyring
|
2023-03-30 08:26:17 +00:00
|
|
|
Patch1: ghc-gen_contents_index-haddock-path.patch
|
|
|
|
# for unregisterized (s390x)
|
|
|
|
# https://ghc.haskell.org/trac/ghc/ticket/15689
|
|
|
|
Patch2: ghc-Cabal-install-PATH-warning.patch
|
|
|
|
# PATCH-FIX-UPSTREAM Disable-unboxed-arrays.patch ptrommler@icloud.com -- Do not use unboxed arrays on big-endian platforms. See Haskell Trac #15411.
|
|
|
|
Patch3: Disable-unboxed-arrays.patch
|
|
|
|
# PATCH-FIX-UPSTREAM execstack.patch -- RTS: Add stack marker to StgCRunAsm.S
|
|
|
|
Patch7: execstack.patch
|
|
|
|
# Work around a bug in Sphinx 6.1.x to fix the documentation build. Remove this patch ASAP.
|
|
|
|
Patch8: fix_extlinks.patch
|
|
|
|
# PATCH-FIX-UPSTREAM ghc-pie.patch - set linux as default PIE platform
|
|
|
|
Patch35: ghc-pie.patch
|
|
|
|
Patch200: ghc-hadrian-s390x-rts--qg.patch
|
2013-09-27 14:30:03 +00:00
|
|
|
BuildRequires: binutils-devel
|
2023-03-30 08:26:17 +00:00
|
|
|
BuildRequires: gcc-PIE
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: ghc-bootstrap >= 9.0
|
|
|
|
BuildRequires: ghc-bootstrap-helpers >= 1.3
|
2013-07-31 16:21:12 +00:00
|
|
|
BuildRequires: ghc-rpm-macros-extra
|
2012-11-06 16:12:44 +00:00
|
|
|
BuildRequires: glibc-devel
|
2012-06-26 16:06:48 +00:00
|
|
|
BuildRequires: gmp-devel
|
2016-09-28 10:48:25 +00:00
|
|
|
BuildRequires: libdw-devel
|
2013-09-27 14:30:03 +00:00
|
|
|
BuildRequires: libelf-devel
|
2012-06-26 16:06:48 +00:00
|
|
|
BuildRequires: libffi-devel
|
2018-05-14 13:15:35 +00:00
|
|
|
BuildRequires: libtool
|
2023-04-19 12:56:42 +00:00
|
|
|
%ifarch s390x riscv64
|
2023-05-03 09:19:44 +00:00
|
|
|
BuildRequires: clang%{llvm_major}
|
2023-03-30 08:26:17 +00:00
|
|
|
BuildRequires: llvm%{llvm_major}
|
|
|
|
BuildRequires: llvm%{llvm_major}-devel
|
2023-04-19 12:56:42 +00:00
|
|
|
%endif
|
2018-11-07 09:45:55 +00:00
|
|
|
BuildRequires: memory-constraints
|
2018-05-14 13:15:35 +00:00
|
|
|
BuildRequires: ncurses-devel
|
2023-03-30 08:26:17 +00:00
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: python3
|
2018-05-14 13:15:35 +00:00
|
|
|
BuildRequires: xz
|
2023-03-30 08:26:17 +00:00
|
|
|
Requires: %{name}-compiler = %{version}-%{release}
|
|
|
|
Requires: %{name}-devel = %{version}-%{release}
|
|
|
|
Requires: %{name}-ghc-boot-devel = %{version}-%{release}
|
|
|
|
Requires: %{name}-ghc-compact-devel = %{ghc_compact_ver}-%{release}
|
|
|
|
Requires: %{name}-ghc-devel = %{version}-%{release}
|
|
|
|
Requires: %{name}-ghc-heap-devel = %{version}-%{release}
|
|
|
|
Requires: %{name}-ghci-devel = %{version}-%{release}
|
|
|
|
Requires: %{name}-hpc-devel = %{hpc_ver}-%{release}
|
|
|
|
Requires: %{name}-libiserv-devel = %{version}-%{release}
|
|
|
|
Recommends: %{name}-compiler-default = %{version}-%{release}
|
|
|
|
%if %{without ghc_debuginfo}
|
|
|
|
%undefine _enable_debug_packages
|
2023-02-02 15:42:00 +00:00
|
|
|
%endif
|
2023-03-30 08:26:17 +00:00
|
|
|
%if %{with manual}
|
2018-12-19 02:01:33 +00:00
|
|
|
BuildRequires: python3-Sphinx
|
2015-07-17 14:55:57 +00:00
|
|
|
%endif
|
2023-03-30 08:26:17 +00:00
|
|
|
%if %{with_libnuma}
|
2018-05-14 13:15:35 +00:00
|
|
|
BuildRequires: libnuma-devel
|
|
|
|
%endif
|
2023-03-30 08:26:17 +00:00
|
|
|
%if %{with haddock}
|
|
|
|
Suggests: %{name}-doc = %{version}-%{release}
|
|
|
|
Suggests: %{name}-doc-index = %{version}-%{release}
|
|
|
|
%endif
|
|
|
|
%if %{with manual}
|
|
|
|
Suggests: %{name}-manual = %{version}-%{release}
|
|
|
|
%endif
|
|
|
|
%if %{with ghc_prof}
|
|
|
|
Suggests: %{name}-prof = %{version}-%{release}
|
|
|
|
%endif
|
2007-11-14 20:15:15 +00:00
|
|
|
|
|
|
|
%description
|
2012-02-20 13:22:09 +00:00
|
|
|
Haskell is the standard purely functional programming language; the
|
|
|
|
current language version is Haskell 98, agreed in December 1998.
|
2012-02-19 20:48:10 +00:00
|
|
|
|
2012-02-20 13:22:09 +00:00
|
|
|
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/>.
|
2012-01-27 10:47:59 +00:00
|
|
|
|
2012-06-03 15:38:23 +00:00
|
|
|
%package compiler
|
2012-11-06 16:12:44 +00:00
|
|
|
Summary: GHC compiler and utilities
|
2023-03-30 08:26:17 +00:00
|
|
|
License: BSD-3-Clause
|
2023-05-03 09:19:44 +00:00
|
|
|
Requires: %{name}-filesystem = %{version}-%{release}
|
2012-11-06 16:12:44 +00:00
|
|
|
Requires: gcc
|
2023-03-30 08:26:17 +00:00
|
|
|
Requires: ghc-base-devel = %{base_ver}-%{release}
|
2023-04-07 13:11:21 +00:00
|
|
|
Provides: hsc2hs-%{hsc2hs_ver}-%{release}
|
2023-03-30 08:26:17 +00:00
|
|
|
%ifarch riscv64 s390x
|
2022-07-17 10:32:39 +00:00
|
|
|
Requires: clang%{llvm_major}
|
|
|
|
Requires: llvm%{llvm_major}
|
2019-12-29 19:23:19 +00:00
|
|
|
%endif
|
2012-06-03 15:38:23 +00:00
|
|
|
|
|
|
|
%description compiler
|
|
|
|
This package contains the GHC compiler, tools and utilities.
|
|
|
|
|
|
|
|
The GHC libraries are provided by ghc-devel.
|
|
|
|
To install all of GHC install package ghc.
|
|
|
|
|
2023-02-02 15:42:00 +00:00
|
|
|
|
2023-03-30 08:26:17 +00:00
|
|
|
%if %{with haddock} || (%{with hadrian} && %{with manual})
|
|
|
|
%package doc
|
|
|
|
Summary: Haskell library documentation meta package
|
|
|
|
License: BSD-3-Clause
|
|
|
|
|
|
|
|
%description doc
|
|
|
|
Installing this package causes %{name}-*-doc packages corresponding to
|
|
|
|
%{name}-*-devel packages to be automatically installed too.
|
|
|
|
|
|
|
|
%package doc-index
|
|
|
|
Summary: GHC library documentation indexing
|
|
|
|
License: BSD-3-Clause
|
|
|
|
Requires: %{name}-compiler = %{version}-%{release}
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description doc-index
|
|
|
|
The package enables re-indexing of installed library documention.
|
|
|
|
|
|
|
|
%package filesystem
|
|
|
|
Summary: Shared directories for Haskell documentation
|
|
|
|
License: BSD-3-Clause
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
%description filesystem
|
|
|
|
This package provides some common directories used for
|
|
|
|
Haskell libraries documentation.
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with manual}
|
|
|
|
%package manual
|
|
|
|
Summary: GHC manual
|
|
|
|
License: BSD-3-Clause
|
|
|
|
Requires: %{name}-filesystem = %{version}-%{release}
|
|
|
|
BuildArch: noarch
|
2012-01-27 10:47:59 +00:00
|
|
|
|
2023-03-30 08:26:17 +00:00
|
|
|
%description manual
|
|
|
|
This package provides the User Guide and Haddock manual.
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%global ghc_version_override %{version}
|
|
|
|
%global ghc_pkg_c_deps ghc-compiler = %{ghc_version_override}-%{release}
|
|
|
|
%global version %{ghc_version_override}
|
|
|
|
%if %{with_libnuma}
|
2018-05-14 13:15:35 +00:00
|
|
|
%define libnuma_dep ,libnuma-devel
|
2018-07-05 01:01:12 +00:00
|
|
|
%else
|
|
|
|
%define libnuma_dep %{nil}
|
2018-05-14 13:15:35 +00:00
|
|
|
%endif
|
2020-10-18 16:03:04 +00:00
|
|
|
#!ForceMultiversion
|
2023-03-30 08:26:17 +00:00
|
|
|
%ghc_lib_subpackage -d Cabal-3.8.1.0
|
|
|
|
%ghc_lib_subpackage -d Cabal-syntax-3.8.1.0
|
2020-09-04 15:09:50 +00:00
|
|
|
%ghc_lib_subpackage -d array-0.5.4.0
|
2023-04-19 12:56:42 +00:00
|
|
|
%ghc_lib_subpackage -d -c gmp-devel,libffi-devel,libdw-devel,libelf-devel%{libnuma_dep} base-%{base_ver}
|
2023-03-30 08:26:17 +00:00
|
|
|
%ghc_lib_subpackage -d binary-0.8.9.1
|
2023-04-19 12:56:42 +00:00
|
|
|
%ghc_lib_subpackage -d bytestring-0.11.4.0
|
|
|
|
%ghc_lib_subpackage -d containers-0.6.7
|
2023-03-30 08:26:17 +00:00
|
|
|
%ghc_lib_subpackage -d deepseq-1.4.8.0
|
|
|
|
%ghc_lib_subpackage -d directory-1.3.7.1
|
|
|
|
%ghc_lib_subpackage -d exceptions-0.10.5
|
|
|
|
%ghc_lib_subpackage -d filepath-1.4.2.2
|
2017-05-29 11:09:39 +00:00
|
|
|
%ghc_lib_subpackage -d -x ghc-%{ghc_version_override}
|
2023-03-30 08:26:17 +00:00
|
|
|
%ghc_lib_subpackage -d -x ghc-boot-%{ghc_version_override}
|
2017-05-29 11:09:39 +00:00
|
|
|
%ghc_lib_subpackage -d ghc-boot-th-%{ghc_version_override}
|
2023-03-30 08:26:17 +00:00
|
|
|
%ghc_lib_subpackage -d -x ghc-compact-0.1.0.0
|
|
|
|
%ghc_lib_subpackage -d -x ghc-heap-%{ghc_version_override}
|
2017-05-29 11:09:39 +00:00
|
|
|
%ghc_lib_subpackage -d -x ghci-%{ghc_version_override}
|
2021-09-07 15:04:09 +00:00
|
|
|
%ghc_lib_subpackage -d haskeline-0.8.2
|
2023-03-30 08:26:17 +00:00
|
|
|
%ghc_lib_subpackage -d -x hpc-0.6.1.0
|
|
|
|
%ghc_lib_subpackage -d -x libiserv-%{ghc_version_override}
|
2018-05-14 13:15:35 +00:00
|
|
|
%ghc_lib_subpackage -d mtl-2.2.2
|
2023-04-19 12:56:42 +00:00
|
|
|
%ghc_lib_subpackage -d parsec-3.1.16.1
|
2018-05-14 13:15:35 +00:00
|
|
|
%ghc_lib_subpackage -d pretty-1.1.3.6
|
2023-03-30 08:26:17 +00:00
|
|
|
%ghc_lib_subpackage -d process-1.6.16.0
|
|
|
|
%ghc_lib_subpackage -d stm-2.5.1.0
|
|
|
|
%ghc_lib_subpackage -d template-haskell-2.19.0.0
|
|
|
|
%ghc_lib_subpackage -d -c ncurses-devel terminfo-0.4.1.5
|
2023-04-19 12:56:42 +00:00
|
|
|
%ghc_lib_subpackage -d text-2.0.2
|
2023-03-30 08:26:17 +00:00
|
|
|
%ghc_lib_subpackage -d time-1.12.2
|
2019-03-06 19:33:34 +00:00
|
|
|
%ghc_lib_subpackage -d transformers-0.5.6.2
|
2023-03-30 08:26:17 +00:00
|
|
|
%ghc_lib_subpackage -d unix-2.7.3
|
2018-05-14 13:15:35 +00:00
|
|
|
%ghc_lib_subpackage -d xhtml-3000.2.2.1
|
2012-01-11 22:02:10 +00:00
|
|
|
|
2012-01-27 10:47:59 +00:00
|
|
|
%global version %{ghc_version_override}
|
2007-11-14 20:15:15 +00:00
|
|
|
|
2023-03-30 08:26:17 +00:00
|
|
|
%package devel
|
|
|
|
%{?ghc_packages_list:Requires: %(echo %{ghc_packages_list} | sed -e "s/\([^ ]*\)-\([^ ]*\)/%{name}-\1-devel = \2-%{release},/g")}
|
2012-11-06 16:12:44 +00:00
|
|
|
Summary: GHC development libraries meta package
|
|
|
|
Requires: ghc-compiler = %{version}-%{release}
|
2023-03-30 08:26:17 +00:00
|
|
|
Obsoletes: ghc-libraries < %{version}-%{release}
|
|
|
|
Provides: ghc-libraries = %{version}-%{release}
|
2012-06-03 15:38:23 +00:00
|
|
|
|
2023-03-30 08:26:17 +00:00
|
|
|
%description devel
|
2012-06-03 15:38:23 +00:00
|
|
|
This is a meta-package for all the development library packages in GHC
|
|
|
|
except the ghc library, which is installed by the toplevel ghc metapackage.
|
|
|
|
|
2023-03-30 08:26:17 +00:00
|
|
|
%if %{with ghc_prof}
|
|
|
|
%package prof
|
|
|
|
Summary: GHC profiling libraries meta package
|
|
|
|
License: BSD-3-Clause
|
|
|
|
Requires: %{name}-compiler = %{version}-%{release}
|
|
|
|
|
|
|
|
%description prof
|
|
|
|
Installing this package causes %{name}-*-prof packages corresponding to
|
|
|
|
%{name}-*-devel packages to be automatically installed too.
|
|
|
|
%endif
|
|
|
|
|
2007-11-14 20:15:15 +00:00
|
|
|
%prep
|
2012-01-11 22:02:10 +00:00
|
|
|
%setup -q
|
2023-01-18 12:09:32 +00:00
|
|
|
%patch1 -p1
|
2022-07-17 10:32:39 +00:00
|
|
|
%patch2 -p1
|
2023-03-30 08:26:17 +00:00
|
|
|
%patch7 -p1
|
|
|
|
%patch8 -p1
|
2019-12-28 17:01:53 +00:00
|
|
|
%ifarch ppc64 s390 s390x
|
2018-10-18 09:46:41 +00:00
|
|
|
%patch3 -p1
|
|
|
|
%endif
|
2017-12-21 19:35:55 +00:00
|
|
|
%patch35 -p1
|
2023-03-30 08:26:17 +00:00
|
|
|
%ifarch ppc64 ppc64le s390x riscv64
|
|
|
|
%patch200 -p1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
rm libffi-tarballs/libffi-*.tar.gz
|
2015-07-17 14:55:57 +00:00
|
|
|
|
2012-01-27 10:47:59 +00:00
|
|
|
%build
|
2023-03-30 08:26:17 +00:00
|
|
|
cp %{SOURCE3} ./
|
|
|
|
hadrian/bootstrap/bootstrap.py --bootstrap-sources 9_2_3-bootstrap-sources.tar.gz
|
|
|
|
%global hadrian _build/bin/hadrian
|
|
|
|
|
|
|
|
%ghc_set_gcc_flags
|
|
|
|
|
|
|
|
export CC=%{_bindir}/gcc
|
|
|
|
export LD=%{_bindir}/ld
|
|
|
|
export LANG=C.utf8
|
|
|
|
|
|
|
|
autoupdate
|
|
|
|
|
|
|
|
python3 boot.source --hadrian
|
|
|
|
|
2023-02-02 15:42:00 +00:00
|
|
|
./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
|
2012-06-26 16:06:48 +00:00
|
|
|
--bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \
|
|
|
|
--datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir} \
|
|
|
|
--libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
|
|
|
|
--sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
|
2023-03-30 08:26:17 +00:00
|
|
|
--docdir=%{_docdir}/%{name}-%{version} \
|
|
|
|
--with-system-libffi \
|
|
|
|
%ifarch %{ghc_unregisterized_arches}
|
2020-10-04 01:05:01 +00:00
|
|
|
--enable-unregisterised \
|
2020-10-03 18:18:52 +00:00
|
|
|
%endif
|
2023-03-30 08:26:17 +00:00
|
|
|
%{nil}
|
|
|
|
|
|
|
|
%undefine _ghcdynlibdir
|
|
|
|
|
|
|
|
%ifarch %{ghc_llvm_archs}
|
|
|
|
%global hadrian_llvm +llvm
|
|
|
|
%endif
|
|
|
|
%define hadrian_docs %{!?with_haddock:--docs=no-haddocks} %{!?with_manual:--docs=no-sphinx}%{?with_manual:--docs=no-sphinx-pdfs --docs=no-sphinx-man}
|
|
|
|
|
2018-11-07 10:46:16 +00:00
|
|
|
%if 0%{?suse_version} >= 1500
|
2023-03-30 08:26:17 +00:00
|
|
|
%ifarch %{unregisterised_archs} riscv64
|
2020-09-04 15:09:50 +00:00
|
|
|
%if 0%{?qemu_user_space_build}
|
|
|
|
%limit_build -m 15000
|
|
|
|
%else
|
|
|
|
%limit_build -m 8000
|
|
|
|
%endif
|
|
|
|
%else
|
2018-11-07 09:45:55 +00:00
|
|
|
%limit_build -m 2000
|
2020-09-04 15:09:50 +00:00
|
|
|
%endif
|
2023-03-30 08:26:17 +00:00
|
|
|
%{hadrian} %{?_smp_mflags} --flavour=%{?with_quickbuild:quick+no_profiled_libs}%{!?with_quickbuild:perf%{!?with_ghc_prof:+no_profiled_libs}}%{?hadrian_llvm} %{hadrian_docs} binary-dist-dir
|
2022-07-17 10:32:39 +00:00
|
|
|
%else
|
2023-03-30 08:26:17 +00:00
|
|
|
%{hadrian} -j1 --flavour=%{?with_quickbuild:quick+no_profiled_libs}%{!?with_quickbuild:perf%{!?with_ghc_prof:+no_profiled_libs}}%{?hadrian_llvm} %{hadrian_docs} binary-dist-dir
|
2018-11-07 10:46:16 +00:00
|
|
|
%endif
|
2020-09-04 15:09:50 +00:00
|
|
|
|
2007-11-14 20:15:15 +00:00
|
|
|
%install
|
2012-01-11 22:02:10 +00:00
|
|
|
|
2023-03-30 08:26:17 +00:00
|
|
|
(
|
|
|
|
cd _build/bindist/ghc-%{version}-*
|
|
|
|
./configure --prefix=%{buildroot}%{ghclibdir} --bindir=%{buildroot}%{_bindir} --libdir=%{buildroot}%{_libdir} --mandir=%{buildroot}%{_mandir} --docdir=%{buildroot}%{_docdir}/%{name}-%{version}
|
|
|
|
make install
|
|
|
|
)
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
|
|
|
|
echo "%{ghclibplatform}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/%{name}.conf
|
|
|
|
# avoid 'E: binary-or-shlib-defines-rpath'
|
|
|
|
for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q 'dynamically linked'" \; -print); do
|
|
|
|
chrpath -d $i
|
|
|
|
done
|
|
|
|
|
|
|
|
# containers src moved to a subdir
|
|
|
|
cp -p libraries/containers/containers/LICENSE libraries/containers/LICENSE
|
|
|
|
# hack for Cabal-syntax/LICENSE
|
|
|
|
mkdir -p libraries/Cabal-syntax
|
|
|
|
cp -p libraries/Cabal/Cabal-syntax/LICENSE libraries/Cabal-syntax
|
|
|
|
|
|
|
|
rm -f %{name}-*.files
|
|
|
|
|
|
|
|
# FIXME replace with ghc_subpackages_list
|
2012-01-27 10:47:59 +00:00
|
|
|
for i in %{ghc_packages_list}; do
|
|
|
|
name=$(echo $i | sed -e "s/\(.*\)-.*/\1/")
|
|
|
|
ver=$(echo $i | sed -e "s/.*-\(.*\)/\1/")
|
|
|
|
%ghc_gen_filelists $name $ver
|
2023-03-30 08:26:17 +00:00
|
|
|
echo "%%license libraries/$name/LICENSE" >> %{name}-$name.files
|
2012-01-27 10:47:59 +00:00
|
|
|
done
|
2012-01-11 22:02:10 +00:00
|
|
|
|
2023-03-30 08:26:17 +00:00
|
|
|
echo "%%dir %{ghclibdir}" >> %{name}-base%{?_ghcdynlibdir:-devel}.files
|
2013-07-31 16:21:12 +00:00
|
|
|
|
2012-01-27 10:47:59 +00:00
|
|
|
%ghc_gen_filelists ghc %{ghc_version_override}
|
2023-03-30 08:26:17 +00:00
|
|
|
%ghc_gen_filelists ghc-boot %{ghc_version_override}
|
|
|
|
%ghc_gen_filelists ghc-compact %{ghc_compact_ver}
|
|
|
|
%ghc_gen_filelists ghc-heap %{ghc_version_override}
|
2016-09-28 10:48:25 +00:00
|
|
|
%ghc_gen_filelists ghci %{ghc_version_override}
|
2023-03-30 08:26:17 +00:00
|
|
|
%ghc_gen_filelists hpc %{hpc_ver}
|
|
|
|
%ghc_gen_filelists libiserv %{ghc_version_override}
|
2012-01-27 10:47:59 +00:00
|
|
|
|
2023-03-30 08:26:17 +00:00
|
|
|
%ghc_gen_filelists ghc-bignum 1.3
|
|
|
|
%ghc_gen_filelists ghc-prim 0.9.0
|
|
|
|
%ghc_gen_filelists integer-gmp 1.1
|
|
|
|
%ghc_gen_filelists rts 1.0.2
|
2012-01-27 10:47:59 +00:00
|
|
|
|
2023-04-19 12:56:42 +00:00
|
|
|
%ghc_merge_filelist ghc-bignum base
|
|
|
|
%ghc_merge_filelist ghc-prim base
|
|
|
|
%ghc_merge_filelist integer-gmp base
|
|
|
|
%ghc_merge_filelist rts base
|
2012-01-27 10:47:59 +00:00
|
|
|
|
2023-03-30 08:26:17 +00:00
|
|
|
# add rts libs
|
|
|
|
%if %{with hadrian}
|
|
|
|
for i in %{buildroot}%{ghclibplatform}/libHSrts*ghc%{ghc_version}.so; do
|
|
|
|
echo $i >> %{name}-base.files
|
2012-01-11 22:02:10 +00:00
|
|
|
done
|
2023-03-30 08:26:17 +00:00
|
|
|
echo "%{_sysconfdir}/ld.so.conf.d/%{name}.conf" >> %{name}-base.files
|
|
|
|
%else
|
|
|
|
%if %{defined _ghcdynlibdir}
|
|
|
|
echo "%{ghclibdir}/rts" >> %{name}-base-devel.files
|
|
|
|
%else
|
|
|
|
echo "%%dir %{ghclibdir}/rts" >> %{name}-base.files
|
|
|
|
ls -d %{buildroot}%{ghclibdir}/rts/lib*.a >> %{name}-base-devel.files
|
|
|
|
%endif
|
|
|
|
ls %{buildroot}%{?_ghcdynlibdir}%{!?_ghcdynlibdir:%{ghclibdir}/rts}/libHSrts*.so >> %{name}-base.files
|
|
|
|
%if %{defined _ghcdynlibdir}
|
|
|
|
sed -i -e 's!^library-dirs: %{ghclibdir}/rts!&\ndynamic-library-dirs: %{_libdir}!' %{buildroot}%{ghclibdir}/package.conf.d/rts.conf
|
|
|
|
%endif
|
|
|
|
ls -d %{buildroot}%{ghclibdir}/package.conf.d/rts.conf >> %{name}-base-devel.files
|
|
|
|
%endif
|
|
|
|
|
|
|
|
if [ -f %{buildroot}%{ghcliblib}/package.conf.d/system-cxx-std-lib-1.0.conf ]; then
|
|
|
|
ls -d %{buildroot}%{ghcliblib}/package.conf.d/system-cxx-std-lib-1.0.conf >> %{name}-base-devel.files
|
|
|
|
fi
|
|
|
|
|
|
|
|
%if %{with ghc_prof}
|
|
|
|
ls %{buildroot}%{ghclibdir}/bin/ghc-iserv-prof* >> %{name}-base-prof.files
|
|
|
|
%if %{with hadrian}
|
|
|
|
ls %{buildroot}%{ghclibdir}/lib/bin/ghc-iserv-prof >> %{name}-base-prof.files
|
|
|
|
echo "%%dir %{ghcliblib}/bin"
|
|
|
|
%endif
|
|
|
|
%endif
|
2012-01-11 22:02:10 +00:00
|
|
|
|
2023-03-30 08:26:17 +00:00
|
|
|
sed -i -e "s|^%{buildroot}||g" %{name}-base*.files
|
|
|
|
%if %{with hadrian}
|
|
|
|
sed -i -e "s|%{buildroot}||g" %{buildroot}%{_bindir}/*
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with haddock} && %{without hadrian}
|
|
|
|
# generate initial lib doc index
|
|
|
|
cd libraries
|
|
|
|
sh %{gen_contents_index} --intree --verbose
|
|
|
|
cd ..
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with hadrian}
|
|
|
|
%if %{with haddock}
|
|
|
|
rm %{buildroot}%{_docdir}/ghc-%{version}/archives/libraries.html.tar.xz
|
|
|
|
%endif
|
|
|
|
%if %{with manual}
|
|
|
|
rm %{buildroot}%{_docdir}/ghc-%{version}/archives/Haddock.html.tar.xz
|
|
|
|
rm %{buildroot}%{_docdir}/ghc-%{version}/archives/users_guide.html.tar.xz
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# we package the library license files separately
|
|
|
|
%if %{without hadrian}
|
|
|
|
find %{buildroot}%{ghc_html_libraries_dir} -name LICENSE -exec rm '{}' ';'
|
|
|
|
%endif
|
|
|
|
|
|
|
|
mkdir -p %{buildroot}%{_mandir}/man1
|
|
|
|
install -p -m 0644 %{SOURCE5} %{buildroot}%{_mandir}/man1/ghc-pkg.1
|
|
|
|
install -p -m 0644 %{SOURCE6} %{buildroot}%{_mandir}/man1/haddock.1
|
|
|
|
install -p -m 0644 %{SOURCE7} %{buildroot}%{_mandir}/man1/runghc.1
|
|
|
|
|
|
|
|
%if %{without hadrian}
|
|
|
|
for i in hp2ps hpc hsc2hs runhaskell; do
|
|
|
|
mv %{buildroot}%{_bindir}/$i{,-%{version}}
|
|
|
|
ln -s $i-%{version} %{buildroot}%{_bindir}/$i
|
|
|
|
done
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with hadrian}
|
|
|
|
rm %{buildroot}%{ghclibdir}/lib/package.conf.d/.stamp
|
|
|
|
rm %{buildroot}%{ghclibdir}/lib/package.conf.d/*.conf.copy
|
|
|
|
|
|
|
|
(
|
|
|
|
cd %{buildroot}%{ghclibdir}/lib/bin
|
|
|
|
for i in *; do
|
|
|
|
if [ -f %{buildroot}%{ghclibdir}/bin/$i ]; then
|
|
|
|
ln -sf ../../bin/$i
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
)
|
|
|
|
%endif
|
2016-09-28 10:48:25 +00:00
|
|
|
|
2012-06-26 16:06:48 +00:00
|
|
|
%check
|
2012-10-13 13:11:56 +00:00
|
|
|
# Actually, I took this from Jens Petersen's Fedora package
|
2012-06-26 16:06:48 +00:00
|
|
|
# stolen from ghc6/debian/rules:
|
2023-03-30 08:26:17 +00:00
|
|
|
#Do some very simple tests that the compiler actually works
|
|
|
|
export LANG=C.utf8
|
|
|
|
%if %{with hadrian}
|
|
|
|
export LD_LIBRARY_PATH=%{buildroot}%{ghclibplatform}:
|
|
|
|
GHC=%{buildroot}%{ghclibdir}/bin/ghc
|
|
|
|
%else
|
|
|
|
GHC=inplace/bin/ghc-stage2
|
|
|
|
%endif
|
2012-06-26 16:06:48 +00:00
|
|
|
# Do some very simple tests that the compiler actually works
|
|
|
|
rm -rf testghc
|
|
|
|
mkdir testghc
|
|
|
|
echo 'main = putStrLn "Foo"' > testghc/foo.hs
|
2023-03-30 08:26:17 +00:00
|
|
|
$GHC testghc/foo.hs -o testghc/foo
|
2012-06-26 16:06:48 +00:00
|
|
|
[ "$(testghc/foo)" = "Foo" ]
|
|
|
|
rm testghc/*
|
|
|
|
echo 'main = putStrLn "Foo"' > testghc/foo.hs
|
2023-03-30 08:26:17 +00:00
|
|
|
$GHC testghc/foo.hs -o testghc/foo -O2
|
2012-06-26 16:06:48 +00:00
|
|
|
[ "$(testghc/foo)" = "Foo" ]
|
|
|
|
rm testghc/*
|
|
|
|
echo 'main = putStrLn "Foo"' > testghc/foo.hs
|
2023-03-30 08:26:17 +00:00
|
|
|
$GHC testghc/foo.hs -o testghc/foo -dynamic
|
|
|
|
[ "$(testghc/foo)" = "Foo" ]
|
2012-06-26 16:06:48 +00:00
|
|
|
rm testghc/*
|
|
|
|
|
2023-03-30 08:26:17 +00:00
|
|
|
$GHC --info
|
|
|
|
|
|
|
|
%post base -p /sbin/ldconfig
|
|
|
|
%postun base -p /sbin/ldconfig
|
2023-05-03 09:19:44 +00:00
|
|
|
|
2023-03-30 08:26:17 +00:00
|
|
|
%transfiletriggerin compiler -- %{ghcliblib}/package.conf.d
|
|
|
|
%ghc_pkg_recache
|
|
|
|
%end
|
|
|
|
|
|
|
|
%transfiletriggerpostun compiler -- %{ghcliblib}/package.conf.d
|
|
|
|
%ghc_pkg_recache
|
|
|
|
%end
|
2007-11-14 20:15:15 +00:00
|
|
|
|
2012-01-27 10:47:59 +00:00
|
|
|
%files
|
2018-04-26 07:07:46 +00:00
|
|
|
%license LICENSE
|
2023-03-30 08:26:17 +00:00
|
|
|
%dir %{ghcliblib}
|
|
|
|
%dir %{ghclibdir}
|
2023-05-03 09:19:44 +00:00
|
|
|
%dir %{ghcliblib}/%{ghcplatform}
|
2012-06-03 15:38:23 +00:00
|
|
|
|
|
|
|
%files compiler
|
2018-04-26 07:07:46 +00:00
|
|
|
%license LICENSE
|
2023-03-30 08:26:17 +00:00
|
|
|
%doc README.md
|
2012-01-27 10:47:59 +00:00
|
|
|
%{_bindir}/ghc-%{version}
|
|
|
|
%{_bindir}/ghc-pkg-%{version}
|
|
|
|
%{_bindir}/ghci-%{version}
|
2023-03-30 08:26:17 +00:00
|
|
|
%{_bindir}/hp2ps-%{?with_hadrian:ghc-}%{version}
|
|
|
|
%{_bindir}/hpc-%{?with_hadrian:ghc-}%{version}
|
|
|
|
%{_bindir}/hsc2hs-%{?with_hadrian:ghc-}%{version}
|
|
|
|
%{_bindir}/runghc-%{version}
|
|
|
|
%{_bindir}/runhaskell-%{version}
|
|
|
|
%{_bindir}/ghc
|
|
|
|
%{_bindir}/ghc-pkg
|
|
|
|
%{_bindir}/ghci
|
|
|
|
%if %{with hadrian} || %{with haddock}
|
|
|
|
%{_bindir}/haddock
|
|
|
|
%endif
|
2012-01-27 10:47:59 +00:00
|
|
|
%{_bindir}/hp2ps
|
|
|
|
%{_bindir}/hpc
|
2014-11-05 21:40:33 +00:00
|
|
|
%{_bindir}/hsc2hs
|
2012-01-27 10:47:59 +00:00
|
|
|
%{_bindir}/runghc
|
2014-11-05 21:40:33 +00:00
|
|
|
%{_bindir}/runhaskell
|
|
|
|
%dir %{ghclibdir}/bin
|
2023-03-30 08:26:17 +00:00
|
|
|
%dir %{ghcliblib}/bin
|
2014-11-05 21:40:33 +00:00
|
|
|
%{ghclibdir}/bin/ghc
|
2016-09-28 10:48:25 +00:00
|
|
|
%{ghclibdir}/bin/ghc-iserv
|
|
|
|
%{ghclibdir}/bin/ghc-iserv-dyn
|
2023-03-30 08:26:17 +00:00
|
|
|
%{ghclibdir}/bin/ghc-pkg
|
2014-11-05 21:40:33 +00:00
|
|
|
%{ghclibdir}/bin/hpc
|
|
|
|
%{ghclibdir}/bin/hsc2hs
|
|
|
|
%{ghclibdir}/bin/runghc
|
2023-03-30 08:26:17 +00:00
|
|
|
%{ghclibdir}/bin/hp2ps
|
2016-09-28 10:48:25 +00:00
|
|
|
%{ghclibdir}/bin/unlit
|
2023-03-30 08:26:17 +00:00
|
|
|
%if %{with hadrian}
|
|
|
|
%{ghclibdir}/bin/ghc-%{version}
|
|
|
|
%{ghclibdir}/bin/ghc-iserv-ghc-%{version}
|
|
|
|
%{ghclibdir}/bin/ghc-iserv-dyn-ghc-%{version}
|
|
|
|
%{ghclibdir}/bin/ghc-pkg-%{version}
|
|
|
|
%{ghclibdir}/bin/haddock
|
|
|
|
%{ghclibdir}/bin/haddock-ghc-%{version}
|
|
|
|
%{ghclibdir}/bin/hp2ps-ghc-%{version}
|
|
|
|
%{ghclibdir}/bin/hpc-ghc-%{version}
|
|
|
|
%{ghclibdir}/bin/hsc2hs-ghc-%{version}
|
|
|
|
%{ghclibdir}/bin/runghc-%{version}
|
|
|
|
%{ghclibdir}/bin/runhaskell
|
|
|
|
%{ghclibdir}/bin/runhaskell-%{version}
|
|
|
|
%{ghclibdir}/bin/unlit-ghc-%{version}
|
|
|
|
%{ghclibdir}/lib/bin/ghc-iserv
|
|
|
|
%{ghclibdir}/lib/bin/ghc-iserv-dyn
|
|
|
|
%{ghclibdir}/lib/bin/unlit
|
2014-11-05 21:40:33 +00:00
|
|
|
%endif
|
2023-03-30 08:26:17 +00:00
|
|
|
%{ghcliblib}/ghc-usage.txt
|
|
|
|
%{ghcliblib}/ghci-usage.txt
|
|
|
|
%{ghcliblib}/llvm-passes
|
|
|
|
%{ghcliblib}/llvm-targets
|
|
|
|
%dir %{ghcliblib}/package.conf.d
|
|
|
|
%ghost %{ghcliblib}/package.conf.d/package.cache
|
|
|
|
%{ghcliblib}/package.conf.d/package.cache.lock
|
|
|
|
%{ghcliblib}/settings
|
|
|
|
%{ghcliblib}/template-hsc.h
|
|
|
|
%{_mandir}/man1/ghc-pkg.1%{?ext_man}
|
|
|
|
%{_mandir}/man1/haddock.1%{?ext_man}
|
|
|
|
%{_mandir}/man1/runghc.1%{?ext_man}
|
|
|
|
%if %{with hadrian} || %{with haddock}
|
2012-01-27 10:47:59 +00:00
|
|
|
%{_bindir}/haddock-ghc-%{version}
|
2023-03-30 08:26:17 +00:00
|
|
|
%{ghcliblib}/html
|
|
|
|
%{ghcliblib}/latex
|
|
|
|
%endif
|
|
|
|
%if %{with haddock} || (%{with hadrian} && %{with manual})
|
|
|
|
%{ghc_html_libraries_dir}/prologue.txt
|
|
|
|
%endif
|
|
|
|
%if %{with haddock}
|
|
|
|
%if %{without hadrian}
|
2014-11-05 21:40:33 +00:00
|
|
|
%{ghclibdir}/bin/haddock
|
2023-03-30 08:26:17 +00:00
|
|
|
%endif
|
|
|
|
%verify(not size mtime) %{ghc_html_libraries_dir}/haddock-bundle.min.js
|
|
|
|
%verify(not size mtime) %{ghc_html_libraries_dir}/linuwial.css
|
|
|
|
%verify(not size mtime) %{ghc_html_libraries_dir}/quick-jump.css
|
|
|
|
%verify(not size mtime) %{ghc_html_libraries_dir}/synopsis.png
|
|
|
|
%endif
|
|
|
|
%if %{with manual} && %{without hadrian}
|
|
|
|
%{_mandir}/man1/ghc.1%{?ext_man}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%{_bindir}/ghc
|
|
|
|
%{_bindir}/ghc-pkg
|
|
|
|
%{_bindir}/ghci
|
|
|
|
%if %{with hadrian} || %{with haddock}
|
|
|
|
%{_bindir}/haddock
|
|
|
|
%endif
|
|
|
|
%{_bindir}/hp2ps
|
|
|
|
%{_bindir}/hpc
|
|
|
|
%{_bindir}/hsc2hs
|
|
|
|
%{_bindir}/runghc
|
|
|
|
%{_bindir}/runhaskell
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
|
|
|
|
%if %{with haddock} || (%{with hadrian} && %{with manual})
|
|
|
|
%files doc
|
|
|
|
%{ghc_html_dir}/index.html
|
|
|
|
|
|
|
|
%files doc-index
|
|
|
|
%{ghc_html_libraries_dir}/gen_contents_index
|
|
|
|
%if %{with haddock}
|
|
|
|
%verify(not size mtime) %{ghc_html_libraries_dir}/doc-index*.html
|
|
|
|
%verify(not size mtime) %{ghc_html_libraries_dir}/index*.html
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%files filesystem
|
|
|
|
%dir %_ghc_doc_dir
|
|
|
|
%dir %ghc_html_dir
|
|
|
|
%dir %ghc_html_libraries_dir
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with manual}
|
|
|
|
%files manual
|
|
|
|
## needs pandoc
|
|
|
|
#%%{ghc_html_dir}/Cabal
|
|
|
|
%{ghc_html_dir}/users_guide
|
|
|
|
%if %{with hadrian}
|
|
|
|
%{ghc_html_dir}/Haddock
|
|
|
|
%else
|
|
|
|
%if %{with haddock}
|
|
|
|
%{ghc_html_dir}/haddock
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with ghc_prof}
|
|
|
|
%files prof
|
|
|
|
%endif
|
2012-06-03 15:38:23 +00:00
|
|
|
|
2007-11-14 20:15:15 +00:00
|
|
|
%changelog
|