@ -7,12 +7,7 @@
%global llvm_version 12
%global llvm_version 12
# bootstrap_stage1 is for bringing up a D compiler for the very first time,
# bootstrapping is used for updating LDC to a newer version: it relies on an
# without having a working D compiler in the build root.
%global bootstrap_stage1 0
%global bootstrap_stage1_ldc_version 0.17.6
# bootstrap_stage2 is for updating LDC to a newer version: it relies on an
# older, working LDC compiler in the buildroot, which is then used to build a
# older, working LDC compiler in the buildroot, which is then used to build a
# new intermediate LDC version, and finally this in turn is used to build the
# new intermediate LDC version, and finally this in turn is used to build the
# final compiler that gets installed in the rpm.
# final compiler that gets installed in the rpm.
@ -31,9 +26,6 @@ Summary: LLVM D Compiler
License: BSD
License: BSD
URL: https://github.com/ldc-developers/ldc
URL: https://github.com/ldc-developers/ldc
Source0: https://github.com/ldc-developers/ldc/releases/download/v%{version}%{?pre:-%{pre}}/%{name}-%{version}%{?pre:-%{pre}}-src.tar.gz
Source0: https://github.com/ldc-developers/ldc/releases/download/v%{version}%{?pre:-%{pre}}/%{name}-%{version}%{?pre:-%{pre}}-src.tar.gz
%if 0%{?bootstrap_stage1}
Source1: https://github.com/ldc-developers/ldc/releases/download/v%{bootstrap_stage1_ldc_version}/%{name}-%{bootstrap_stage1_ldc_version}-src.tar.gz
%endif
Source3: macros.%{name}
Source3: macros.%{name}
# Make sure /usr/include/d is in the include search path
# Make sure /usr/include/d is in the include search path
@ -48,9 +40,7 @@ BuildRequires: cmake
BuildRequires: gc
BuildRequires: gc
BuildRequires: gcc
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gcc-c++
%if ! 0%{?bootstrap_stage1}
BuildRequires: ldc
BuildRequires: ldc
%endif
BuildRequires: libconfig-devel
BuildRequires: libconfig-devel
BuildRequires: libcurl-devel
BuildRequires: libcurl-devel
BuildRequires: libedit-devel
BuildRequires: libedit-devel
@ -138,24 +128,11 @@ mkdir geany_config
%global optflags %{optflags} -fno-strict-aliasing
%global optflags %{optflags} -fno-strict-aliasing
%if 0%{?bootstrap_stage1}
tar xf %{SOURCE1}
mkdir build-bootstrap1
pushd build-bootstrap1
cmake -DLLVM_CONFIG:PATH=llvm-config%{?llvm_version:-%{llvm_version}} \
../%{name}-%{bootstrap_stage1_ldc_version}-src
make %{?_smp_mflags}
popd
%endif
%if 0%{?bootstrap_stage2}
%if 0%{?bootstrap_stage2}
tar xf %{SOURCE0}
tar xf %{SOURCE0}
mkdir build-bootstrap2
mkdir build-bootstrap
pushd build-bootstrap2
pushd build-bootstrap
cmake -DLLVM_CONFIG:PATH=llvm-config%{?llvm_version:-%{llvm_version}} \
cmake -DLLVM_CONFIG:PATH=llvm-config%{?llvm_version:-%{llvm_version}} \
%if 0%{?bootstrap_stage1}
-DD_COMPILER:PATH=`pwd`/../build-bootstrap1/bin/ldmd2 \
%endif
../%{name}-%{version}%{?pre:-%{pre}}-src
../%{name}-%{version}%{?pre:-%{pre}}-src
make %{?_smp_mflags}
make %{?_smp_mflags}
popd
popd
@ -166,7 +143,7 @@ popd
-DBASH_COMPLETION_COMPLETIONSDIR:PATH=%{_datadir}/bash-completion/completions \
-DBASH_COMPLETION_COMPLETIONSDIR:PATH=%{_datadir}/bash-completion/completions \
-DLLVM_CONFIG:PATH=llvm-config%{?llvm_version:-%{llvm_version}} \
-DLLVM_CONFIG:PATH=llvm-config%{?llvm_version:-%{llvm_version}} \
%if 0%{?bootstrap_stage2}
%if 0%{?bootstrap_stage2}
-DD_COMPILER:PATH=`pwd`/build-bootstrap2 /bin/ldmd2 \
-DD_COMPILER:PATH=`pwd`/build-bootstrap/bin/ldmd2 \
%endif
%endif
%{nil}
%{nil}