From 4150b474999ba50f6708603f4c0d8602d5bd9808 Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Fri, 21 Aug 2020 12:19:31 +0200 Subject: [PATCH] Move ldc internal headers to /usr/lib/ldc to avoid conflicting with gdc This matches with what Debian does, and is what the gcc maintainers suggest. The idea is to have ldc internal headers (those that cannot be used by gdc and cause conflicts) in /usr/lib/ldc/%{_target_platform}/include/d/, and keep library header files (those that both ldc and gdc can use) in /usr/include/d/. https://bugzilla.redhat.com/show_bug.cgi?id=1781685 --- ldc-include-path.patch | 19 +++++++++++++++++++ ldc.spec | 21 ++++++++++++++------- 2 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 ldc-include-path.patch diff --git a/ldc-include-path.patch b/ldc-include-path.patch new file mode 100644 index 0000000..493697a --- /dev/null +++ b/ldc-include-path.patch @@ -0,0 +1,19 @@ +Description: Fix ldc.conf to search in right paths + + ldc (1:1.1.0-2) unstable; urgency=medium + . + * Multiarch enable + * Install includes separately to avoid clash with gdc (Closes: #827211) +Author: Konstantinos Margaritis +Bug-Debian: https://bugs.debian.org/827211 + +--- a/ldc2_install.conf.in ++++ b/ldc2_install.conf.in +@@ -23,6 +23,7 @@ + // default switches appended after all explicit command-line switches + post-switches = [ + "-I@INCLUDE_INSTALL_DIR@", ++ "-I/usr/include/d", + ]; + // default directories to be searched for libraries when linking + lib-dirs = [ diff --git a/ldc.spec b/ldc.spec index b0be185..4607309 100644 --- a/ldc.spec +++ b/ldc.spec @@ -36,6 +36,9 @@ Source1: https://github.com/ldc-developers/ldc/releases/download/v%{boots %endif Source3: macros.%{name} +# Make sure /usr/include/d is in the include search path +Patch0: ldc-include-path.patch + ExclusiveArch: %{ldc_arches} %if ! 0%{?bootstrap_stage1} @@ -158,7 +161,7 @@ popd %endif %cmake -DMULTILIB:BOOL=OFF \ - -DINCLUDE_INSTALL_DIR:PATH=%{_includedir}/d \ + -DINCLUDE_INSTALL_DIR:PATH=%{_prefix}/lib/ldc/%{_target_platform}/include/d \ -DLLVM_CONFIG:PATH=llvm-config-%{?llvm_version:%{llvm_version}-}%{__isa_bits} \ %if 0%{?bootstrap_stage2} -DD_COMPILER:PATH=`pwd`/build-bootstrap2/bin/ldmd2 \ @@ -195,12 +198,15 @@ install -m0644 phobos.d.tags %{buildroot}/%{_datadir}/geany/tags/ %{_bindir}/ldc-profdata %{_bindir}/ldc-prune-cache %{_rpmconfigdir}/macros.d/macros.ldc -%dir %{_includedir}/d -%{_includedir}/d/core -%{_includedir}/d/etc -%{_includedir}/d/ldc -%{_includedir}/d/object.d -%{_includedir}/d/std +%dir %{_prefix}/lib/ldc +%dir %{_prefix}/lib/ldc/%{_target_platform} +%dir %{_prefix}/lib/ldc/%{_target_platform}/include +%dir %{_prefix}/lib/ldc/%{_target_platform}/include/d +%{_prefix}/lib/ldc/%{_target_platform}/include/d/core +%{_prefix}/lib/ldc/%{_target_platform}/include/d/etc +%{_prefix}/lib/ldc/%{_target_platform}/include/d/ldc +%{_prefix}/lib/ldc/%{_target_platform}/include/d/object.d +%{_prefix}/lib/ldc/%{_target_platform}/include/d/std %{_libdir}/libdruntime-ldc-debug-shared.so %{_libdir}/libdruntime-ldc-shared.so %{_libdir}/libldc-jit-rt.a @@ -238,6 +244,7 @@ install -m0644 phobos.d.tags %{buildroot}/%{_datadir}/geany/tags/ * Fri Aug 21 2020 Kalev Lember - 1:1.23.0-1 - Update to 1.23.0 - Merge -devel subpackages into the main ldc package +- Move ldc internal headers to /usr/lib/ldc to avoid conflicting with gdc (#1781685) * Fri Aug 21 2020 Kalev Lember - 1:1.20.1-5 - Explicitly build against llvm10 compat package