blob: 0de7924f79c9bd8b6fbb2c913f46b85da5ef70ef (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
%define alex_ver 3.4.0.0
%define happy_ver 1.20.0
%define ghc_ver 9.2.3
%global debug_package %{nil}
Name: ghc-bootstrap-binary
Version: 1.0.0
Release: 1
Summary: Binary distributions of The Glorious Glasgow Haskell Compiler and source code of Alex & Happy
License: BSD-3-Clause
URL: https://gitee.com/src-openeuler/ghc-bootstrap
Source0: LICENSE
Source1: ghc-9.2.3-x86_64-unknown-linux.tar.xz
Source2: ghc-9.2.3-aarch64-unknown-linux.tar.xz
Source3: alex-%{alex_ver}.tar.gz
Source4: happy-%{happy_ver}.tar.gz
BuildRequires: chrpath
BuildRequires: fdupes
BuildRequires: gmp-devel
BuildRequires: libffi
BuildRequires: libatomic
BuildRequires: ncurses-libs
BuildRequires: pkgconfig
BuildRequires: pkgconfig(libffi)
BuildRequires: numactl-devel
Requires: gmp-devel
Requires: libffi
Requires: libatomic
Requires: ncurses-libs
Requires: pkgconfig(libffi)
Requires: numactl-devel
Requires: libffi-devel
Conflicts: ghc-base
Conflicts: alex
Conflicts: happy
Provides: ghc-bootstrap-devel
ExclusiveArch: x86_64 aarch64
AutoReq: off
%description
This package contains a binary distribution of The Glorious Glasgow
Haskell Compilation System.
The tarballs come from the ghc download page.
This package is only used for bootstraping ghc.
Do not install this package! Install 'ghc' instead.
%prep
cp %{SOURCE0} .
cp %{SOURCE1} .
cp %{SOURCE2} .
cp %{SOURCE3} .
cp %{SOURCE4} .
%ifarch aarch64
%define longarch aarch64
%define arch aarch64
%endif
%ifarch x86_64
%define longarch x86_64
%define sysname unknown
%define arch x86_64
%endif
%ifarch x86_64 aarch64
%define sysname unknown
%endif
tar Jxf ghc-%{ghc_ver}-%{longarch}-%{sysname}-linux.tar.xz
tar xf alex-%{alex_ver}.tar.gz
tar xf happy-%{happy_ver}.tar.gz
%build
%install
pushd ghc-%{ghc_ver}-%{longarch}-%{sysname}-linux
./configure --prefix=/opt
mkdir -p %{buildroot}%{_sysconfdir}/ld.so.conf.d
echo "/opt/lib/ghc-%{ghc_ver}/lib/%{arch}-linux-ghc-%{ghc_ver}" > %{buildroot}%{_sysconfdir}/ld.so.conf.d/ghc.conf
%make_install
for i in $(find %{buildroot} -type f -executable -exec sh -c "file {} | grep -q 'dynamically linked'" \; -print); do
chrpath -d $i
done
rm %{buildroot}/opt/lib/ghc-%{ghc_ver}/lib/package.conf.d/.stamp
(cd %{buildroot}/opt/lib/ghc-%{ghc_ver}/lib/package.conf.d/
for i in *.conf; do
mv $i.copy $i
done
)
popd
export PATH=/opt/bin:$PATH
pushd alex-%{alex_ver}
ghc Setup.hs -o cabal
./cabal configure --prefix=%{_prefix}
./cabal build
./cabal copy --destdir=%{buildroot}
popd
pushd happy-%{happy_ver}
ghc Setup.hs -o cabal
./cabal configure --prefix=%{_prefix}
./cabal build
./cabal copy --destdir=%{buildroot}
popd
%post
/sbin/ldconfig
/opt/bin/ghc-pkg recache
%postun -p /sbin/ldconfig
%files
%license LICENSE
/opt/*
%config %{_sysconfdir}/ld.so.conf.d/ghc.conf
%{_bindir}/alex
%{_bindir}/happy
%{_datadir}/*ghc*
%{_datadir}/doc/*ghc*
%changelog
* Mon Nov 13 2023 Lin Runze <lrzlin@163.com> - 1.0.0-1
- Initial packaging. (Version 1.0.0)
|