summaryrefslogtreecommitdiffstats
path: root/swift-lang.spec
blob: dd612b387e2e3cccb4eac58ece1d086655ac9388 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
%global debug_package %{nil}
%global sourcename apple-swift
%global sourcedir %{_tmppath}/%{sourcename}
%global builddir %{sourcedir}/builds
%global swifttag DEVELOPMENT-SNAPSHOT-2018-01-17-a
Name:           swift-lang
Version:        4.1
Release:        0.20180117git1381d08%{?dist}
Summary:        Apple's Swift programming language
License:        ASL 2.0
URL:            https://swift.org
Source0:        https://github.com/apple/swift/archive/swift-%{swifttag}.tar.gz#/swift.tar.gz
Source1:        https://github.com/apple/swift-compiler-rt/archive/swift-%{swifttag}.tar.gz#/swift-compiler-rt.tar.gz
Source2:        https://github.com/apple/swift-corelibs-libdispatch/archive/swift-%{swifttag}.tar.gz#/corelibs-libdispatch.tar.gz
Source3:        https://github.com/apple/swift-corelibs-foundation/archive/swift-%{swifttag}.tar.gz#/corelibs-foundation.tar.gz
Source4:        https://github.com/apple/swift-integration-tests/archive/swift-%{swifttag}.tar.gz#/swift-integration-tests.tar.gz
Source5:        https://github.com/apple/swift-corelibs-xctest/archive/swift-%{swifttag}.tar.gz#/corelibs-xctest.tar.gz
Source6:        https://github.com/apple/swift-clang/archive/swift-%{swifttag}.tar.gz#/clang.tar.gz
Source7:        https://github.com/apple/swift-package-manager/archive/swift-%{swifttag}.tar.gz#/package-manager.tar.gz
Source8:        https://github.com/apple/swift-lldb/archive/swift-%{swifttag}.tar.gz#/lldb.tar.gz
Source9:        https://github.com/apple/swift-llvm/archive/swift-%{swifttag}.tar.gz#/llvm.tar.gz
Source10:       https://github.com/apple/swift-llbuild/archive/swift-%{swifttag}.tar.gz#/llbuild.tar.gz
Source11:       https://github.com/apple/swift-cmark/archive/swift-%{swifttag}.tar.gz#/cmark.tar.gz
Source12:       https://github.com/apple/swift-xcode-playground-support/archive/swift-%{swifttag}.tar.gz#/swift-xcode-playground-support.tar.gz
Source13:       https://github.com/ninja-build/ninja/archive/v1.7.2.tar.gz#/ninja.tar.gz
BuildRequires: clang,libicu-devel,gcc-c++,cmake,libuuid-devel,libedit-devel,swig,pkgconfig,libbsd-devel,libxml2-devel,libsqlite3x-devel,python-devel,libblocksruntime-static

%description
Swift is a general-purpose programming language built using 
a modern approach to safety, performance, and software design 
patterns.

The goal of the Swift project is to create the best available 
language for uses ranging from systems programming, to mobile 
and desktop apps, scaling up to cloud services. Most 
importantly, Swift is designed to make writing and maintaining 
correct programs easier for the developer. 

%prep
rm -rf %{sourcedir}
mkdir -p %{sourcedir}

# Have to rearrange the directories the way the Swift
# build script is expecting it and the naming scheme
# is not standard, so a one-liner isn't gonna do it
pushd %{sourcedir}
tar xzf %{SOURCE0}
tar xzf %{SOURCE1}
tar xzf %{SOURCE2}
tar xzf %{SOURCE3}
tar xzf %{SOURCE4}
tar xzf %{SOURCE5}
tar xzf %{SOURCE6}
tar xzf %{SOURCE7}
tar xzf %{SOURCE8}
tar xzf %{SOURCE9}
tar xzf %{SOURCE10}
tar xzf %{SOURCE11}
tar xzf %{SOURCE12}
tar xzf %{SOURCE13}

mv swift-clang-swift-%{swifttag} clang
mv swift-cmark-swift-%{swifttag} cmark
mv swift-compiler-rt-swift-%{swifttag} compiler-rt
mv swift-corelibs-foundation-swift-%{swifttag} swift-corelibs-foundation
mv swift-corelibs-libdispatch-swift-%{swifttag} swift-corelibs-libdispatch
mv swift-corelibs-xctest-swift-%{swifttag} swift-corelibs-xctest
mv swift-integration-tests-swift-%{swifttag} swift-integration-tests
mv swift-llbuild-swift-%{swifttag} llbuild
mv swift-lldb-swift-%{swifttag} lldb
mv swift-llvm-swift-%{swifttag} llvm
mv swift-package-manager-swift-%{swifttag} swiftpm
mv swift-swift-%{swifttag} swift
mv swift-xcode-playground-support-swift-%{swifttag} swift-xcode-playground-support
mv ninja-1.7.2 ninja
popd

%build
%{sourcedir}/swift/utils/build-script --preset=buildbot_linux,no_test install_destdir=%{builddir} installable_package=%{builddir}/swift-%{version}-fedora.tar.gz

%install
cp -r %{builddir}/* %{buildroot}
rm %{buildroot}/swift-%{version}-fedora.tar.gz
chmod 0755 %{buildroot}%{_bindir}/*
chmod 0644 %{buildroot}/usr/share/man/man1/swift.1

%files
%{_bindir}/*
%{_mandir}/man1/swift.1.gz
%{_datarootdir}/swift/LICENSE.txt
%{_includedir}/*
%{_usr}/lib/*

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig

%changelog
* Tue Jan 16 2018 Ron Olson <tachoknight@gmail.com> 4.1_DEV-1
- Initial package for Fedora