Skip to content

Commit 9a060c7

Browse files
authored
Merge pull request swiftlang#30 from tomerd/fix/centos8-ninja
build ninja from source
2 parents 92736ca + 44fa802 commit 9a060c7

File tree

2 files changed

+14
-40
lines changed

2 files changed

+14
-40
lines changed

platforms/Linux/centos/8/patches/build-presets.patch

Lines changed: 0 additions & 23 deletions
This file was deleted.

platforms/Linux/centos/8/swift-lang.spec

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
%global swiftbuild swift-source
44
%global icu_version 65-1
55
%global yams_version 4.0.2
6-
%global sap_version 0.4.3
6+
%global swift_argument_parser_version 0.4.3
77
%global swift_crypto_version 1.1.5
8+
%global ninja_version 1.10.2
89

910
Name: swift-lang
1011
Version: 5.5
@@ -26,16 +27,16 @@ Source9: https://github.com/apple/sourcekit-lsp/archive/swift-%{swifttag}
2627
Source10: https://github.com/apple/indexstore-db/archive/swift-%{swifttag}.tar.gz#/indexstore-db.tar.gz
2728
Source11: https://github.com/apple/llvm-project/archive/swift-%{swifttag}.tar.gz#/llvm-project.tar.gz
2829
Source12: https://github.com/apple/swift-tools-support-core/archive/swift-%{swifttag}.tar.gz#/swift-tools-support-core.tar.gz
29-
Source13: https://github.com/apple/swift-argument-parser/archive/%{sap_version}.tar.gz
30+
Source13: https://github.com/apple/swift-argument-parser/archive/%{swift_argument_parser_version}.tar.gz#/swift-argument-parser.tar.gz
3031
Source14: https://github.com/apple/swift-driver/archive/swift-%{swifttag}.tar.gz#/swift-driver.tar.gz
31-
Source15: https://github.com/unicode-org/icu/archive/release-%{icu_version}.tar.gz
32+
Source15: https://github.com/unicode-org/icu/archive/release-%{icu_version}.tar.gz#/icu.tar.gz
3233
Source16: https://github.com/apple/swift-syntax/archive/swift-%{swifttag}.zip#/swift-syntax.tar.gz
33-
Source17: https://github.com/jpsim/Yams/archive/%{yams_version}.zip
34-
Source18: https://github.com/apple/swift-crypto/archive/refs/tags/%{swift_crypto_version}.tar.gz
34+
Source17: https://github.com/jpsim/Yams/archive/%{yams_version}.zip#/yams.tar.gz
35+
Source18: https://github.com/apple/swift-crypto/archive/refs/tags/%{swift_crypto_version}.tar.gz#/swift-crypto.tar.gz
36+
Source19: https://github.com/ninja-build/ninja/archive/refs/tags/v%{ninja_version}.tar.gz#/ninja.tar.gz
3537

36-
Patch0: patches/build-presets.patch
37-
Patch1: patches/swift-api-checker.patch
38-
Patch2: patches/hwasan_symbolize.patch
38+
Patch0: patches/swift-api-checker.patch
39+
Patch1: patches/hwasan_symbolize.patch
3940

4041
BuildRequires: autoconf
4142
BuildRequires: clang
@@ -53,7 +54,6 @@ BuildRequires: libuuid-devel
5354
BuildRequires: libxml2-devel
5455
BuildRequires: make
5556
BuildRequires: ncurses-devel
56-
BuildRequires: ninja-build
5757
BuildRequires: pcre-devel
5858
BuildRequires: python2
5959
BuildRequires: python2-devel
@@ -96,7 +96,7 @@ importantly, Swift is designed to make writing and maintaining
9696
correct programs easier for the developer.
9797

9898
%prep
99-
%setup -q -c -n %{swiftbuild} -a 0 -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 -a 7 -a 8 -a 9 -a 10 -a 11 -a 12 -a 13 -a 14 -a 15 -a 16 -a 17 -a 18
99+
%setup -q -c -n %{swiftbuild} -a 0 -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 -a 7 -a 8 -a 9 -a 10 -a 11 -a 12 -a 13 -a 14 -a 15 -a 16 -a 17 -a 18 -a 19
100100
# The Swift build script requires directories to be named
101101
# in a specific way so renaming the source directories is
102102
# necessary
@@ -114,24 +114,22 @@ mv indexstore-db-swift-%{swifttag} indexstore-db
114114
mv llvm-project-swift-%{swifttag} llvm-project
115115
mv swift-syntax-swift-%{swifttag} swift-syntax
116116
mv swift-tools-support-core-swift-%{swifttag} swift-tools-support-core
117-
mv swift-argument-parser-%{sap_version} swift-argument-parser
117+
mv swift-argument-parser-%{swift_argument_parser_version} swift-argument-parser
118118
mv swift-driver-swift-%{swifttag} swift-driver
119119
mv swift-crypto-%{swift_crypto_version} swift-crypto
120+
mv ninja-%{ninja_version} ninja
120121

121122
# ICU
122123
mv icu-release-%{icu_version} icu
123124

124125
# Yams
125126
mv Yams-%{yams_version} yams
126127

127-
# Adjust presets
128-
%patch0 -p0
129-
130128
# Adjust python version swift-api-checker
131-
%patch1 -p1
129+
%patch0 -p1
132130

133131
# Adjust python version hwasan_symbolize
134-
%patch2 -p1
132+
%patch1 -p1
135133

136134
# Fix python to python3
137135
ln -s /usr/bin/python3 /usr/bin/python
@@ -163,5 +161,4 @@ cp %{_builddir}/usr/share/man/man1/swift.1 %{buildroot}%{_mandir}/man1/swift.1
163161
%post -p /sbin/ldconfig
164162
%postun -p /sbin/ldconfig
165163

166-
167164
%changelog

0 commit comments

Comments
 (0)