summaryrefslogtreecommitdiff
path: root/ghc-bootstrap-tools.spec
blob: 645ad7afd5f51b720c2000090624a2aba0cbfe05 (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
%define         alex_ver 3.4.0.0
%define         happy_ver 1.20.0
%global         debug_package %{nil}

Name:           ghc-bootstrap-tools
Version:        1.0
Release:        1
Summary:        Dependencies for ghc bootstrap.
License:        BSD-2-Clause and BSD-3-Clause
URL:            https://gitee.com/src-openeuler/ghc-bootstrap-tools
Source0:        https://hackage.haskell.org/package/alex-%{alex_ver}/alex-%{alex_ver}.tar.gz
Source1:        https://hackage.haskell.org/package/happy-%{happy_ver}/happy-%{happy_ver}.tar.gz

BuildRequires:  ghc-bootstrap

Conflicts:      alex
Conflicts:      happy

%description
Prebuild alex and happy for bootstrapping the proper ghc build.
Don't use outside of ghc bootstrapping!
For alex and happy, install the seperated package instead.

%prep
%setup -q -c -a0 -a1

%build
export PATH=/opt/bin:$PATH
pushd alex-%{alex_ver}
ghc Setup.hs -o cabal
./cabal configure --prefix=%{_prefix}
./cabal build
popd

pushd happy-%{happy_ver}
ghc Setup.hs -o cabal
./cabal configure --prefix=%{_prefix}
./cabal build
popd

%install
pushd alex-%{alex_ver}
./cabal copy --destdir=%{buildroot}
popd

pushd happy-%{happy_ver}
./cabal copy --destdir=%{buildroot}
popd

%files
%{_bindir}/alex
%{_bindir}/happy
%{_datadir}/*ghc*
%{_datadir}/doc/*ghc*

%changelog
* Sat Jul 22 2023 Lin Runze <lrzlin@163.com> - 1.0-1
- Initial packaging. (Version 1.0)