From cc5d6886184b964baf678f2810e87bfd5af78ae7 Mon Sep 17 00:00:00 2001 From: Link Dupont Date: Mon, 8 Jun 2026 09:38:29 +0000 Subject: [PATCH 1/2] Split runtime libraries into a separate subpackage --- swift-lang.spec | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/swift-lang.spec b/swift-lang.spec index 70f1f58..360ba06 100644 --- a/swift-lang.spec +++ b/swift-lang.spec @@ -278,6 +278,7 @@ BuildRequires: kernel-cross-headers Requires: glibc-devel Requires: lld Requires: gcc +Requires: %{name}-runtime = %{version}-%{release} Recommends: libstdc++-devel Recommends: gcc-c++ @@ -315,6 +316,18 @@ and desktop apps, scaling up to cloud services. Most importantly, Swift is designed to make writing and maintaining correct programs easier for the developer. +%package runtime +Summary: Swift runtime libraries + +%description runtime +Swift is a general-purpose programming language built using +a modern approach to safety, performance, and software design +patterns. + +This package contains the Swift runtime libraries needed to run +applications built with Swift. + + %prep %forgesetup -a @@ -535,15 +548,6 @@ export QA_SKIP_RPATHS=1 # Man pages %{_mandir}/man1/swift.1.gz -# Swift runtime libraries (what users link against) -%{_libdir}/libswift*.so* -%{_libdir}/libFoundation*.so* -%{_libdir}/libdispatch.so* -%{_libdir}/libBlocksRuntime.so* -%{_libdir}/libTesting.so* -%{_libdir}/libXCTest.so* -%{_libdir}/lib_*.so* - # SourceKit/IndexStore public libraries %{_libdir}/libIndexStore.so* %{_libdir}/libsourcekitdInProc.so* @@ -561,6 +565,17 @@ export QA_SKIP_RPATHS=1 # Data files (diagnostics, features.json, etc.) %{_datadir}/swift/ +%files runtime +%license swift/LICENSE.txt + +%{_libdir}/libswift*.so* +%{_libdir}/libFoundation*.so* +%{_libdir}/libdispatch.so* +%{_libdir}/libBlocksRuntime.so* +%{_libdir}/libTesting.so* +%{_libdir}/libXCTest.so* +%{_libdir}/lib_*.so* + # Dynamic linker configuration %{_sysconfdir}/ld.so.conf.d/swiftlang.conf @@ -568,6 +583,9 @@ export QA_SKIP_RPATHS=1 %post -p /sbin/ldconfig %postun -p /sbin/ldconfig +%post runtime -p /sbin/ldconfig +%postun runtime -p /sbin/ldconfig + %changelog %autochangelog From 50f7ca358e3197bcdd5fc429b491dd49886e8e30 Mon Sep 17 00:00:00 2001 From: Link Dupont Date: Tue, 30 Jun 2026 11:05:02 +0000 Subject: [PATCH 2/2] Move libIndexStore.so to private toolchain library path (RHBZ#2493390) --- swift-lang.spec | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/swift-lang.spec b/swift-lang.spec index 360ba06..b24bf79 100644 --- a/swift-lang.spec +++ b/swift-lang.spec @@ -455,15 +455,15 @@ if [ -f %{_builddir}/build/fedora_final/swift-linux-%{_arch}/lib/libsourcekitdIn cp -a %{_builddir}/build/fedora_final/swift-linux-%{_arch}/lib/libsourcekitdInProc.so %{_builddir}/usr/lib/ fi -# Install SourceKit/IndexStore public libraries +# Install private libraries to toolchain lib dir for lib in libIndexStore.so libIndexStore.so.17.0 libsourcekitdInProc.so libswiftDemangle.so; do if [ -f %{_builddir}/usr/lib/$lib ]; then - install -m 0755 %{_builddir}/usr/lib/$lib %{buildroot}%{_libdir}/ + install -m 0755 %{_builddir}/usr/lib/$lib %{buildroot}%{_libexecdir}/swift/%{version}/lib/ fi done -# Create any missing version symlinks -if [ -f %{buildroot}%{_libdir}/libIndexStore.so.17.0 ] && [ ! -e %{buildroot}%{_libdir}/libIndexStore.so ]; then - ln -sf libIndexStore.so.17.0 %{buildroot}%{_libdir}/libIndexStore.so +# Create any missing version symlinks in private dir +if [ -f %{buildroot}%{_libexecdir}/swift/%{version}/lib/libIndexStore.so.17.0 ] && [ ! -e %{buildroot}%{_libexecdir}/swift/%{version}/lib/libIndexStore.so ]; then + ln -sf libIndexStore.so.17.0 %{buildroot}%{_libexecdir}/swift/%{version}/lib/libIndexStore.so fi # Install lldb libraries to %{_libexecdir} (private, bundled with Swift toolchain) @@ -548,10 +548,10 @@ export QA_SKIP_RPATHS=1 # Man pages %{_mandir}/man1/swift.1.gz -# SourceKit/IndexStore public libraries -%{_libdir}/libIndexStore.so* -%{_libdir}/libsourcekitdInProc.so* -%{_libdir}/libswiftDemangle.so* +# SourceKit/IndexStore/SwiftDemangle private libraries +%{_libexecdir}/swift/%{version}/lib/libIndexStore.so* +%{_libexecdir}/swift/%{version}/lib/libsourcekitdInProc.so* +%{_libexecdir}/swift/%{version}/lib/libswiftDemangle.so* # Compatibility symlink for module lookup %{_libdir}/swift