Сравнение shared-mime-info-2.4-r2 с shared-mime-info-2.5.1

/usr/portage/x11-misc/shared-mime-info/shared-mime-info-2.5.1.ebuild 2026-07-03 20:03:05.108730948 +0300
1
# Copyright 1999-2025 Gentoo Authors
1
# Copyright 1999-2026 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI=8
5 5

  
6
inherit meson xdg-utils
6
PYTHON_COMPAT=( python3_{11..14} )
7
inherit meson python-any-r1 xdg-utils
7 8

  
8 9
# xdgmime is used for tests but doesn't make releases nowadays; do what
9 10
# Fedora does and use a snapshot so we can run the test suite.
10
MY_XDGMIME_COMMIT="179296748e92bd91bf531656632a1056307fb7b7"
11
MY_XDGMIME_COMMIT="04ce4cd90cb3fa77d5348662de221a6f33b21b17"
12

  
11 13
DESCRIPTION="The Shared MIME-info Database specification"
12 14
HOMEPAGE="https://gitlab.freedesktop.org/xdg/shared-mime-info"
13 15
SRC_URI="https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/${PV}/${P}.tar.bz2"
......
15 17

  
16 18
LICENSE="GPL-2"
17 19
SLOT="0"
18
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~arm64-macos ~x64-macos ~x64-solaris"
20
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
19 21
IUSE="test"
20 22
RESTRICT="!test? ( test )"
21 23

  
22
BDEPEND="
23
	app-text/docbook-xml-dtd:4.1.2
24
	app-text/xmlto
25
	sys-devel/gettext
26
	virtual/pkgconfig
27
"
28 24
RDEPEND="
29 25
	dev-libs/glib:2
30 26
	dev-libs/libxml2:=
31 27
"
32 28
DEPEND="${RDEPEND}"
29
BDEPEND="
30
	sys-devel/gettext
31
	virtual/pkgconfig
32
	test? ( ${PYTHON_DEPS} )
33
"
33 34

  
34
DOCS=( HACKING.md NEWS README.md )
35

  
36
PATCHES=(
37
	"${FILESDIR}"/${P}-libxml2.12.patch
38
)
35
pkg_setup() {
36
	use test && python-any-r1_pkg_setup
37
}
39 38

  
40 39
src_prepare() {
41 40
	default
42 41

  
43 42
	if use test ; then
44
		# Drop empty dir (it's a submodule in upstream git repo)
45
		rm -r "${S}"/xdgmime || die
46 43
		# Lead Meson to our snapshot
47
		mkdir "${WORKDIR}"/xdgmime_build || die
48
		ln -s "${WORKDIR}"/xdgmime_build xdgmime || die
49
		# Don't break parallel make
50
		#sed -i -e 's:make:$(MAKE):' xdgmime/Makefile || die
44
		ln -s "${WORKDIR}"/xdgmime-${MY_XDGMIME_COMMIT} subprojects/xdgmime || die
51 45
	fi
52 46
}
53 47

  
54 48
src_configure() {
55
	# We have to trick Meson into thinking it's there now so that
56
	# we can run meson then emake to build xdgmime later, rather than
57
	# building before running meson which would mean doing something
58
	# unexpected in src_configure.
59
	if use test ; then
60
		# Paths from https://gitlab.freedesktop.org/xdg/shared-mime-info/-/blob/master/meson.build#L29
61
		mkdir xdgmime/src || die
62
		touch xdgmime/src/{print,test}-mime{,-data} || die
63
		chmod +x xdgmime/src/{print,test}-mime{,-data} || die
64

  
65
		BUILD_DIR="${WORKDIR}"/xdgmime_build EMESON_SOURCE="${WORKDIR}"/xdgmime-${MY_XDGMIME_COMMIT} meson_src_configure
66
	fi
67

  
68 49
	local emesonargs=(
69 50
		-Dbuild-tools=true
51
		-Dbuild-spec=false
70 52
		-Dupdate-mimedb=false
71 53
		$(meson_use test build-tests)
72 54
	)
......
74 56
	meson_src_configure
75 57
}
76 58

  
77
src_compile() {
78
	if use test ; then
79
		meson_src_compile -C "${WORKDIR}"/xdgmime_build
80
	fi
81

  
82
	meson_src_compile
83
}
84

  
85 59
src_install() {
86 60
	meson_src_install
87 61

  
88
	# in prefix, install an env.d entry such that prefix patch is used/added
62
	# in prefix, install an env.d entry such that prefix path is used/added
89 63
	if use prefix; then
90 64
		echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share\"" > "${T}"/50mimeinfo || die
91 65
		doenvd "${T}"/50mimeinfo
92 66
	fi
93 67
}
94 68

  
69
pkg_postrm() {
70
	use prefix && export XDG_DATA_DIRS="${EPREFIX}"/usr/share
71
	xdg_mimeinfo_database_update
72
}
73

  
95 74
pkg_postinst() {
96 75
	use prefix && export XDG_DATA_DIRS="${EPREFIX}"/usr/share
97 76
	xdg_mimeinfo_database_update
Спасибо!