From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 46814158046 for ; Sun, 13 Oct 2024 14:51:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0305BE08A6; Sun, 13 Oct 2024 14:51:36 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DC744E08A6 for ; Sun, 13 Oct 2024 14:51:35 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E50FC343289 for ; Sun, 13 Oct 2024 14:51:34 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4328B1F64 for ; Sun, 13 Oct 2024 14:51:33 +0000 (UTC) From: "David Roman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "David Roman" Message-ID: <1728783085.aaf9561924991c5c79618e1837b0ad1e0673f225.davidroman@gentoo> Subject: [gentoo-commits] repo/proj/guru:master commit in: dev-lang/swift/ X-VCS-Repository: repo/proj/guru X-VCS-Files: dev-lang/swift/swift-5.10.1-r1.ebuild X-VCS-Directories: dev-lang/swift/ X-VCS-Committer: davidroman X-VCS-Committer-Name: David Roman X-VCS-Revision: aaf9561924991c5c79618e1837b0ad1e0673f225 X-VCS-Branch: master Date: Sun, 13 Oct 2024 14:51:33 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 908a47fa-32ae-4d1b-8411-ca89060e7734 X-Archives-Hash: 79a8f05bf6b181fe1366213d556652b8 commit: aaf9561924991c5c79618e1837b0ad1e0673f225 Author: Itai Ferber itaiferber net> AuthorDate: Sat Oct 12 17:41:44 2024 +0000 Commit: David Roman gmail com> CommitDate: Sun Oct 13 01:31:25 2024 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=aaf95619 dev-lang/swift: add support for app-eselect/eselect-swift Signed-off-by: Itai Ferber itaiferber.net> dev-lang/swift/swift-5.10.1-r1.ebuild | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/dev-lang/swift/swift-5.10.1-r1.ebuild b/dev-lang/swift/swift-5.10.1-r1.ebuild index 3440d1183..f855522a2 100644 --- a/dev-lang/swift/swift-5.10.1-r1.ebuild +++ b/dev-lang/swift/swift-5.10.1-r1.ebuild @@ -64,6 +64,7 @@ RESTRICT="strip" RDEPEND=" ${PYTHON_DEPS} + >=app-eselect/eselect-swift-1.0 >=dev-db/sqlite-3 >=dev-libs/icu-69 >=dev-libs/libedit-20221030 @@ -268,6 +269,27 @@ src_install() { # `swift ` calls `swift-` directly.) local bin for bin in swift swiftc sourcekit-lsp; do - dosym -r "${dest_dir}/usr/bin/${bin}" "/usr/bin/${bin}" + # We only install versioned symlinks; non-versioned links are maanged + # via `eselect swift`. + dosym -r "${dest_dir}/usr/bin/${bin}" "/usr/bin/${bin}-${PV}" done } + +pkg_postinst() { + # If we're installing the latest version of Swift, then update symlinks to + # it. (We don't want to call `eselect swift update` unconditionally in case + # we're installing an older version of Swift, and the user has intentionally + # selected a version other than the latest.) + if ! has_version ">${CATEGORY}/${P}"; then + eselect swift update + fi +} + +pkg_postrm() { + # We don't want to leave behind symlinks pointing to this Swift version on + # removal. + local eselect_swift_version="$(eselect swift show)" + if [[ "${eselect_swift_version}" == *"${P}" ]]; then + eselect swift update + fi +}