From b75a14d054c17424f6a59cb5c1dc603993418503f4ae8fc07ea56906ea4a0db9 Mon Sep 17 00:00:00 2001 From: Guillaume GARDET Date: Mon, 21 Jan 2019 13:43:13 +0000 Subject: [PATCH] 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 --- ldc-1.12.0-src.tar.gz | 3 +++ ldc.changes | 8 ++++++++ ldc.spec | 48 +++++++++++++++++++++++++++++++++++++++---- 3 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 ldc-1.12.0-src.tar.gz diff --git a/ldc-1.12.0-src.tar.gz b/ldc-1.12.0-src.tar.gz new file mode 100644 index 0000000..4a1a57e --- /dev/null +++ b/ldc-1.12.0-src.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:952ba57a957079345333d3f6aaaac766cc49750859357c419efc0c897850b5b9 +size 6782018 diff --git a/ldc.changes b/ldc.changes index 172705e..63e092f 100644 --- a/ldc.changes +++ b/ldc.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Jan 21 09:31:49 UTC 2019 - Guillaume GARDET + +- 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 diff --git a/ldc.spec b/ldc.spec index d69ae58..73c28a9 100644 --- a/ldc.spec +++ b/ldc.spec @@ -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}