| 
 | 1 | +%include metadata.inc  | 
 | 2 | + | 
 | 3 | +%global debug_package %{nil}  | 
 | 4 | + | 
 | 5 | +Name:           %{package_name}  | 
 | 6 | +Version:        %{package_version}  | 
 | 7 | +Release:        1%{?dist}  | 
 | 8 | +Summary:        %{package_summary}  | 
 | 9 | +License:        %{package_license}  | 
 | 10 | +URL:            %{package_url}  | 
 | 11 | + | 
 | 12 | +Source0:        https://github.com/apple/swift/archive/swift-%{swift_version}.tar.gz#/swift.tar.gz  | 
 | 13 | +Source1:        https://github.com/apple/swift-corelibs-libdispatch/archive/swift-%{swift_version}.tar.gz#/corelibs-libdispatch.tar.gz  | 
 | 14 | +Source2:        https://github.com/apple/swift-corelibs-foundation/archive/swift-%{swift_version}.tar.gz#/corelibs-foundation.tar.gz  | 
 | 15 | +Source3:        https://github.com/apple/swift-integration-tests/archive/swift-%{swift_version}.tar.gz#/swift-integration-tests.tar.gz  | 
 | 16 | +Source4:        https://github.com/apple/swift-corelibs-xctest/archive/swift-%{swift_version}.tar.gz#/corelibs-xctest.tar.gz  | 
 | 17 | +Source5:        https://github.com/apple/swift-package-manager/archive/swift-%{swift_version}.tar.gz#/package-manager.tar.gz  | 
 | 18 | +Source6:        https://github.com/apple/swift-llbuild/archive/swift-%{swift_version}.tar.gz#/llbuild.tar.gz  | 
 | 19 | +Source7:        https://github.com/apple/swift-cmark/archive/swift-%{swift_version}.tar.gz#/cmark.tar.gz  | 
 | 20 | +Source8:        https://github.com/apple/swift-xcode-playground-support/archive/swift-%{swift_version}.tar.gz#/swift-xcode-playground-support.tar.gz  | 
 | 21 | +Source9:        https://github.com/apple/sourcekit-lsp/archive/swift-%{swift_version}.tar.gz#/sourcekit-lsp.tar.gz  | 
 | 22 | +Source10:       https://github.com/apple/indexstore-db/archive/swift-%{swift_version}.tar.gz#/indexstore-db.tar.gz  | 
 | 23 | +Source11:       https://github.com/apple/llvm-project/archive/swift-%{swift_version}.tar.gz#/llvm-project.tar.gz  | 
 | 24 | +Source12:       https://github.com/apple/swift-tools-support-core/archive/swift-%{swift_version}.tar.gz#/swift-tools-support-core.tar.gz  | 
 | 25 | +Source13:       https://github.com/apple/swift-argument-parser/archive/%{swift_argument_parser_version}.tar.gz#/swift-argument-parser.tar.gz  | 
 | 26 | +Source14:       https://github.com/apple/swift-driver/archive/swift-%{swift_version}.tar.gz#/swift-driver.tar.gz  | 
 | 27 | +Source15:       https://github.com/unicode-org/icu/archive/release-%{icu_version}.tar.gz#/icu.tar.gz  | 
 | 28 | +Source16:       https://github.com/apple/swift-syntax/archive/swift-%{swift_version}.zip#/swift-syntax.tar.gz  | 
 | 29 | +Source17:       https://github.com/jpsim/Yams/archive/%{yams_version}.zip#/yams.tar.gz  | 
 | 30 | +Source18:       https://github.com/apple/swift-crypto/archive/refs/tags/%{swift_crypto_version}.tar.gz#/swift-crypto.tar.gz  | 
 | 31 | +Source19:       https://github.com/ninja-build/ninja/archive/refs/tags/v%{ninja_version}.tar.gz#/ninja.tar.gz  | 
 | 32 | + | 
 | 33 | +Patch0:         patches/swift-api-checker.patch  | 
 | 34 | +Patch1:         patches/hwasan_symbolize.patch  | 
 | 35 | + | 
 | 36 | +BuildRequires:  autoconf  | 
 | 37 | +BuildRequires:  cmake  | 
 | 38 | +BuildRequires:  devtoolset-8  | 
 | 39 | +BuildRequires:  glibc-static  | 
 | 40 | +BuildRequires:  libatomic  | 
 | 41 | +BuildRequires:  libcurl-devel  | 
 | 42 | +BuildRequires:  libedit-devel  | 
 | 43 | +BuildRequires:  libstdc++-static  | 
 | 44 | +BuildRequires:  libtool  | 
 | 45 | +BuildRequires:  libuuid-devel  | 
 | 46 | +BuildRequires:  libxml2-devel  | 
 | 47 | +BuildRequires:  llvm-toolset-7  | 
 | 48 | +BuildRequires:  make  | 
 | 49 | +BuildRequires:  ncurses-devel  | 
 | 50 | +BuildRequires:  ninja-build  | 
 | 51 | +BuildRequires:  openssl-devel  | 
 | 52 | +BuildRequires:  pexpect  | 
 | 53 | +BuildRequires:  python-devel  | 
 | 54 | +BuildRequires:  python3-devel  | 
 | 55 | +BuildRequires:  python-pygments  | 
 | 56 | +BuildRequires:  python-six  | 
 | 57 | +BuildRequires:  python36-pexpect  | 
 | 58 | +BuildRequires:  python36-six  | 
 | 59 | +BuildRequires:  PyYAML  | 
 | 60 | +BuildRequires:  rsync  | 
 | 61 | +BuildRequires:  sclo-git25-git  | 
 | 62 | +BuildRequires:  sqlite-devel  | 
 | 63 | +BuildRequires:  swig3  | 
 | 64 | +BuildRequires:  which  | 
 | 65 | +BuildRequires:  zlib-devel  | 
 | 66 | + | 
 | 67 | +Requires:       binutils  | 
 | 68 | +Requires:       gcc  | 
 | 69 | +Requires:       git  | 
 | 70 | +Requires:       glibc-static  | 
 | 71 | +Requires:       libbsd-devel  | 
 | 72 | +Requires:       libedit  | 
 | 73 | +Requires:       libedit-devel  | 
 | 74 | +Requires:       libicu-devel  | 
 | 75 | +Requires:       libstdc++-static  | 
 | 76 | +Requires:       pkg-config  | 
 | 77 | +Requires:       python3  | 
 | 78 | +Requires:       sqlite  | 
 | 79 | +Requires:       zlib-devel  | 
 | 80 | + | 
 | 81 | +ExclusiveArch:  x86_64 aarch64  | 
 | 82 | + | 
 | 83 | +%description  | 
 | 84 | +Swift is a general-purpose programming language built using  | 
 | 85 | +a modern approach to safety, performance, and software design  | 
 | 86 | +patterns.  | 
 | 87 | + | 
 | 88 | +The goal of the Swift project is to create the best available  | 
 | 89 | +language for uses ranging from systems programming, to mobile  | 
 | 90 | +and desktop apps, scaling up to cloud services. Most  | 
 | 91 | +importantly, Swift is designed to make writing and maintaining  | 
 | 92 | +correct programs easier for the developer.  | 
 | 93 | + | 
 | 94 | +%prep  | 
 | 95 | +%setup -q -c -n %{swift_source_location} -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  | 
 | 96 | +# The Swift build script requires directories to be named  | 
 | 97 | +# in a specific way so renaming the source directories is  | 
 | 98 | +# necessary  | 
 | 99 | +mv swift-cmark-swift-%{swift_version} cmark  | 
 | 100 | +mv swift-corelibs-foundation-swift-%{swift_version} swift-corelibs-foundation  | 
 | 101 | +mv swift-corelibs-libdispatch-swift-%{swift_version} swift-corelibs-libdispatch  | 
 | 102 | +mv swift-corelibs-xctest-swift-%{swift_version} swift-corelibs-xctest  | 
 | 103 | +mv swift-integration-tests-swift-%{swift_version} swift-integration-tests  | 
 | 104 | +mv swift-llbuild-swift-%{swift_version} llbuild  | 
 | 105 | +mv swift-package-manager-swift-%{swift_version} swiftpm  | 
 | 106 | +mv swift-swift-%{swift_version} swift  | 
 | 107 | +mv swift-xcode-playground-support-swift-%{swift_version} swift-xcode-playground-support  | 
 | 108 | +mv sourcekit-lsp-swift-%{swift_version} sourcekit-lsp  | 
 | 109 | +mv indexstore-db-swift-%{swift_version} indexstore-db  | 
 | 110 | +mv llvm-project-swift-%{swift_version} llvm-project  | 
 | 111 | +mv swift-syntax-swift-%{swift_version} swift-syntax  | 
 | 112 | +mv swift-tools-support-core-swift-%{swift_version} swift-tools-support-core  | 
 | 113 | +mv swift-argument-parser-%{swift_argument_parser_version} swift-argument-parser  | 
 | 114 | +mv swift-driver-swift-%{swift_version} swift-driver  | 
 | 115 | +mv swift-crypto-%{swift_crypto_version} swift-crypto  | 
 | 116 | +mv ninja-%{ninja_version} ninja  | 
 | 117 | + | 
 | 118 | +# ICU  | 
 | 119 | +mv icu-release-%{icu_version} icu  | 
 | 120 | + | 
 | 121 | +# Yams  | 
 | 122 | +mv Yams-%{yams_version} yams  | 
 | 123 | + | 
 | 124 | +# Adjust python version swift-api-checker  | 
 | 125 | +%patch0 -p1  | 
 | 126 | + | 
 | 127 | +# Adjust python version hwasan_symbolize  | 
 | 128 | +%patch1 -p1  | 
 | 129 | + | 
 | 130 | +# Fix python to python3  | 
 | 131 | +ln -s /usr/bin/python3 /usr/bin/python  | 
 | 132 | + | 
 | 133 | +%build  | 
 | 134 | +export VERBOSE=1  | 
 | 135 | + | 
 | 136 | +# Run the build  | 
 | 137 | +swift/utils/build-script --preset=buildbot_linux,no_test install_destdir=%{_builddir} installable_package=%{_builddir}/swift-%{version}-centos8.tar.gz  | 
 | 138 | + | 
 | 139 | +%install  | 
 | 140 | +mkdir -p %{buildroot}%{_libexecdir}/swift/  | 
 | 141 | +cp -r %{_builddir}/usr/* %{buildroot}%{_libexecdir}/swift  | 
 | 142 | +mkdir -p %{buildroot}%{_bindir}  | 
 | 143 | +ln -fs %{_libexecdir}/swift/bin/swift %{buildroot}%{_bindir}/swift  | 
 | 144 | +ln -fs %{_libexecdir}/swift/bin/swiftc %{buildroot}%{_bindir}/swiftc  | 
 | 145 | +ln -fs %{_libexecdir}/swift/bin/sourcekit-lsp %{buildroot}%{_bindir}/sourcekit-lsp  | 
 | 146 | +mkdir -p %{buildroot}%{_mandir}/man1  | 
 | 147 | +cp %{_builddir}/usr/share/man/man1/swift.1 %{buildroot}%{_mandir}/man1/swift.1  | 
 | 148 | + | 
 | 149 | +%files  | 
 | 150 | +%license swift/LICENSE.txt  | 
 | 151 | +%{_bindir}/swift  | 
 | 152 | +%{_bindir}/swiftc  | 
 | 153 | +%{_bindir}/sourcekit-lsp  | 
 | 154 | +%{_mandir}/man1/swift.1.gz  | 
 | 155 | +%{_libexecdir}/swift/  | 
 | 156 | + | 
 | 157 | +%post -p /sbin/ldconfig  | 
 | 158 | +%postun -p /sbin/ldconfig  | 
 | 159 | + | 
 | 160 | +%changelog  | 
0 commit comments