aboutsummaryrefslogtreecommitdiffstats
path: root/sys-apps/pacman/pacman-9999.ebuild
blob: e89b14c594ac48dea1cd4518184081c16e4a3e0a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit meson

DESCRIPTION="Archlinux's binary package manager"
HOMEPAGE="https://archlinux.org/pacman/"

if [[ ${PV} == 9999 ]] ; then
	inherit git-r3
	EGIT_REPO_URI="https://gitlab.archlinux.org/pacman/pacman.git"
else
	SRC_URI="https://gitlab.archlinux.org/pacman/pacman/-/archive/v${PV}/pacman-v${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~amd64"
	S="${WORKDIR}/pacman-v${PV}"
fi

LICENSE="GPL-2"
SLOT="0/13"

IUSE="curl debug doc +gpg test"

RDEPEND="
	curl? ( >=net-misc/curl-7.55.0 )
	gpg? ( >=app-crypt/gpgme-1.12.0:= )
	dev-libs/openssl:0=
	>=app-arch/libarchive-3.0.0
	>=app-shells/bash-4.4
"
DEPEND="
	${RDEPEND}
	test? (
		sys-apps/fakeroot
		sys-apps/fakechroot
	)
"
BDEPEND="
	app-text/asciidoc
	doc? ( app-text/doxygen )
"

RESTRICT="!test? ( test )"

src_configure() {
	local emesonargs=(
		--localstatedir=/var
		-Dcrypto=openssl
		-Ddoc=enabled
		# Help protect user from shooting their Gentoo installation
		# in its foot.
		-Droot-dir="${EPREFIX}/var/chroot/archlinux"
		$(meson_use debug)
		$(meson_feature curl)
		$(meson_feature doc doxygen)
		$(meson_feature gpg gpgme)
	)
	meson_src_configure
}

src_install() {
	meson_src_install

	# avoid creating stuff inside /var/cache/
	# see bug #633742 for more information
	rm -r "${D}"/var/cache/pacman
	rmdir "${D}"/var/cache
}

pkg_postinst() {
	einfo ""
	einfo "The default root dir was set to ${EPREFIX}/var/chroot/archlinux"
	einfo "to avoid breaking Gentoo systems due to oscitancy."
	einfo "If you prefer another directory, take a look at"
	einfo "pacman's parameter -r|--root)."
	einfo ""
	einfo "You will need to setup at least one mirror in /etc/pacman.d/mirrorlist."
	einfo "Please generate it manually according to the Archlinux documentation:"
	einfo "https://wiki.archlinux.org/index.php/Mirror"
	einfo ""
	einfo "The pacman-contrib scripts have been moved out of the main pacman"
	einfo "package and now have to be installed from app-misc/pacman-contrib."
	einfo ""
}