blob: 4bf97c48ae5b12f8f06728bf23297bd98745b252 (
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
|
# Maintainer: Susurri <susurrus dot silent at gmail dot com>
# Contributor: Miten <git dot pub at icloud dot com>
# Contributor: Ryan Gonzalez <rymg19 at gmail dot com>
# Contributor: Frederic Bezies <fredbezies at gmail dot com>, youngunix <>
pkgname=swift-bin
pkgver=6.0.3
pkgrel=1
pkgdesc="Binary builds of the Swift programming language"
arch=('x86_64' 'aarch64')
url="https://www.swift.org/"
license=('apache')
depends=('util-linux-libs' 'libxml2' 'ncurses')
makedepends=('patchelf')
optdepends=('python39: required for REPL')
options=('!strip')
provides=('swift-language')
replaces=('swift-language-bin')
source_x86_64=("https://download.swift.org/swift-$pkgver-release/ubi9/swift-$pkgver-RELEASE/swift-$pkgver-RELEASE-ubi9.tar.gz")
source_aarch64=("https://download.swift.org/swift-$pkgver-release/ubi9-aarch64/swift-$pkgver-RELEASE/swift-$pkgver-RELEASE-ubi9-aarch64.tar.gz")
sha256sums_x86_64=('6561f706f18b93e42af1ef330e11bbb86a77a7cc39825e87b7669aa255a38078')
sha256sums_aarch64=('e47b588333f8a81fc7e9fd82f488bab8fea789676aae9d247f4d260fc8ae8b34')
package() {
find_elf_only() {
find "${pkgdir}/usr/lib/swift" \
-executable -type f \
'(' -path '*/bin/*' -o -name '*.so*' ')' \
-not '(' -name '*.py' -o -name 'hwasan_symbolize' ')' \
"$@"
}
_archsuffix=""
if [[ $CARCH == "aarch64" ]]; then
_archsuffix="-aarch64"
fi
mkdir -p "${pkgdir}/usr/lib/swift"
cp -Ppr "${srcdir}/swift-$pkgver-RELEASE-ubi9${_archsuffix}"/usr/* "${pkgdir}/usr/lib/swift"
# Symlink the desired binaries to /usr/bin
mkdir -p "${pkgdir}/usr/bin"
for bin in sourcekit-lsp swift swiftc; do
ln -s "/usr/lib/swift/bin/$bin" "${pkgdir}/usr/bin/$bin"
done
# Patch the binaries to use the changed ncurses names
patchelf=(patchelf)
for lib in ncurses panel form; do
patchelf+=(--replace-needed "lib${lib}.so.6" "lib${lib}w.so")
done
find_elf_only -exec "${patchelf[@]}" {} \;
install -dm755 "${pkgdir}/etc/ld.so.conf.d"
echo '/usr/lib/swift/lib/swift/linux' >> "${pkgdir}/etc/ld.so.conf.d/swift.conf"
}
|