diff options
-rw-r--r-- | .SRCINFO | 146 | ||||
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | .gitlab-ci.yml | 31 | ||||
-rw-r--r-- | 0001-arch-aur-patches.patch | 106 | ||||
-rw-r--r-- | PKGBUILD | 349 | ||||
-rw-r--r-- | glibc-includes.patch | 131 | ||||
-rw-r--r-- | repl_swift-dl.patch | 12 | ||||
-rw-r--r-- | swift-tests-glibc.patch | 40 | ||||
-rw-r--r-- | swiftpm-glibc.patch | 25 |
9 files changed, 411 insertions, 437 deletions
@@ -1,70 +1,98 @@ pkgbase = swift-language pkgdesc = The Swift programming language and debugger - pkgver = 5.1.2 - pkgrel = 1 - url = http://swift.org/ - arch = i686 + pkgver = 5.9.2 + pkgrel = 2 + url = https://github.com/apple/swift arch = x86_64 - license = apache - makedepends = git + license = Apache-2.0 + makedepends = clang makedepends = cmake + makedepends = git + makedepends = lld + makedepends = llvm makedepends = ninja - makedepends = swig3 - makedepends = clang>=5.0 - makedepends = python2-six - makedepends = perl - makedepends = python2-sphinx - makedepends = python2-requests + makedepends = patch + makedepends = python-six makedepends = rsync - depends = python2 - depends = libutil-linux + makedepends = swift-language + makedepends = swig depends = icu - depends = libbsd depends = libedit depends = libxml2 - depends = sqlite + depends = python + depends = libbsd depends = ncurses - depends = libblocksruntime - source = swift-5.1.2-RELEASE.tar.gz::https://github.com/apple/swift/archive/swift-5.1.2-RELEASE.tar.gz - source = llvm-project-5.1.2-RELEASE.tar.gz::https://github.com/apple/llvm-project/archive/swift-5.1.2-RELEASE.tar.gz - source = swift-cmark-5.1.2-RELEASE.tar.gz::https://github.com/apple/swift-cmark/archive/swift-5.1.2-RELEASE.tar.gz - source = swift-llbuild-5.1.2-RELEASE.tar.gz::https://github.com/apple/swift-llbuild/archive/swift-5.1.2-RELEASE.tar.gz - source = swift-package-manager-5.1.2-RELEASE.tar.gz::https://github.com/apple/swift-package-manager/archive/swift-5.1.2-RELEASE.tar.gz - source = swift-corelibs-xctest-5.1.2-RELEASE.tar.gz::https://github.com/apple/swift-corelibs-xctest/archive/swift-5.1.2-RELEASE.tar.gz - source = swift-corelibs-foundation-5.1.2-RELEASE.tar.gz::https://github.com/apple/swift-corelibs-foundation/archive/swift-5.1.2-RELEASE.tar.gz - source = swift-corelibs-libdispatch-5.1.2-RELEASE.tar.gz::https://github.com/apple/swift-corelibs-libdispatch/archive/swift-5.1.2-RELEASE.tar.gz - source = swift-integration-tests-5.1.2-RELEASE.tar.gz::https://github.com/apple/swift-integration-tests/archive/swift-5.1.2-RELEASE.tar.gz - source = glibc-includes.patch - source = repl_swift-dl.patch - source = swiftpm-glibc.patch - source = swift-tests-glibc.patch - sha256sums = ad7f569ca505f349b4e499ed781f53030afe068644c72e76a5d6fbb7b5b80b86 - sha256sums = d045b1d42933f4d34b24f5434438bbdce4a18341964be019ff5d3f0ed56653fe - sha256sums = 2d0919a443536161ac7e059ac3922b70f63c3e46a26efc4b5f8ac824caf09d2e - sha256sums = 61629212db265d849db5fa2b2b770385713938a38fdfb3bb7cff120a748f946a - sha256sums = 74e61207f4d0ac67fe5bc69d16591df1bc29cbcaeb0ccfdf480d43bfc5c5608a - sha256sums = 47d7a4a76527258f3400c82bf6cc1166a8073817e3a048735bada02ed06c556b - sha256sums = a9072240be0b1f2ffcc48189fe940f8ba031182beb2acd3cd82031cec4320f80 - sha256sums = f88b18c05b06e25108cf16e3277fee63bc057535779a9e12c544c18169a613e3 - sha256sums = dc74061269e6b0ad83f1cfd10a1e8ddba193a6f4c4d5cb2e3e906932d5a4d457 - sha256sums = 6a94de9adbdc4182b297e0011a68c9387fd25864dcb4386654218c8c530032c2 - sha256sums = 0b2dcb80d9f5cd987a6750b88dc71823980c47dcc711a993e71a496fd73d4e5e - sha256sums = 957feb4002deebfebcccc558eaa0c15b6af2ba8a0e4e331ac3365d7f6ab1d707 - sha256sums = e4682caf8255d258c24dd28e3965ff4a29a3e73aa293819d6f0f32e86970ff55 - -pkgname = swift - pkgdesc = The Swift programming language compiler and tools - optdepends = swift-lldb: Swift REPL and debugger - provides = swift-language - conflicts = swift-language-git - conflicts = swift-git - conflicts = swift-bin - -pkgname = swift-lldb - pkgdesc = The Swift programming language debugger (LLDB) and REPL - depends = swift - depends = python2-six - provides = lldb - conflicts = lldb - options = !strip + source = git+https://github.com/apple/swift#tag=swift-5.9.2-RELEASE + source = 0001-arch-aur-patches.patch + source = apple-llvm-project::git+https://github.com/apple/llvm-project#tag=swift-5.9.2-RELEASE + source = swift-argument-parser::git+https://github.com/apple/swift-argument-parser#tag=1.2.2 + source = swift-cmark::git+https://github.com/apple/swift-cmark#tag=swift-5.9.2-RELEASE + source = swift-corelibs-foundation::git+https://github.com/apple/swift-corelibs-foundation#tag=swift-5.9.2-RELEASE + source = swift-corelibs-libdispatch::git+https://github.com/apple/swift-corelibs-libdispatch#tag=swift-5.9.2-RELEASE + source = swift-corelibs-xctest::git+https://github.com/apple/swift-corelibs-xctest#tag=swift-5.9.2-RELEASE + source = swift-driver::git+https://github.com/apple/swift-driver#tag=swift-5.9.2-RELEASE + source = swift-integration-tests::git+https://github.com/apple/swift-integration-tests#tag=swift-5.9.2-RELEASE + source = swift-llbuild::git+https://github.com/apple/swift-llbuild#tag=swift-5.9.2-RELEASE + source = swift-package-manager::git+https://github.com/apple/swift-package-manager#tag=swift-5.9.2-RELEASE + source = swift-stress-tester::git+https://github.com/apple/swift-stress-tester#tag=swift-5.9.2-RELEASE + source = swift-syntax::git+https://github.com/apple/swift-syntax#tag=swift-5.9.2-RELEASE + source = swift-tools-support-core::git+https://github.com/apple/swift-tools-support-core#tag=swift-5.9.2-RELEASE + source = apple-indexstore-db::git+https://github.com/apple/indexstore-db#tag=swift-5.9.2-RELEASE + source = apple-sourcekit-lsp::git+https://github.com/apple/sourcekit-lsp#tag=swift-5.9.2-RELEASE + source = swift-asn1::git+https://github.com/apple/swift-asn1#tag=0.7.0 + source = swift-atomics::git+https://github.com/apple/swift-atomics#tag=1.0.2 + source = swift-certificates::git+https://github.com/apple/swift-certificates#tag=0.4.1 + source = swift-collections::git+https://github.com/apple/swift-collections#tag=1.0.1 + source = swift-crypto::git+https://github.com/apple/swift-crypto#tag=2.5.0 + source = swift-docc::git+https://github.com/apple/swift-docc#tag=swift-5.9.2-RELEASE + source = swift-docc-render-artifact::git+https://github.com/apple/swift-docc-render-artifact#tag=swift-5.9.2-RELEASE + source = swift-docc-symbolkit::git+https://github.com/apple/swift-docc-symbolkit#tag=swift-5.9.2-RELEASE + source = swift-format::git+https://github.com/apple/swift-format#tag=swift-5.9.2-RELEASE + source = swift-installer-scripts::git+https://github.com/apple/swift-installer-scripts#tag=swift-5.9.2-RELEASE + source = swift-lmdb::git+https://github.com/apple/swift-lmdb#tag=swift-5.9.2-RELEASE + source = swift-markdown::git+https://github.com/apple/swift-markdown#tag=swift-5.9.2-RELEASE + source = swift-nio::git+https://github.com/apple/swift-nio#tag=2.31.2 + source = swift-nio-ssl::git+https://github.com/apple/swift-nio-ssl#tag=2.15.0 + source = swift-numerics::git+https://github.com/apple/swift-numerics#tag=1.0.1 + source = swift-system::git+https://github.com/apple/swift-system#tag=1.1.1 + source = swift-tools-support-core::git+https://github.com/apple/swift-tools-support-core#tag=swift-5.9.2-RELEASE + source = swift-xcode-playground-support::git+https://github.com/apple/swift-xcode-playground-support#tag=swift-5.9.2-RELEASE + source = yams::git+https://github.com/jpsim/Yams#tag=5.0.1 + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP + sha256sums = SKIP +pkgname = swift-language diff --git a/.gitignore b/.gitignore index 022fbdd3bca9..018a3de08144 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/src/ -/pkg/ -*.tar.xz -*.tar.gz +* +!PKGBUILD +!.SRCINFO +!.gitignore diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000000..82e78cbc12ae --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,31 @@ +stages: # List of stages for jobs, and their order of execution + - build + - test + - deploy + +build-job: # patch makepkg so checkout does not take forever and is smaller + stage: build + script: + - sed -i 's|git clone "$url"|git --mirror --filter=blob:none clone "$url"|g' /usr/share/makepkg/source/git.sh + - pacman -Sy binutils fakeroot sudo --noconfirm --needed + - time sudo -u nobody makepkg -C -S --log --noconfirm + +unit-test-job: # This job runs in the test stage. + stage: test # It only starts when the job in the build stage completes successfully. + script: + - echo "Running unit tests... This will take about 60 seconds." + - sleep 60 + - echo "Code coverage is 90%" + +lint-test-job: # This job also runs in the test stage. + stage: test # It can run at the same time as unit-test-job (in parallel). + script: + - echo "Linting code... This will take about 10 seconds." + - sleep 10 + - echo "No lint issues found." + +deploy-job: # This job runs in the deploy stage. + stage: deploy # It only runs when *both* jobs in the test stage complete successfully. + script: + - echo "Deploying application..." + - echo "Application successfully deployed." diff --git a/0001-arch-aur-patches.patch b/0001-arch-aur-patches.patch new file mode 100644 index 000000000000..f32f57e766ab --- /dev/null +++ b/0001-arch-aur-patches.patch @@ -0,0 +1,106 @@ +From b79f0992a2201a2864dfde89291b3e1504613bea Mon Sep 17 00:00:00 2001 +From: soloturn <soloturn@gmail.com> +Date: Sun, 20 Mar 2022 12:05:07 +0100 +Subject: [PATCH] arch aur patches + +--- + utils/build-presets.ini | 16 +++------------- + 1 file changed, 3 insertions(+), 13 deletions(-) + +diff --git a/utils/build-presets.ini b/utils/build-presets.ini +index 57518c0853d..e959488e23e 100644 +--- a/utils/build-presets.ini ++++ b/utils/build-presets.ini +@@ -822,10 +822,8 @@ llbuild + swiftpm + swift-driver + xctest +-libicu + swiftdocc + +-build-ninja + install-llvm + install-swift + install-lldb +@@ -833,8 +831,7 @@ install-llbuild + install-swiftpm + install-swift-driver + install-xctest +-install-libicu +-install-prefix=/usr ++install-prefix=/usr/lib/swift + install-sourcekit-lsp + install-swiftdocc + build-swift-static-stdlib +@@ -847,13 +844,13 @@ build-swift-stdlib-unittest-extra + test-installable-package + + # Build the benchmarks against the toolchain. +-toolchain-benchmarks ++# does not work outside /usr, Build the benchmarks against the toolchain. ++# toolchain-benchmarks + + # Path to the root of the installation filesystem. + install-destdir=%(install_destdir)s + + # Path to the .tar.gz package we would create. +-installable-package=%(installable_package)s + + # This ensures the default module cache + # location is local to this run, allowing +@@ -1102,7 +1099,6 @@ mixin-preset= + mixin_linux_install_components_with_clang + build-subdir=buildbot_incremental + +-libicu + llbuild + swiftpm + swift-driver +@@ -1116,7 +1112,6 @@ sourcekit-lsp + install-llvm + install-swift + install-llbuild +-install-libicu + install-swiftpm + install-swift-driver + install-foundation +@@ -1671,12 +1666,10 @@ mixin-preset= + mixin_linux_install_components_with_clang + + libdispatch +-libicu + foundation + xctest + libcxx=false + +-install-libicu + install-foundation + install-libdispatch + install-xctest +@@ -1918,7 +1911,6 @@ mixin-preset=buildbot_indexstoredb_linux,sanitize + mixin-preset= + mixin_linux_install_components_with_clang + +-libicu + llbuild + swiftpm + xctest +@@ -1933,7 +1925,6 @@ reconfigure + + install-foundation + install-libdispatch +-install-libicu + install-libcxx + install-llvm + install-swift +@@ -2687,7 +2678,6 @@ no-assertions + [preset: linux_lldb] + lldb + foundation +-libicu + libdispatch + build-ninja + +-- +2.35.1 + @@ -1,184 +1,201 @@ # Maintainer: Michael Hansen <zrax0111 gmail com> +# Maintainer: soloturn@gmail.com +# Maintainer: fanjiang <prof.fan@foxmail.com> +# Contributor: Theo Tosini <theo.tosini@theoduino.me> +# Contributor: Gábor Sebestyén <segabor@gmail.com> +# Contributor: Andrew Sun <adsun701@gmail.com> -pkgbase=swift-language -pkgname=(swift swift-lldb) -_swiftver=5.1.2-RELEASE -pkgver=${_swiftver//-RELEASE/} -pkgrel=1 +## useful links +# https://swift.org/ +# https://github.com/apple/swift + +## options + + +## basic info +_pkgname="swift-language" +pkgname="$_pkgname" +_swiftver=swift-5.9.2-RELEASE +pkgver=5.9.2 +pkgrel=2 pkgdesc="The Swift programming language and debugger" -arch=('i686' 'x86_64') -url="http://swift.org/" -license=('apache') -depends=('python2' 'libutil-linux' 'icu' 'libbsd' 'libedit' 'libxml2' - 'sqlite' 'ncurses' 'libblocksruntime') -makedepends=('git' 'cmake' 'ninja' 'swig3' 'clang>=5.0' 'python2-six' 'perl' - 'python2-sphinx' 'python2-requests' 'rsync') +url="https://github.com/apple/swift" +license=('Apache-2.0') +arch=('x86_64') + +depends=('icu' 'libedit' 'libxml2' 'python' 'libbsd' 'ncurses') +makedepends=( + 'clang' 'cmake' 'git' 'lld' 'llvm' 'ninja' + 'patch' 'python-six' 'rsync' 'swift-language' 'swig' +) +# utils/update_checkout/update-checkout-config.json source=( - "swift-${_swiftver}.tar.gz::https://github.com/apple/swift/archive/swift-${_swiftver}.tar.gz" - "llvm-project-${_swiftver}.tar.gz::https://github.com/apple/llvm-project/archive/swift-${_swiftver}.tar.gz" - "swift-cmark-${_swiftver}.tar.gz::https://github.com/apple/swift-cmark/archive/swift-${_swiftver}.tar.gz" - "swift-llbuild-${_swiftver}.tar.gz::https://github.com/apple/swift-llbuild/archive/swift-${_swiftver}.tar.gz" - "swift-package-manager-${_swiftver}.tar.gz::https://github.com/apple/swift-package-manager/archive/swift-${_swiftver}.tar.gz" - "swift-corelibs-xctest-${_swiftver}.tar.gz::https://github.com/apple/swift-corelibs-xctest/archive/swift-${_swiftver}.tar.gz" - "swift-corelibs-foundation-${_swiftver}.tar.gz::https://github.com/apple/swift-corelibs-foundation/archive/swift-${_swiftver}.tar.gz" - "swift-corelibs-libdispatch-${_swiftver}.tar.gz::https://github.com/apple/swift-corelibs-libdispatch/archive/swift-${_swiftver}.tar.gz" - "swift-integration-tests-${_swiftver}.tar.gz::https://github.com/apple/swift-integration-tests/archive/swift-${_swiftver}.tar.gz" - "glibc-includes.patch" - "repl_swift-dl.patch" - "swiftpm-glibc.patch" - "swift-tests-glibc.patch" + "git+https://github.com/apple/swift#tag=${_swiftver}" + '0001-arch-aur-patches.patch' + + "apple-llvm-project"::"git+https://github.com/apple/llvm-project#tag=${_swiftver}" + "swift-argument-parser"::"git+https://github.com/apple/swift-argument-parser#tag=1.2.2" + "swift-cmark"::"git+https://github.com/apple/swift-cmark#tag=${_swiftver}" + "swift-corelibs-foundation"::"git+https://github.com/apple/swift-corelibs-foundation#tag=${_swiftver}" + "swift-corelibs-libdispatch"::"git+https://github.com/apple/swift-corelibs-libdispatch#tag=${_swiftver}" + "swift-corelibs-xctest"::"git+https://github.com/apple/swift-corelibs-xctest#tag=${_swiftver}" + "swift-driver"::"git+https://github.com/apple/swift-driver#tag=${_swiftver}" + "swift-integration-tests"::"git+https://github.com/apple/swift-integration-tests#tag=${_swiftver}" + "swift-llbuild"::"git+https://github.com/apple/swift-llbuild#tag=${_swiftver}" + "swift-package-manager"::"git+https://github.com/apple/swift-package-manager#tag=${_swiftver}" + "swift-stress-tester"::"git+https://github.com/apple/swift-stress-tester#tag=${_swiftver}" + "swift-syntax"::"git+https://github.com/apple/swift-syntax#tag=${_swiftver}" + "swift-tools-support-core"::"git+https://github.com/apple/swift-tools-support-core#tag=${_swiftver}" + + # swift src to check afterwards + "apple-indexstore-db"::"git+https://github.com/apple/indexstore-db#tag=${_swiftver}" + "apple-sourcekit-lsp"::"git+https://github.com/apple/sourcekit-lsp#tag=${_swiftver}" + "swift-asn1"::"git+https://github.com/apple/swift-asn1#tag=0.7.0" + "swift-atomics"::"git+https://github.com/apple/swift-atomics#tag=1.0.2" + "swift-certificates"::"git+https://github.com/apple/swift-certificates#tag=0.4.1" + "swift-collections"::"git+https://github.com/apple/swift-collections#tag=1.0.1" + "swift-crypto"::"git+https://github.com/apple/swift-crypto#tag=2.5.0" + "swift-docc"::"git+https://github.com/apple/swift-docc#tag=${_swiftver}" + "swift-docc-render-artifact"::"git+https://github.com/apple/swift-docc-render-artifact#tag=${_swiftver}" + "swift-docc-symbolkit"::"git+https://github.com/apple/swift-docc-symbolkit#tag=${_swiftver}" + "swift-format"::"git+https://github.com/apple/swift-format#tag=${_swiftver}" + "swift-installer-scripts"::"git+https://github.com/apple/swift-installer-scripts#tag=${_swiftver}" + "swift-lmdb"::"git+https://github.com/apple/swift-lmdb#tag=${_swiftver}" + "swift-markdown"::"git+https://github.com/apple/swift-markdown#tag=${_swiftver}" + "swift-nio"::"git+https://github.com/apple/swift-nio#tag=2.31.2" + "swift-nio-ssl"::"git+https://github.com/apple/swift-nio-ssl#tag=2.15.0" + "swift-numerics"::"git+https://github.com/apple/swift-numerics#tag=1.0.1" + "swift-system"::"git+https://github.com/apple/swift-system#tag=1.1.1" + "swift-tools-support-core"::"git+https://github.com/apple/swift-tools-support-core#tag=${_swiftver}" + "swift-xcode-playground-support"::"git+https://github.com/apple/swift-xcode-playground-support#tag=${_swiftver}" + "yams"::"git+https://github.com/jpsim/Yams#tag=5.0.1" ) -sha256sums=('ad7f569ca505f349b4e499ed781f53030afe068644c72e76a5d6fbb7b5b80b86' - 'd045b1d42933f4d34b24f5434438bbdce4a18341964be019ff5d3f0ed56653fe' - '2d0919a443536161ac7e059ac3922b70f63c3e46a26efc4b5f8ac824caf09d2e' - '61629212db265d849db5fa2b2b770385713938a38fdfb3bb7cff120a748f946a' - '74e61207f4d0ac67fe5bc69d16591df1bc29cbcaeb0ccfdf480d43bfc5c5608a' - '47d7a4a76527258f3400c82bf6cc1166a8073817e3a048735bada02ed06c556b' - 'a9072240be0b1f2ffcc48189fe940f8ba031182beb2acd3cd82031cec4320f80' - 'f88b18c05b06e25108cf16e3277fee63bc057535779a9e12c544c18169a613e3' - 'dc74061269e6b0ad83f1cfd10a1e8ddba193a6f4c4d5cb2e3e906932d5a4d457' - '6a94de9adbdc4182b297e0011a68c9387fd25864dcb4386654218c8c530032c2' - '0b2dcb80d9f5cd987a6750b88dc71823980c47dcc711a993e71a496fd73d4e5e' - '957feb4002deebfebcccc558eaa0c15b6af2ba8a0e4e331ac3365d7f6ab1d707' - 'e4682caf8255d258c24dd28e3965ff4a29a3e73aa293819d6f0f32e86970ff55') - -prepare() { - # Use python2 where appropriate - find "$srcdir" -type f -print0 | \ - xargs -0 sed -i 's|/usr/bin/env python$|&2|;s|/usr/bin/python$|&2|' - find "$srcdir/llvm-project-swift-${_swiftver}/lldb" -name Makefile -print0 | \ - xargs -0 sed -i 's|python-config|python2-config|g' - sed -i '/^cmake_minimum_required/a set(Python_ADDITIONAL_VERSIONS 2.7)' \ - "$srcdir/swift-swift-${_swiftver}/CMakeLists.txt" - sed -i '/^cmake_minimum_required/a set(Python_ADDITIONAL_VERSIONS 2.7)' \ - "$srcdir/llvm-project-swift-${_swiftver}/lldb/CMakeLists.txt" - sed -i 's/\<python\>/&2/' \ - "$srcdir/swift-swift-${_swiftver}/utils/build-script-impl" - - # Use directory names which build-script expects - for sdir in llvm clang clang-tools-extra libcxx lldb compiler-rt - do - ln -sf llvm-project-swift-${_swiftver}/${sdir} ${sdir} - done - for sdir in cmark llbuild - do - rm -rf ${sdir} - mv swift-${sdir}-swift-${_swiftver} ${sdir} - done - for sdir in corelibs-xctest corelibs-foundation corelibs-libdispatch \ - integration-tests - do - rm -rf ${sdir} - mv swift-${sdir}-swift-${_swiftver} swift-${sdir} - done - rm -rf swift swiftpm - mv swift-swift-${_swiftver} swift - mv swift-package-manager-swift-${_swiftver} swiftpm - - # Fix wrong glibc include paths in glibc module map - ( cd swift && patch -p1 -i "$srcdir/glibc-includes.patch" ) - - # repl_swift requires -ldl - ( cd lldb && patch -p1 -i "$srcdir/repl_swift-dl.patch" ) - - # Fix compile/test errors with newer glibc (2.30) - # See https://github.com/apple/swift-package-manager/pull/2408 - ( cd swiftpm && patch -p1 -i "$srcdir/swiftpm-glibc.patch" ) - ( cd swift && patch -p1 -i "$srcdir/swift-tests-glibc.patch" ) -} - -_common_build_params=( - --install-prefix=/usr - --lldb - --llbuild - --swiftpm - --xctest - --foundation - --libdispatch - --extra-cmake-options="-DSWIG_EXECUTABLE=/usr/bin/swig-3" +sha256sums=( + 'SKIP' + 'SKIP' + + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' + 'SKIP' ) -_build_script_wrapper() { - export SWIFT_SOURCE_ROOT="$srcdir" - ./utils/build-script "$@" +# By default makepkg runs strip on binaries. This causes issues with the Swift REPL. +# from https://github.com/RLovelett/swift-aur/blob/master/PKGBUILD +# termux had no trouble up to now, strip all executables and shared objects: +# https://github.com/termux/termux-packages/blob/master/scripts/build/termux_step_massage.sh#L24 +# would be cool to not strip only the ones which really are necessary, but how? +#options=(!strip) + +prepare () { + ln -sfP 'apple-indexstore-db' 'indexstore-db' + ln -sfP 'apple-llvm-project' 'llvm-project' + ln -sfP 'apple-sourcekit-lsp' 'sourcekit-lsp' + ln -sfP 'swift-argument-parser' 'argument-parser' + ln -sfP 'swift-asn1' 'asn1' + ln -sfP 'swift-atomics' 'atomics' + ln -sfP 'swift-certificates' 'certificates' + ln -sfP 'swift-cmark' 'cmark' + ln -sfP 'swift-collections' 'collections' + ln -sfP 'swift-corelibs-foundation' 'corelibs-foundation' + ln -sfP 'swift-corelibs-libdispatch' 'corelibs-libdispatch' + ln -sfP 'swift-corelibs-xctest' 'corelibs-xctest' + ln -sfP 'swift-crypto' 'crypto' + ln -sfP 'swift-docc' 'docc' + ln -sfP 'swift-docc-render-artifact' 'docc-render-artifact' + ln -sfP 'swift-docc-symbolkit' 'docc-symbolkit' + ln -sfP 'swift-driver' 'driver' + ln -sfP 'swift-experimental-string-processing' 'experimental-string-processing' + ln -sfP 'swift-format' 'format' + ln -sfP 'swift-installer-scripts' 'installer-scripts' + ln -sfP 'swift-integration-tests' 'integration-tests' + ln -sfP 'swift-llbuild' 'llbuild' + ln -sfP 'swift-llvm-bindings' 'llvm-bindings' + ln -sfP 'swift-lmdb' 'lmdb' + ln -sfP 'swift-markdown' 'markdown' + ln -sfP 'swift-nio' 'nio' + ln -sfP 'swift-nio-ssl' 'nio-ssl' + ln -sfP 'swift-numerics' 'numerics' + ln -sfP 'swift-package-manager' 'package-manager' + ln -sfP 'swift-stress-tester' 'stress-tester' + ln -sfP 'swift-syntax' 'syntax' + ln -sfP 'swift-system' 'system' + ln -sfP 'swift-tools-support-core' 'tools-support-core' + ln -sfP 'swift-xcode-playground-support' 'xcode-playground-support' + + ( cd swift && patch -Np1 -F100 -i "${srcdir:?}/0001-arch-aur-patches.patch" ) } build() { - cd "$srcdir/swift" - - export PATH="$PATH:/usr/bin/core_perl" - _build_script_wrapper -R "${_common_build_params[@]}" -} - -check() { - cd "$srcdir/swift" - - # Fix the lldb swig binding's import path (matches Arch LLDB package) - # Need to do this here as well as the install since the test suite - # uses the lldb python bindings directly from the build dir - sed -i "/import_module('_lldb')/s/_lldb/lldb.&/" \ - "${srcdir}/build/Ninja-ReleaseAssert/lldb-linux-${CARCH}/lib/python2.7/site-packages/lldb/__init__.py" - - _build_script_wrapper -R -t + # Fix /usr/include error + find "$srcdir/swift/stdlib/public/SwiftShims" -type f -print0 | xargs -0 sed -i 's|/usr/include/x86_64-linux-gnu|/usr/include|g' + find "$srcdir/llvm-project/clang" -type f -print0 | xargs -0 sed -i 's|/usr/include/x86_64-linux-gnu|/usr/include|g' + find "$srcdir/llvm-project/clang-tools-extra" -type f -print0 | xargs -0 sed -i 's|/usr/include/x86_64-linux-gnu|/usr/include|g' + + local _build_options_test=( + --dry-run + --preset=buildbot_linux,no_test + install_destdir="destdir" + ) + + local _build_options=( + --release + --skip-early-swift-driver + --skip-early-swiftsyntax + ) + + "$srcdir/swift/utils/build-script" "${_build_options[@]}" } -package_swift() { - pkgdesc='The Swift programming language compiler and tools' - provides=('swift-language') - conflicts=('swift-language-git' 'swift-git' 'swift-bin') - optdepends=('swift-lldb: Swift REPL and debugger') +package() { + local _install_path='usr/lib/swift' - cd "$srcdir/swift" + DESTDIR="$pkgdir" cmake \ + --install "$srcdir/build/Ninja-ReleaseAssert/swift-linux-x86_64" \ + --prefix "/$_install_path" - _build_script_wrapper -R "${_common_build_params[@]}" \ - --install-destdir="$pkgdir" \ - --install-llbuild --install-swiftpm --install-xctest \ - --install-foundation --install-libdispatch + find "$pkgdir/$_install_path" -type f -name '*.a' -delete + find "$pkgdir/$_install_path" -type f -name '*.syms' -delete + find "$pkgdir/$_install_path" -type f -name '*-test' -delete - cd "$srcdir/build/Ninja-ReleaseAssert" - - # Some projects' install targets don't work correctly :( - ( - cd swift-linux-$CARCH - install -m755 bin/swift bin/swift-{demangle,ide-test} "$pkgdir/usr/bin" - ln -s swift "$pkgdir/usr/bin/swiftc" - ln -s swift "$pkgdir/usr/bin/swift-autolink-extract" - - install -m644 lib/libsourcekitdInProc.so "$pkgdir/usr/lib" - - install -dm755 "$pkgdir/usr/share/man/man1" - install -m644 docs/tools/swift.1 "$pkgdir/usr/share/man/man1" - - umask 0022 - cp -rL lib/swift/{clang,linux,shims} "$pkgdir/usr/lib/swift/" - ) - - # License file - install -dm755 "$pkgdir/usr/share/licenses/swift" - install -m644 "$srcdir/swift/LICENSE.txt" "$pkgdir/usr/share/licenses/swift" + for i in swift swift sourcekit-lsp ; do + install -Dm644 /dev/stdin "$pkgdir/usr/bin/$i" <<END +#!/usr/bin/env sh +exec "/$_install_path/bin/$i" "\$@" +END + done } -package_swift-lldb() { - pkgdesc='The Swift programming language debugger (LLDB) and REPL' - depends=('swift' 'python2-six') - provides=('lldb') - conflicts=('lldb') - options=('!strip') # Don't strip repl_swift -- we need its symbols - - cd "$srcdir/swift" - - _build_script_wrapper -R "${_common_build_params[@]}" \ - --install-destdir="$pkgdir" \ - --install-lldb - - # Fix the lldb swig binding's import path (matches Arch LLDB package) - # We have to do this again because the build-script recreates the "bad" - # version of the source file. - sed -i "/import_module('_lldb')/s/_lldb/lldb.&/" \ - "${pkgdir}/usr/lib/python2.7/site-packages/lldb/__init__.py" - - # This should be provided from python2-six - rm "$pkgdir/usr/lib/python2.7/site-packages/six.py" - rm "$pkgdir/usr/lib/python2.7/site-packages/six.pyc" -} +# vim:set ts=2 sw=2 et: diff --git a/glibc-includes.patch b/glibc-includes.patch deleted file mode 100644 index dde6046dca84..000000000000 --- a/glibc-includes.patch +++ /dev/null @@ -1,131 +0,0 @@ -diff -rupN a/stdlib/public/Platform/glibc.modulemap.gyb b/stdlib/public/Platform/glibc.modulemap.gyb ---- a/stdlib/public/Platform/glibc.modulemap.gyb 2018-09-12 17:46:19.000000000 -0700 -+++ b/stdlib/public/Platform/glibc.modulemap.gyb 2018-09-24 10:41:46.699830262 -0700 -@@ -333,7 +333,7 @@ module SwiftGlibc [system] { - export * - } - module ioctl { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/ioctl.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/ioctl.h" - export * - } - module libgen { -@@ -392,97 +392,97 @@ module SwiftGlibc [system] { - - % if CMAKE_SDK in ["LINUX", "FREEBSD", "CYGWIN", "HAIKU"]: - module file { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/file.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/file.h" - export * - } - module sem { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/sem.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/sem.h" - export * - } - % if CMAKE_SDK != "HAIKU": - module shm { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/shm.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/shm.h" - export * - } - % end - module statvfs { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/statvfs.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/statvfs.h" - export * - } - % end - - module ipc { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/ipc.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/ipc.h" - export * - } - module mman { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/mman.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/mman.h" - export * - } - module msg { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/msg.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/msg.h" - export * - } - module resource { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/resource.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/resource.h" - export * - } - module select { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/select.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/select.h" - export * - } - % if CMAKE_SDK != "FREEBSD" and CMAKE_SDK != "HAIKU": - module sendfile { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/sendfile.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/sendfile.h" - export * - } - % end - module socket { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/socket.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/socket.h" - export * - } - module stat { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/stat.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/stat.h" - export * - } - module time { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/time.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/time.h" - export * - } - module times { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/times.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/times.h" - export * - } - module types { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/types.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/types.h" - export * - } - % if CMAKE_SDK in ["FREEBSD"]: - module event { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/event.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/event.h" - export * - } - % end - module uio { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/uio.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/uio.h" - export * - } - module un { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/un.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/un.h" - export * - } - % if CMAKE_SDK in ["LINUX"]: - module user { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/user.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/user.h" - export * - } - % end - module utsname { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/utsname.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/utsname.h" - export * - } - module wait { -- header "${GLIBC_ARCH_INCLUDE_PATH}/sys/wait.h" -+ header "${GLIBC_INCLUDE_PATH}/sys/wait.h" - export * - } - } diff --git a/repl_swift-dl.patch b/repl_swift-dl.patch deleted file mode 100644 index cf0b0e8477b2..000000000000 --- a/repl_swift-dl.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -rupN a/tools/repl/swift/CMakeLists.txt b/tools/repl/swift/CMakeLists.txt ---- a/tools/repl/swift/CMakeLists.txt 2019-09-22 09:58:11.416432071 -0700 -+++ b/tools/repl/swift/CMakeLists.txt 2019-09-22 09:58:36.799766163 -0700 -@@ -19,6 +19,8 @@ add_lldb_tool(repl_swift - main.c - ) - -+target_link_libraries(repl_swift PRIVATE dl) -+ - # The dummy repl executable is a C program, but we always look for a mangled - # swift symbol (corresponding to main). If we build the repl with debug info, - # the debugger looks at the frame language (looking up the compile unit) and gets diff --git a/swift-tests-glibc.patch b/swift-tests-glibc.patch deleted file mode 100644 index 5dbff97d2584..000000000000 --- a/swift-tests-glibc.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/test/stdlib/POSIX.swift b/test/stdlib/POSIX.swift -index 91cec1c2e01b..ead9a623554b 100644 ---- a/test/stdlib/POSIX.swift -+++ b/test/stdlib/POSIX.swift -@@ -69,7 +69,7 @@ POSIXTests.test("sem_open success") { - let sem = sem_open(semaphoreName, O_CREAT, 0o777, 1) - expectNotEqual(SEM_FAILED, sem) - -- let res = sem_close(sem) -+ let res = sem_close(sem!) - expectEqual(0, res) - - let res2 = sem_unlink(semaphoreName) -@@ -83,7 +83,7 @@ POSIXTests.test("sem_open O_EXCL success") { - let sem = sem_open(semaphoreName, O_CREAT | O_EXCL, 0o777, 1) - expectNotEqual(SEM_FAILED, sem) - -- let res = sem_close(sem) -+ let res = sem_close(sem!) - expectEqual(0, res) - - let res2 = sem_unlink(semaphoreName) -@@ -102,7 +102,7 @@ POSIXTests.test("sem_open existing") { - // difficult. - expectNotEqual(SEM_FAILED, sem2) - -- let res = sem_close(sem) -+ let res = sem_close(sem!) - expectEqual(0, res) - - let res2 = sem_unlink(semaphoreName) -@@ -120,7 +120,7 @@ POSIXTests.test("sem_open existing O_EXCL fail") { - expectEqual(SEM_FAILED, sem2) - expectEqual(EEXIST, errno) - -- let res = sem_close(sem) -+ let res = sem_close(sem!) - expectEqual(0, res) - - let res2 = sem_unlink(semaphoreName) diff --git a/swiftpm-glibc.patch b/swiftpm-glibc.patch deleted file mode 100644 index f3fa8c1815af..000000000000 --- a/swiftpm-glibc.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/Sources/Basic/Process.swift b/Sources/Basic/Process.swift -index 2e2efd448..f65702709 100644 ---- a/Sources/Basic/Process.swift -+++ b/Sources/Basic/Process.swift -@@ -366,7 +366,10 @@ public final class Process: ObjectIdentifierProtocol { - defer { posix_spawn_file_actions_destroy(&fileActions) } - - // Workaround for https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=89e435f3559c53084498e9baad22172b64429362 -- let devNull = strdup("/dev/null") -+ // Change allowing for newer version of glibc -+ guard let devNull = strdup("/dev/null") else { -+ throw SystemError.posix_spawn(0, arguments) -+ } - defer { free(devNull) } - // Open /dev/null as stdin. - posix_spawn_file_actions_addopen(&fileActions, 0, devNull, O_RDONLY, 0) -@@ -392,7 +395,7 @@ public final class Process: ObjectIdentifierProtocol { - - let argv = CStringArray(arguments) - let env = CStringArray(environment.map({ "\($0.0)=\($0.1)" })) -- let rv = posix_spawnp(&processID, argv.cArray[0], &fileActions, &attributes, argv.cArray, env.cArray) -+ let rv = posix_spawnp(&processID, argv.cArray[0]!, &fileActions, &attributes, argv.cArray, env.cArray) - - guard rv == 0 else { - throw SystemError.posix_spawn(rv, arguments) |