Sorry to complain, but you also forgot to update the .SRCINFO
;)
12 hours Update pkgrel Ryan Gonzalez
13 hours Update .gitignore Ryan Gonzalez
13 hours Forgot to commit... Ryan Gonzalez
Git Clone URL: | https://aur.archlinux.org/swift-bin.git (read-only, click to copy) |
---|---|
Package Base: | swift-bin |
Description: | Binary builds of the Swift programming language |
Upstream URL: | https://www.swift.org/ |
Keywords: | apple language swift swiftlang |
Licenses: | Apache |
Provides: | swift-language |
Replaces: | swift-language-bin |
Submitter: | ashleyis |
Maintainer: | susurri |
Last Packager: | susurri |
Votes: | 90 |
Popularity: | 1.16 |
First Submitted: | 2015-12-04 17:31 (UTC) |
Last Updated: | 2024-12-13 09:52 (UTC) |
« First ‹ Previous 1 .. 5 6 7 8 9 10 11 12 13 14 15 16 Next › Last »
Sorry to complain, but you also forgot to update the .SRCINFO
;)
12 hours Update pkgrel Ryan Gonzalez
13 hours Update .gitignore Ryan Gonzalez
13 hours Forgot to commit... Ryan Gonzalez
@wezm Sorry, that should be fixed now. I somehow managed to miss committing a small but necessary change that therefore broke swiftc.
FYI I installed this and tried to build some projects that use swift package manager and they all failed with an error like, "The manifest file at /path/to/a/file is empty". I then built swift form source using the swift AUR package, which also has the 4.0.3 version and it appears to work.
Orphaning it. Refi.64, here you go. Good luck :)
@FredBezies Ok, that would be great!
@refi.64 : if you want it, I can orphan it in order to give it to you. Just ask.
@FredBezies: I guess so? I mean, I'm working on some Swift projects (I used Ubuntu before, and haven't been able to work on them since switching to Arch, because of obvious reasons), so I guess I have some incentive. ;)
@refi.64: if you want to adopt swift-bin package, I'll give it to you. I'm not using anymore this package. So...
After a long time of experimenting with various things, I FINALLY have a fully, 100% working version of the Swift binaries. No more libcurl errors, no more version warnings, no more include header issues.
Of course, the con is that this is a hot mess. It creates a custom ld.so without version warnings (to ensure that building works), patches the proper libcurl.so (same thing), and - worst of all - uses bubblewrap to add a custom clang++ that patches ld.so on all built files. It's a hot mess, but it works perfectly. I've successfully built several sample applications with it.
Here's the patch:
diff --git a/PKGBUILD b/PKGBUILD
index [`852e3ec`](https://aur.archlinux.org/cgit/aur.git/commit/?h=swift-bin&id=852e3ec)..3fbd753 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,13 +9,14 @@ pkgdesc="Official binary builds of the Swift programming language."
arch=('x86_64')
url="<https://swift.org>"
license=('apache')
-depends=('icu55' 'ncurses5-compat-libs' 'libedit' 'python2' 'libutil-linux' 'libbsd' 'clang' 'python2-six' 'libxml2')
+depends=('icu55' 'ncurses5-compat-libs' 'libedit' 'python2' 'libutil-linux' 'libbsd' 'clang' 'python2-six' 'libxml2' 'libcurl-compat' 'patchelf' 'bubblewrap')
+makedepends=('qldv-git')
conflicts=('lldb' 'swift-language-git')
options=('!strip')
validpgpkeys=('5E4DF843FB065D7F7E24FBA2EF5430F071E1B235')
provides=('swift-language')
replaces=('swift-language-bin')
-source=(
+source=(
"<https://swift.org/builds/swift>-${_version}-release/ubuntu1604/swift-${_version}-RELEASE/swift-${_version}-RELEASE-ubuntu16.04.tar.gz"
"<https://swift.org/builds/swift>-${_version}-release/ubuntu1604/swift-${_version}-RELEASE/swift-${_version}-RELEASE-ubuntu16.04.tar.gz.sig"
)
@@ -24,6 +25,7 @@ sha256sums=('9adf64cabc7c02ea2d08f150b449b05e46bd42d6e542bf742b3674f5c37f0dbf'
package() {
tar -C "$pkgdir" -xf "swift-${_version}-RELEASE"*.tar.gz --strip 1
+ mkdir -p "${pkgdir}/usr/lib/swift/arch"
# Permission fix
find "${pkgdir}" -type d -exec chmod 755 {} +
@@ -31,23 +33,41 @@ package() {
# Remove all unnecessary stuff
rm -rf "${pkgdir}/usr/local"
- # Yuck! patching libedit SONAME
+ # Yuck! patching libedit and libcurl SONAMEs
find "${pkgdir}/usr/bin" -type f -exec sed -i 's/libedit\.so\.2/libedit\.so\.0/g' {} \;
find "${pkgdir}/usr/lib" -type f -exec sed -i 's/libedit\.so\.2/libedit\.so\.0/g' {} \;
+ sed -i 's/libcurl\.so\.4/libcurl\.so\.3/g' "${pkgdir}/usr/lib/swift/linux/libFoundation.so"
- # remove the six.py dumped in python's site packages
+ # Patch the ld interpreter to avoid version warnings
+ qldv "`qldv -find`" "${pkgdir}/usr/lib/swift/arch/ld.so"
+ find "${pkgdir}/usr/bin" -type f -exec patchelf --set-interpreter '/usr/lib/swift/arch/ld.so' {} \;
+
+ # Hack to ensure Swift runs patchelf on output files to fix the libcurl version warnings
+ ln -sf "../../../bin/swift" "${pkgdir}/usr/lib/swift/arch/swiftc"
+ rm "${pkgdir}/usr/bin/swiftc"
+ echo '#!/bin/bash' > "${pkgdir}/usr/bin/swiftc"
+ # bwrap is used to alias the original Clang as cc, then replace Clang with a wrapper script.
+ echo 'bwrap --dev-bind / / --bind /usr/bin/clang /usr/bin/cc --bind /usr/lib/swift/arch/clang++ /usr/bin/clang++ /usr/lib/swift/arch/swiftc "$@"'
+
+ echo '#!/bin/bash' > "${pkgdir}/usr/lib/swift/arch/clang++"
+ echo '( exec -a clang++ cc "$@" ) && patchelf --set-interpreter /usr/lib/swift/arch/ld.so "${@: -1}"' >> "${pkgdir}/usr/lib/swift/arch/clang++"
+
+ chmod +x "${pkgdir}/usr/bin/swiftc" "${pkgdir}/usr/lib/swift/arch/clang++"
+
+ # Patch the module files
+ sed -i 's|x86_64-linux-gnu/||' "${pkgdir}/usr/lib/swift/linux/x86_64/glibc.modulemap"
+ sed -i 's|x86_64-linux-gnu/||' "${pkgdir}/usr/lib/swift_static/linux/static-stdlib-args.lnk"
+
+ # Remove the six.py dumped in python's site packages
rm "${pkgdir}/usr/lib/python2.7/site-packages/six.py"
rm "${pkgdir}/usr/lib/python2.7/site-packages/six.pyc"
# Ensure the items have the right permissions..
# some tarballs from upstream seem to have the wrong ones
find "${pkgdir}/usr/bin" -type f -exec chmod a+rx {} \;
- find "${pkgdir}/usr/lib" -type f -exec chmod a+r {} \;
+ find "${pkgdir}/usr/lib" -type f -exec chmod a+r {} \;
# Move license
install -dm755 ${pkgdir}/usr/share/licenses/${pkgname}
mv ${pkgdir}/usr/share/swift/LICENSE.txt ${pkgdir}/usr/share/licenses/${pkgname}
}
-
-
-
Pinned Comments