diff options
author | CoprDistGit <infra@openeuler.org> | 2023-11-14 05:13:47 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-11-14 05:13:47 +0000 |
commit | c649017a9ff9dbfaccf4c6b4ae5f479a8b1815ed (patch) | |
tree | 27fd66502cde3b2e680988e79030658993bbecae | |
parent | a57b627f868872f4122a13a35d18996a3916e2a6 (diff) |
automatic import of ghc-bootstrap-binary
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | LICENSE | 31 | ||||
-rw-r--r-- | ghc-bootstrap-binary.spec | 128 | ||||
-rw-r--r-- | sources | 4 |
4 files changed, 167 insertions, 0 deletions
@@ -0,0 +1,4 @@ +/alex-3.4.0.0.tar.gz +/ghc-9.2.3-aarch64-unknown-linux.tar.xz +/ghc-9.2.3-x86_64-unknown-linux.tar.xz +/happy-1.20.0.tar.gz @@ -0,0 +1,31 @@ +The Glasgow Haskell Compiler License + +Copyright 2002, The University Court of the University of Glasgow. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution. + +- Neither name of the University nor the names of its contributors may be +used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF +GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH +DAMAGE. diff --git a/ghc-bootstrap-binary.spec b/ghc-bootstrap-binary.spec new file mode 100644 index 0000000..a09fb07 --- /dev/null +++ b/ghc-bootstrap-binary.spec @@ -0,0 +1,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 + +%build +tar Jxf ghc-%{ghc_ver}-%{longarch}-%{sysname}-linux.tar.xz +tar xf alex-%{alex_ver}.tar.gz +tar xf happy-%{happy_ver}.tar.gz + +%install +cd 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 +) + +cd .. +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) @@ -0,0 +1,4 @@ +a7aff3c0e479e6a25091f4c1ec6b27b1 alex-3.4.0.0.tar.gz +92ef66d63e5a728524af27561ccfba27 ghc-9.2.3-aarch64-unknown-linux.tar.xz +7f06fdbf4fd1eff94c1c85068c155c1c ghc-9.2.3-x86_64-unknown-linux.tar.xz +f6d214eb9f0271e327a2948ba45d1612 happy-1.20.0.tar.gz |