dev-lang/swift-bin: add 6.3.3

Signed-off-by: Itai Ferber <itai@itaiferber.net>
This commit is contained in:
Itai Ferber
2026-07-02 07:40:51 -04:00
parent 8ca0f2e55a
commit 8e97e504e6
2 changed files with 103 additions and 0 deletions

View File

@@ -6,4 +6,5 @@ DIST swift-6.3.1-r2.gpkg.tar 768685568 BLAKE2B e0d1d388cd93e9fd0c6c4a123d7268504
DIST swift-6.3.1.gpkg.tar 768686080 BLAKE2B 95a30addf66ee48a74de88761bd76dc0cabcdda5d1d009a66c5f870de0b06b1383137c333c43f110992e2a25dbd73c2e34e78229fee1791867b7870766587655 SHA512 9629d0d2ea6400e91f1b58b00672e6bfad21880d7f4660ca3aecda6c38175e8150148e3ae3d4018386298c70685b0345aa0e4e64dacf24070d3121cafd41ceb6
DIST swift-6.3.2-r2.gpkg.tar 773304832 BLAKE2B 819b1544a00be3375ba60cc2778f4ef6fc36384cf843c18c773a6510b14967eaf67514d4862b33717b14fe58a68597299c826a6dc804b6186205751e83cfdf0b SHA512 1d8f6016a3bf8cadaabdd73d7e7704fb3af20f31f8c233506933deb5f4fe97bae1b8a24109f4a4fef4965737b48f3de474b13661d71d3e33a659897b58631721
DIST swift-6.3.2.gpkg.tar 773304320 BLAKE2B 1e2b5503938824ee57cc750e472704e334e5b60cd4ff783e17cdf2498f52bbf2fbbac630b0af79e7e9cafbccefda9890ca6b1ed839f9dfedaaafd3bcfbf6c53f SHA512 4e8affa1de858155b99554dd38e664da4f51921b1bed6bc1f0491b55260c035dd8ad85b0d82ac908b24bba1611e1253374fcaa90e166cc3e72857748153ce392
DIST swift-6.3.3.gpkg.tar 772311040 BLAKE2B 19c7642233b4c3ee850f7f32177ce956e2c9fc25143d6a65a3dde0e668de27b88ffcd6db8387099d2ffdd3738f33b0bff5cf9cdf28573354021ca6a144d4e065 SHA512 fb98154b73cac613d3eafcf0d064f13c77a324abcd9a1bf971cfcf8a70ab19d85ab1c1d12e6f9ab7012e1df8083c6c832b934f538c6f70707466593649151c07
DIST swift-6.3.gpkg.tar 768706560 BLAKE2B 3150d9f30f7a61e145b46fc66f9c465071d4b600fa3fff857ae8aa806f83051d2ed4ce8b2fef3eab6d4041f55da8b45fa60dd9550d7fdcf89fa8b588f4747b8b SHA512 ee8874afdefa5cd2c26d69ae1bc0f6cda4c27a4bd9ec5b911844fe0c3cb2e7fd92d8f2ec3ae46d3c99e42c3e1a8a7ba9b5fd16d849a85c2ac05e185887ae263a

View File

@@ -0,0 +1,102 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
LLVM_COMPAT=( {17..22} )
PYTHON_COMPAT=( python3_{12..14} )
inherit llvm-r2 python-single-r1 unpacker
DESCRIPTION="A high-level, general-purpose, multi-paradigm, compiled programming language"
HOMEPAGE="https://www.swift.org"
SWIFT_PF="${PF/-bin/}"
SRC_URI="https://github.com/itaiferber/gentoo-distfiles/releases/download/${CATEGORY}/${SWIFT_PF}/${SWIFT_PF}.gpkg.tar"
S="${WORKDIR}"
LICENSE="Apache-2.0 GPL-2"
SLOT="6/3"
KEYWORDS="-* ~amd64"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
RESTRICT="strip"
RDEPEND="
${PYTHON_DEPS}
!dev-lang/swift:6/3
!~dev-lang/swift-5.10.1:0
>=app-arch/zstd-1.5
>=app-eselect/eselect-swift-1.0-r1
>=dev-db/sqlite-3
>=dev-libs/icu-69
>=dev-libs/libedit-20221030
>=dev-libs/libxml2-2.11.5
>=net-misc/curl-8.9.1
>=sys-libs/ncurses-6
>=virtual/zlib-1.3.1:=
dev-lang/python
$(llvm_gen_dep 'llvm-core/lld:${LLVM_SLOT}=')
"
QA_PREBUILT="*"
PKG_PREINST_SWIFT_INTENTIONALLY_SET='true'
src_unpack() {
unpack_gpkg "${SWIFT_PF}.gpkg.tar"
}
src_install() {
[[ -d "${SWIFT_PF}/image" ]] || die "Expected image directory not found in package"
cp -R "${SWIFT_PF}/image/usr" "${ED}" || die "Copying prebuilt files failed"
}
pkg_preinst() {
# After installation, we ideally want the system to have the latest Swift
# version set -- but if the system already has a Swift version set and it
# isn't the latest version, that's likely an intentional decision that we
# don't want to override.
local current_swift_version="$(eselect swift show | tail -n1 | xargs)"
local latest_swift_version="$(eselect swift show --latest | tail -n1 | xargs)"
[[ "${current_swift_version}" == '(unset)' ]] \
|| [[ "${current_swift_version}" == "${latest_swift_version}" ]] \
&& PKG_PREINST_SWIFT_INTENTIONALLY_SET='false'
}
pkg_postinst() {
# If the system doesn't have Swift intentionally set to an older version, we
# can update to the latest.
if [[ "${PKG_PREINST_SWIFT_INTENTIONALLY_SET}" == 'false' ]]; then
eselect swift update
fi
# We also want to provide a stable directory which matches our SLOT to avoid
# revdep breakages, as patch updates use the same SLOT but otherwise move
# the install location on disk.
#
# See https://bugs.gentoo.org/957730
#
# We do this in `pkg_postinst` instead of calling `dosym` in `src_install`
# because when upgrading from a major version to a patch version, the major
# version is still on disk while the patch version is being installed, so
# the existing directory is in use and the symlink fails to install.
local major_ver="$(ver_cut 1-2)"
if [[ "${PV}" != "${major_ver}" ]]; then
local libdir="${EROOT}/usr/$(get_libdir)"
ln -fsT "${libdir}/${P}" "${libdir}/${PN}-${major_ver}" || die
fi
}
pkg_postrm() {
# We don't want to leave behind symlinks pointing to this Swift version on
# removal.
local current_swift_version="$(eselect swift show | tail -n1 | xargs)"
if [[ "${current_swift_version}" == "${P}" ]]; then
eselect swift update
fi
# If we installed a SLOT symlink, we also want to remove it here.
local major_ver="$(ver_cut 1-2)"
local link="${EROOT}/usr/$(get_libdir)/${PN}-${major_ver}"
if [[ -L "${link}" && "${PV}" != "${major_ver}" ]]; then
rm "${link}"
fi
}