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 (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 96B9C1581D3 for ; Mon, 27 May 2024 23:28:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AADD5E2A14; Mon, 27 May 2024 23:28:58 +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)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 85E0DE2A14 for ; Mon, 27 May 2024 23:28:58 +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)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 77AEB33C84E for ; Mon, 27 May 2024 23:28:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0091216 for ; Mon, 27 May 2024 23:28:55 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1716852527.b704b44eb578e31ec4bd0f62af3c2e8e4902bdd2.zmedico@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: app-containers/snapd/ X-VCS-Repository: repo/gentoo X-VCS-Files: app-containers/snapd/Manifest app-containers/snapd/snapd-2.63.ebuild X-VCS-Directories: app-containers/snapd/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: b704b44eb578e31ec4bd0f62af3c2e8e4902bdd2 X-VCS-Branch: master Date: Mon, 27 May 2024 23:28:55 +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: 2778df3b-e695-407d-a76e-b875a9244670 X-Archives-Hash: db8559fcfc328a5e73a9cfc335f70d07 commit: b704b44eb578e31ec4bd0f62af3c2e8e4902bdd2 Author: Zac Medico gentoo org> AuthorDate: Mon May 27 23:28:12 2024 +0000 Commit: Zac Medico gentoo org> CommitDate: Mon May 27 23:28:47 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b704b44e app-containers/snapd: add 2.63 Signed-off-by: Zac Medico gentoo.org> app-containers/snapd/Manifest | 1 + app-containers/snapd/snapd-2.63.ebuild | 179 +++++++++++++++++++++++++++++++++ 2 files changed, 180 insertions(+) diff --git a/app-containers/snapd/Manifest b/app-containers/snapd/Manifest index 3390efacef34..89d58b906a8b 100644 --- a/app-containers/snapd/Manifest +++ b/app-containers/snapd/Manifest @@ -1,2 +1,3 @@ DIST snapd-2.58.tar.xz 6980916 BLAKE2B d3de507513db808fa4f85498b5c238de143f06660f1d677186c8c763b38643a2486e25b747977b3eb584619d79ea0a12e88dc5a909045a853c1d8f849f2c1638 SHA512 555915b8b4d9d2d91a3ba19e9e78cf6b19d9683a9f390ad225aa5876320cb8595b464d6133706c4923fc15fbe04ba2b65a47e403c9a2d8859adae827f8ec000a DIST snapd-2.61.tar.xz 7626784 BLAKE2B d716e91df4702fbd415bb6204a4557f37afd3dce187e3bca33b12a2ac5a1b54d1c31473d1537a784f6cbbfaf213f676d1f1b29d716e8c5f45a785229c9f3e018 SHA512 2fd432d7ef2204535576e980de7060ad15a0b3610b25e0f41b630ae34e172f97460f0a38d9d456af08dd36c619e90119219788a49e56a69afc7fbf014fc1db22 +DIST snapd-2.63.tar.xz 7502152 BLAKE2B 8ae38699227b7f0e6b512526fc8857b3e50ed220ac95860c372ca0a4b26f5a034bd9309688217696444254e41cc70fe3a45c0bf026c84e5f950e7df8aebd47a0 SHA512 956ee142ab6cb5de522307f7844819c861b2831e22dab56f7bfca16ff7f947093f8a8727d49370cc000ed71f3af9c57cff9c4be93ebf199e8c631a152a68ec5b diff --git a/app-containers/snapd/snapd-2.63.ebuild b/app-containers/snapd/snapd-2.63.ebuild new file mode 100644 index 000000000000..56a00504636a --- /dev/null +++ b/app-containers/snapd/snapd-2.63.ebuild @@ -0,0 +1,179 @@ +# Copyright 2020-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools bash-completion-r1 flag-o-matic go-module linux-info readme.gentoo-r1 systemd tmpfiles xdg-utils + +DESCRIPTION="Service and tools for management of snap packages" +HOMEPAGE="http://snapcraft.io/" + +SRC_URI="https://github.com/snapcore/snapd/releases/download/${PV}/snapd_${PV}.vendor.tar.xz -> ${P}.tar.xz" +MY_PV=${PV} +KEYWORDS="~amd64" + +LICENSE="GPL-3 Apache-2.0 BSD BSD-2 LGPL-3-with-linking-exception MIT" +SLOT="0" +IUSE="apparmor +forced-devmode gtk kde systemd" +REQUIRED_USE="!forced-devmode? ( apparmor ) systemd" + +CONFIG_CHECK="~CGROUPS + ~CGROUP_DEVICE + ~CGROUP_FREEZER + ~NAMESPACES + ~SQUASHFS + ~SQUASHFS_ZLIB + ~SQUASHFS_LZO + ~SQUASHFS_XZ + ~BLK_DEV_LOOP + ~SECCOMP + ~SECCOMP_FILTER" + +RDEPEND=" + sys-libs/libseccomp:= + apparmor? ( + sec-policy/apparmor-profiles + sys-apps/apparmor:= + ) + dev-libs/glib + virtual/libudev + systemd? ( sys-apps/systemd ) + sys-libs/libcap:= + sys-fs/squashfs-tools[lzma,lzo]" + +DEPEND="${RDEPEND}" + +BDEPEND=" + >=dev-lang/go-1.9 + dev-python/docutils + sys-devel/gettext + sys-fs/xfsprogs" + +PDEPEND="sys-auth/polkit[gtk?,kde?]" + +README_GENTOO_SUFFIX="" + +pkg_setup() { + if use apparmor; then + CONFIG_CHECK+=" ~SECURITY_APPARMOR" + fi + linux-info_pkg_setup + + # Seems to have issues building with -O3, switch to -O2 + replace-flags -O3 -O2 +} + +src_prepare() { + default + # Update apparmor profile to allow libtinfow.so* + sed -i 's/libtinfo/libtinfo{,w}/' \ + "cmd/snap-confine/snap-confine.apparmor.in" || die + + if ! use forced-devmode; then + sed -e 's#return !apparmorFull#if !apparmorFull {\n\t\tpanic("USE=forced-devmode is disabled")\n\t}\n\treturn false#' \ + -i "sandbox/forcedevmode.go" || die + grep -q 'panic("USE=forced-devmode is disabled")' "sandbox/forcedevmode.go" || die "failed to disable forced-devmode" + fi + + sed -i 's:command -v git >/dev/null:false:' -i "mkversion.sh" || die + + ./mkversion.sh "${PV}" + pushd "cmd" >/dev/null || die + eautoreconf +} + +src_configure() { + SNAPD_MAKEARGS=( + "BINDIR=${EPREFIX}/usr/bin" + "DBUSSERVICESDIR=${EPREFIX}/usr/share/dbus-1/services" + "LIBEXECDIR=${EPREFIX}/usr/lib" + "SNAP_MOUNT_DIR=${EPREFIX}/var/lib/snapd/snap" + "SYSTEMDSYSTEMUNITDIR=$(systemd_get_systemunitdir)" + ) + export CGO_ENABLED="1" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + + pushd "${S}/cmd" >/dev/null || die + econf --libdir="${EPREFIX}/usr/lib" \ + --libexecdir="${EPREFIX}/usr/lib/snapd" \ + $(use_enable apparmor) \ + --enable-nvidia-biarch \ + --with-snap-mount-dir="${EPREFIX}/var/lib/snapd/snap" +} + +src_compile() { + export -n GOCACHE XDG_CACHE_HOME + export GOBIN="${S}/bin" + + local file + for file in "${S}/po/"*.po; do + msgfmt "${file}" -o "${file%.po}.mo" || die + done + + emake -C "${S}/data" "${SNAPD_MAKEARGS[@]}" + + local -a flags=(-buildmode=pie -ldflags "-s -linkmode external -extldflags '${LDFLAGS}'" -trimpath) + local -a staticflags=(-buildmode=pie -ldflags "-s -linkmode external -extldflags '${LDFLAGS} -static'" -trimpath) + + local cmd + for cmd in snap snapd snapd-apparmor snap-bootstrap snap-failure snap-preseed snap-recovery-chooser snap-repair snap-seccomp; do + go build ${GOFLAGS} -mod=vendor -o "${GOBIN}/${cmd}" "${flags[@]}" \ + -v -x "github.com/snapcore/${PN}/cmd/${cmd}" + [[ -e "${GOBIN}/${cmd}" ]] || die "failed to build ${cmd}" + done + for cmd in snapctl snap-exec snap-update-ns; do + go build ${GOFLAGS} -mod=vendor -o "${GOBIN}/${cmd}" "${staticflags[@]}" \ + -v -x "github.com/snapcore/${PN}/cmd/${cmd}" + [[ -e "${GOBIN}/${cmd}" ]] || die "failed to build ${cmd}" + done +} + +src_install() { + emake -C "${S}/data" install "${SNAPD_MAKEARGS[@]}" DESTDIR="${D}" + emake -C "${S}/cmd" install "${SNAPD_MAKEARGS[@]}" DESTDIR="${D}" + + if use apparmor; then + mv "${ED}/etc/apparmor.d/usr.lib.snapd.snap-confine"{,.real} || die + keepdir /var/lib/snapd/apparmor/profiles + fi + keepdir /var/lib/snapd/{apparmor/snap-confine,cache,cookie,snap,void} + fperms 700 /var/lib/snapd/{cache,cookie} + + dobin "${GOBIN}/"{snap,snapctl} + ln "${ED}/usr/bin/snapctl" "${ED}/usr/lib/snapd/snapctl" || die + + exeinto /usr/lib/snapd + doexe "${GOBIN}/"{snapd,snapd-apparmor,snap-bootstrap,snap-failure,snap-exec,snap-preseed,snap-recovery-chooser,snap-repair,snap-seccomp,snap-update-ns} \ + "${S}/"{cmd/snap-discard-ns/snap-discard-ns,cmd/snap-gdb-shim/snap-gdb-shim,cmd/snap-mgmt/snap-mgmt} \ + "${S}/data/completion/bash/"{complete.sh,etelpmoc.sh,} + + dobashcomp "${S}/data/completion/bash/snap" + + insinto /usr/share/zsh/site-functions + doins "${S}/data/completion/zsh/_snap" + + insinto "/usr/share/polkit-1/actions" + doins "${S}/data/polkit/io.snapcraft.snapd.policy" + + dodoc "${S}/packaging/ubuntu-16.04/changelog" + domo "${S}/po/"*.mo + + readme.gentoo_create_doc +} + +pkg_postinst() { + readme.gentoo_print_elog + xdg_desktop_database_update + tmpfiles_process snapd.conf + + if use apparmor && [[ -z ${ROOT} && -e /sys/kernel/security/apparmor/profiles && + $(wc -l < /sys/kernel/security/apparmor/profiles) -gt 0 ]]; then + apparmor_parser -r "${EPREFIX}/etc/apparmor.d/usr.lib.snapd.snap-confine.real" + fi +} + +pkg_postrm() { + xdg_desktop_database_update +}