summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorRyan Gonzalez2020-05-03 19:26:58 -0500
committerRyan Gonzalez2020-05-03 19:26:58 -0500
commitb94aa505bba4b76288cfcaeffd8add5dc1eeb6c5 (patch)
tree1b4d292bab0ca92fdfbe1c1727d103b26bca91e8 /PKGBUILD
parent9d12721c8767bb24ea5a3249fadc4a8c6994eb25 (diff)
downloadaur-b94aa505bba4b76288cfcaeffd8add5dc1eeb6c5.tar.gz
Updates
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD67
1 files changed, 21 insertions, 46 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 4fac2e037312..1b527af6128d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
# Contributor: Frederic Bezies <fredbezies at gmail dot com>, youngunix <>
pkgname=swift-bin
-pkgver=5.1.5
+pkgver=5.2.3
pkgrel=1
pkgdesc="Binary builds of the Swift programming language"
arch=('x86_64')
@@ -15,61 +15,36 @@ options=('!strip')
provides=('swift-language')
replaces=('swift-language-bin')
_urlbase='https://download.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/Packages/s'
-_fullver="$pkgver-0.3.20200305git30c042c.fc33.x86_64"
-source=(
- "$_urlbase/swift-lang-$_fullver.rpm"
- "$_urlbase/swift-lang-runtime-$_fullver.rpm"
-)
-sha256sums=('359f43fe3455f3ab8da37cb98796c6740e3defce335f0133b933945a239f6b95'
- '030723fd4639eb04a466544f5536b060353c5567f4b56ecc0dbff7964e90ceb6')
+source=("$_urlbase/swift-lang-$pkgver-1.fc33.x86_64.rpm")
+sha256sums=('5b960d79ed8bb755ccb5fa37a0cb82903a6fad656104952fbb0940c08a693020')
package() {
- cp -Ppr "${srcdir}"/{etc,usr} "${pkgdir}"
+ find_elf_only() {
+ find "${pkgdir}/usr/lib/swift" \
+ -executable -type f \
+ '(' -path '*/bin/*' -o -name '*.so*' ')' \
+ -not -name '*.py' \
+ "$@"
+ }
- # Okay, so some hackery that you'll see soon needs to be explained a bit:
- # These Swift binaries want libncurses.so.6 and family, but Arch provides them under
- # libncursesw.so. An original copy of this package just symlinked the names, but then
- # ldconfig picked them up, which lead to the wrong paths being placed into the initramfs...
- # leaving an unbootable system.
+ cp -Ppr "${srcdir}"/usr "${pkgdir}"
- # Ideally we'd be able to use patchelf --replace-needed, but that's not possible due to a glibc
- # bug that cuases ldconfig to misread the SONAME and generate screwy symlinks:
- # https://sourceware.org/bugzilla/show_bug.cgi?id=24294
-
- # Therefore, instead we need to follow this process:
- # - Replace /usr/lib/swift/linux from ld.so.conf.d with /usr/lib/swift/linux/export.
- # - Symlink all the libraries in /usr/lib/swift/linux to /usr/lib/swift/linux/export.
- # - Create the .so.6 symlinks in /usr/lib/swift/linux.
-
- # Merge ld.so.conf.d files from the two packages
- cat "${pkgdir}/etc/ld.so.conf.d/swift-lang-runtime.conf" >> \
- "${pkgdir}/etc/ld.so.conf.d/swift-lang.conf"
- rm "${pkgdir}/etc/ld.so.conf.d/swift-lang-runtime.conf"
- sed -i 's|swift/linux|swift/linux/export|' "${pkgdir}/etc/ld.so.conf.d/swift-lang.conf"
+ # Merge libexec and lib
+ mv "${pkgdir}/usr/"{libexec/*,lib}
+ rmdir "${pkgdir}/usr/libexec"
- # Create the exported so symlinks
- mkdir -p "${pkgdir}/usr/lib/swift/linux/export"
- for path in "${pkgdir}/usr/lib/swift/linux/"*.so; do
- ln -s ../$(basename "$path") "${pkgdir}/usr/lib/swift/linux/export"
+ # Rewrite the symlinks and binaries to use lib instead of libexec
+ find_elf_only -exec sed -i 's|/usr/libexec|/usr/lib/./.|g' {} \;
+ for bin in "${pkgdir}/usr/bin/"*; do
+ ln -sf /usr/lib/swift/bin/${bin##*/} $bin
done
# Create the needed aliases for libncurses
+ patchelf=(patchelf)
for lib in ncurses panel form; do
- ln -s ../../lib${lib}w.so "${pkgdir}/usr/lib/swift/linux/lib${lib}.so.6"
+ patchelf+=(--replace-needed "lib${lib}.so.6" "lib${lib}w.so")
done
-
- # Merge libexec and lib
- # XXX: can't do this yet, moving it from libexec completely kills the REPL for some reason
- # find "${pkgdir}" -executable -type f -exec sed -i 's|/usr/libexec|/////usr/lib|g' {} \;
- # mv "${pkgdir}/usr/"{libexec/swift-lldb/*,lib/swift-lldb}
- # rmdir "${pkgdir}/usr/libexec/swift-lldb"
- # rmdir "${pkgdir}/usr/libexec"
-
- # Make sure swift-lldb files pick up the symlinks from above
- # XXX: remove libexec once it is dropped
- find "${pkgdir}/usr/"{lib,libexec}/swift-lldb -executable -type f -exec \
- patchelf --set-rpath '/usr/lib/swift/linux' {} \;
- patchelf --set-rpath '/usr/lib/swift/linux' "${pkgdir}/usr/bin/swift-build-tool"
+ find_elf_only -exec "${patchelf[@]}" {} \;
# Rename the LICENSE file directory
mv "${pkgdir}/usr/share/licenses/swift-"{lang,bin}