Bootstrap ARM using cross-compiled armhl binaries, because the

(patched) 2.6.4-ARM compiler in the repository is not able to compile the
3.0.0 release.
This commit is contained in:
Joost van der Sluis 2016-01-09 17:18:56 +01:00
parent a182dfc582
commit 62ea5a56cb
3 changed files with 34 additions and 16 deletions

1
.gitignore vendored
View File

@ -7,3 +7,4 @@ fpcbuild-2.4.0.tar.gz
/fpc-2.6.2-bin-armv7hf.tar.gz
/fpcbuild-2.6.4.tar.gz
/fpcbuild-3.0.0.tar.gz
/fpc-3.0.0-bin-armv7hl.tar.gz

View File

@ -1,3 +1,10 @@
%ifarch %{arm}
# Bootstrap the arm-compiler. Set this to 0 after we've bootstrapped.
%{!?_with_bootstrap: %global bootstrap 1}
%else
%{!?_with_bootstrap: %global bootstrap 0}
%endif
Name: fpc
Version: 3.0.0
Release: 1%{?dist}
@ -6,17 +13,17 @@ Summary: Free Pascal Compiler
Group: Development/Languages
License: GPLv2+ and LGPLv2+ with exceptions
URL: http://www.freepascal.org/
Source0: ftp://ftp.freepascal.org/pub/fpc/dist/${version}/source/fpcbuild-%{version}.tar.gz
# This is only needed when useprebuiltcompiler is defined.
Source0: ftp://ftp.freepascal.org/pub/fpc/dist/%{version}/source/fpcbuild-%{version}.tar.gz
# This is only needed when we're bootstrapping.
# But it's not in an 'if defined' block, since the file has to be included in the srpm
# Thus you should enable this line when useprebuildcompiler is defined for any target
# Thus you should enable this line when we're bootstrapping for any target
#
# Last used for ARM bootstrap, for the ARM boostrap, the following 2 debs:
# ftp://ftp.nluug.nl/pub/os/Linux/distr/debian/pool/main/f/fpc/fp-compiler-2.6.2_2.6.2-5_armhf.deb
# ftp://ftp.nluug.nl/pub/os/Linux/distr/debian/pool/main/f/fpc/fp-units-base-2.6.2_2.6.2-5_armhf.deb
# were extracted, usr renamed to fpc-2.6.2-bin-armv7hf and then tarred
# Source1: fpc-2.6.2-bin-armv7hf.tar.gz
# Source1: http://www.cnoc.nl/fpc/%{name}-%{version}.compiler.bin.tar.gz
# Last used for ARM bootstrap, for the ARM boostrap, a compiler has been used that has
# been cross-compiled on a x86_64 system using
# make all CPU_TARGET=arm OS_TARGET=linux BINUTILSPREFIX=arm-linux-gnu- CROSSOPT="-CfVFPV3_D16"
# in the fpcsrc directory of fpcbuild-3.0.0.tar.gz. The compiler is then copied from
# fpcsrc/compiler/ppcarm to fpc-3.0.0-bin-armv7hl/bin/ppcarm-3.0.0.
Source1: https://joost.fedorapeople.org/fpc-3.0.0-bin-armv7hl.tar.gz
#
# Configuration templates:
Source2: fpc.cft
@ -26,10 +33,10 @@ Patch0: fpcdocs-3.0.0-r1260.patch
Patch1: fpc-3.0.0-r32374.patch
Requires: gpm, ncurses, binutils
%if ! %{defined useprebuiltcompiler}
%if ! 0%{?bootstrap}
BuildRequires: fpc
%endif
BuildRequires: tetex, tetex-latex, tetex-fonts
BuildRequires: tex(tex), tex(latex), tetex-fonts
ExclusiveArch: %{arm} %{ix86} x86_64 ppc ppc64
@ -65,24 +72,29 @@ automatical-code generation purposes.
%define fpcdebugopt -gl
%ifarch ppc
%define ppcname ppcppc
%define fpcarchname ppc
%else
%ifarch x86_64
%define ppcname ppcx64
%define fpcarchname x86_64
%else
%ifarch ppc64
%define ppcname ppcppc64
%define fpcarchname ppc64
%else
%ifarch %{arm}
%define ppcname ppcarm
%define fpcarchname arm
%else
%define ppcname ppc386
%define fpcarchname i386
%endif
%endif
%endif
%endif
%prep
%if %{defined useprebuiltcompiler}
%if 0%{?bootstrap}
%setup -a1 -n fpcbuild-%{version} -q
%else
%setup -n fpcbuild-%{version} -q
@ -98,8 +110,8 @@ cp -a fpcsrc/packages fpc_src
rm -rf fpc_src/packages/extra/amunits
rm -rf fpc_src/packages/extra/winunits
%if %{defined useprebuiltcompiler}
STARTPP=`pwd`/fpc-2.6.2-bin-armv7hf/bin/%{ppcname}-%{version}
%if 0%{?bootstrap}
STARTPP=`pwd`/fpc-3.0.0-bin-armv7hl/bin/%{ppcname}-%{version}
%else
STARTPP=%{ppcname}
%endif
@ -120,7 +132,8 @@ make -j1 -C fpcdocs pdf FPC=${NEWPP}
%install
cd fpcsrc
NEWPP=`pwd`/compiler/%{ppcname}
INSTALLOPTS="-j1 FPC=${NEWPP} \
NEWFPCMAKE=`pwd`/utils/fpcm/bin/%{fpcarchname}-linux/fpcmake
INSTALLOPTS="-j1 FPC=${NEWPP} FPCMAKE=${NEWFPCMAKE} \
INSTALL_PREFIX=%{buildroot}%{_prefix} \
INSTALL_LIBDIR=%{buildroot}%{_libdir} \
INSTALL_BASEDIR=%{buildroot}%{_libdir}/%{name}/%{version} \
@ -196,8 +209,11 @@ rm -rf %{buildroot}/usr/lib/%{name}/lexyacc
%changelog
* Sat Dec 19 2015 Joost van der Sluis <joost@cnoc.nl> - 3.0.0-1
* Sat Jan 9 2016 Joost van der Sluis <joost@cnoc.nl> - 3.0.0-1
- Upgrade to upstream release 3.0.0.
- Bootstrap ARM using cross-compiled armhl binaries, because the
(patched) 2.6.4-ARM compiler in the repository is not able to compile the
3.0.0 release.
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.6.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

View File

@ -1 +1,2 @@
bb7d17ef5c7c007466368262c0779cb7 fpcbuild-3.0.0.tar.gz
823cc1c77e59c4b97e99ce0a9c801894 fpc-3.0.0-bin-armv7hl.tar.gz