Accepting request 667601 from home:Guillaume_G:branches:openSUSE:Factory:ARM

- Enable bootstrap again for all flavours, otherwise ldc will require old .so file instead of new one
- Use ldc 1.12.0 as intermediate build on 32-bit, due to upstream bug:
  * https://github.com/ldc-developers/ldc/issues/2947

OBS-URL: https://build.opensuse.org/request/show/667601
OBS-URL: https://build.opensuse.org/package/show/devel:languages:D/ldc?expand=0&rev=28
This commit is contained in:
Guillaume GARDET 2019-01-21 13:43:13 +00:00 committed by Git OBS Bridge
parent 6974f8df1d
commit b75a14d054
3 changed files with 55 additions and 4 deletions

3
ldc-1.12.0-src.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:952ba57a957079345333d3f6aaaac766cc49750859357c419efc0c897850b5b9
size 6782018

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Jan 21 09:31:49 UTC 2019 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- Enable bootstrap again for all flavours, otherwise ldc will require old
.so file instead of new one
- Use ldc 1.12.0 as intermediate build on 32-bit, due to upstream bug:
* https://github.com/ldc-developers/ldc/issues/2947
-------------------------------------------------------------------
Thu Jan 10 14:00:36 UTC 2019 - Guillaume GARDET <guillaume.gardet@opensuse.org>

View File

@ -20,13 +20,20 @@
%define lname_runtime libdruntime-%{name}
%define lname_phobos libphobos2-%{name}
%define _bashcompletionsdir %{_datadir}/bash-completion/completions
# Do not bootstrap in Tumbleweed, and Leap 15+ as LDC is already available
%if 0%{suse_version} >= 1500
%bcond_with ldc_bootstrap
%else
# Do bootstrap (even in Tumbleweed, and Leap 15+), otherwise LDC will build
# against old installed .so instead of new built one
%bcond_without ldc_bootstrap
%ifarch %{ix86} %arm
# 32-bit needs 1.12.0 intermediate build due to: https://github.com/ldc-developers/ldc/issues/2947
%bcond_without 1_12_0_intermediate
%else
%bcond_with 1_12_0_intermediate
%endif
%bcond_with ldc_tests
Name: ldc
Version: 1.13.0
Release: 0
@ -55,6 +62,10 @@ Recommends: %{name}-bash-completion
%if %{with ldc_bootstrap}
# v0.17.6 is the last version buildable with a C++ compiler, so use it for bootstrapping
Source10: https://github.com/ldc-developers/ldc/releases/download/v0.17.6/ldc-0.17.6-src.tar.gz
%if %{with 1_12_0_intermediate}
# 1.12.0 is needed to build on 32-bit: https://github.com/ldc-developers/ldc/issues/2947
Source11: https://github.com/ldc-developers/ldc/releases/download/v1.12.0/ldc-1.12.0-src.tar.gz
%endif
%endif
%if %{with ldc_tests}
BuildRequires: gcc-c++
@ -132,6 +143,12 @@ Optional dependency offering bash completion for ldc2
tar xf %{SOURCE10}
pushd ldc-0.17.6-src
popd
%if %{with 1_12_0_intermediate}
tar xf %{SOURCE11}
pushd ldc-1.12.0-src
%patch0 -p1
popd
%endif
%endif
%build
@ -152,6 +169,25 @@ cmake \
make %{?_smp_mflags}
popd
popd
%if %{with 1_12_0_intermediate}
pushd ldc-1.12.0-src
#Needs to be compiled with clang, but opensuse_rules.cmake forces gcc so disable rule
touch ./no-suse-rules
mkdir build && pushd build
# FIXME: you should use %%cmake macros
cmake \
-DCMAKE_USER_MAKE_RULES_OVERRIDE=./no-suse-rules \
-DCMAKE_C_COMPILER="%{_bindir}/clang" \
-DCMAKE_CXX_COMPILER="%{_bindir}/clang++" \
-DINCLUDE_INSTALL_DIR:PATH=%{_includedir}/d \
-DD_COMPILER:PATH=`pwd`/../../ldc-0.17.6-src/build/bin/ldmd2 \
-DCMAKE_CXX_FLAGS="-std=c++11" \
-DCMAKE_C_FLAGS="-fPIC" \
..
make %{?_smp_mflags}
popd
popd
%endif
%endif
#Needs to be compiled with clang, but opensuse_rules.cmake forces gcc so disable rule
touch no-suse-rules
@ -161,7 +197,11 @@ touch no-suse-rules
-DCMAKE_CXX_COMPILER="%{_bindir}/clang++" \
-DINCLUDE_INSTALL_DIR:PATH=%{_includedir}/d \
%if %{with ldc_bootstrap}
%if %{with 1_12_0_intermediate}
-DD_COMPILER:PATH=`pwd`/../ldc-1.12.0-src/build/bin/ldmd2 \
%else
-DD_COMPILER:PATH=`pwd`/../ldc-0.17.6-src/build/bin/ldmd2 \
%endif
%endif
-DCMAKE_CXX_FLAGS="-std=c++11"
make %{?_smp_mflags}