1 |
commit: 5b5534feec1ab9b284d9aa52af2b3d79b3acb5e9 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Mar 29 23:55:07 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 30 03:17:25 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b5534fe |
7 |
|
8 |
x11-misc/shared-mime-info: add 2.2 |
9 |
|
10 |
Now with tests! Hopefully won't need at least some of these hacks |
11 |
for much longer for xdgmime as Eli Schwartz is working on a Meson |
12 |
port for it. |
13 |
|
14 |
This isn't ideal but it's better than before when we didn't even |
15 |
try running the xdgmime bits. |
16 |
|
17 |
Bug: https://gitlab.freedesktop.org/xdg/xdgmime/-/merge_requests/25 |
18 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
19 |
|
20 |
x11-misc/shared-mime-info/Manifest | 2 + |
21 |
.../shared-mime-info/shared-mime-info-2.2.ebuild | 93 ++++++++++++++++++++++ |
22 |
2 files changed, 95 insertions(+) |
23 |
|
24 |
diff --git a/x11-misc/shared-mime-info/Manifest b/x11-misc/shared-mime-info/Manifest |
25 |
index c111c1487da2..3585101d2d2f 100644 |
26 |
--- a/x11-misc/shared-mime-info/Manifest |
27 |
+++ b/x11-misc/shared-mime-info/Manifest |
28 |
@@ -1 +1,3 @@ |
29 |
DIST shared-mime-info-2.1.tar.xz 5202496 BLAKE2B e8dfc7efe78feb5a38c8115a2b332f46c3dac2f89dffad0834fa7b77560b3ef528e779ab9e42822288f85d8c434fd590859db682f3f99494aa6a4387c985e912 SHA512 87e308281e83c4cf889594f7c2e8dcb4d0d0d3910124c3816fdb886ba7d6113b2581711adcb17032b47f9b8d8b7001fab58daa52b7da7c0ef87915e341d6f1b0 |
30 |
+DIST shared-mime-info-2.2.tar.gz 7064139 BLAKE2B 5e791893a60d64a8a1d421c1fabb5e214c6e34ae975d232a9d695b998e8e9aafb6449e858fd845feb120e170bf7c77f70c1fc23e3d4cf8e7c49c6e92418cab96 SHA512 490d96daf4214ab6ac537761b67f3ff4716b95d7ea3fedd2e2ab7b0b02d946acad49790a25efcb5e949551dc4c39ba08911e59f06b198b61dcb1bc44799a2b2e |
31 |
+DIST xdgmime-92f6a09fda2b23c2ab95cede8eb0612ca96bd0f7.tar.gz 32703 BLAKE2B 865ff57c566b60fb2bd6cb37e259800ee72fb4b9f2d135db46e9a40206946677a7b50bfb8f13d9ce1493bac972e8a5230d7caa833733f3a8d8631e844a648436 SHA512 90abe20483d5ae2131d18740fffbc57c94470be99e9ea1b04e13bffaf3dda4aa9145cb92bb4defe0a655c0bdbd630aaa325e7a9095b9599faebb751699b9cdd8 |
32 |
|
33 |
diff --git a/x11-misc/shared-mime-info/shared-mime-info-2.2.ebuild b/x11-misc/shared-mime-info/shared-mime-info-2.2.ebuild |
34 |
new file mode 100644 |
35 |
index 000000000000..3d31957ca47c |
36 |
--- /dev/null |
37 |
+++ b/x11-misc/shared-mime-info/shared-mime-info-2.2.ebuild |
38 |
@@ -0,0 +1,93 @@ |
39 |
+# Copyright 1999-2022 Gentoo Authors |
40 |
+# Distributed under the terms of the GNU General Public License v2 |
41 |
+ |
42 |
+EAPI=7 |
43 |
+ |
44 |
+inherit meson toolchain-funcs xdg-utils |
45 |
+ |
46 |
+# Keep an eye on https://gitlab.freedesktop.org/xdg/xdgmime/-/merge_requests/25! |
47 |
+# xdgmime is used for tests but doesn't make releases nowadays; do what |
48 |
+# Fedora does and use a snapshot so we can run the test suite. |
49 |
+MY_XDGMIME_COMMIT="92f6a09fda2b23c2ab95cede8eb0612ca96bd0f7" |
50 |
+DESCRIPTION="The Shared MIME-info Database specification" |
51 |
+HOMEPAGE="https://gitlab.freedesktop.org/xdg/shared-mime-info" |
52 |
+SRC_URI="https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/${PV}/${P}.tar.gz" |
53 |
+SRC_URI+=" test? ( https://gitlab.freedesktop.org/xdg/xdgmime/-/archive/${MY_XDGMIME_COMMIT}/xdgmime-${MY_XDGMIME_COMMIT}.tar.gz )" |
54 |
+ |
55 |
+LICENSE="GPL-2" |
56 |
+SLOT="0" |
57 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
58 |
+IUSE="test" |
59 |
+RESTRICT="!test? ( test )" |
60 |
+ |
61 |
+BDEPEND=" |
62 |
+ app-text/docbook-xml-dtd:4.1.2 |
63 |
+ app-text/xmlto |
64 |
+ sys-devel/gettext |
65 |
+ virtual/pkgconfig |
66 |
+" |
67 |
+RDEPEND=" |
68 |
+ dev-libs/glib:2 |
69 |
+ dev-libs/libxml2 |
70 |
+" |
71 |
+DEPEND="${RDEPEND}" |
72 |
+ |
73 |
+DOCS=( HACKING.md NEWS README.md ) |
74 |
+ |
75 |
+src_prepare() { |
76 |
+ default |
77 |
+ |
78 |
+ if use test ; then |
79 |
+ # Drop empty dir (it's a submodule in upstream git repo) |
80 |
+ rm -r "${S}"/xdgmime || die |
81 |
+ # Lead Meson to our snapshot |
82 |
+ ln -s "${WORKDIR}"/xdgmime-${MY_XDGMIME_COMMIT} xdgmime || die |
83 |
+ # Don't break parallel make |
84 |
+ sed -i -e 's:make:$(MAKE):' xdgmime/Makefile || die |
85 |
+ fi |
86 |
+} |
87 |
+ |
88 |
+src_configure() { |
89 |
+ # We have to trick Meson into thinking it's there now so that |
90 |
+ # we can run meson then emake to build xdgmime later, rather than |
91 |
+ # building before running meson which would mean doing something |
92 |
+ # unexpected in src_configure. |
93 |
+ if use test ; then |
94 |
+ # Paths from https://gitlab.freedesktop.org/xdg/shared-mime-info/-/blob/master/meson.build#L29 |
95 |
+ touch xdgmime/src/{print,test}-mime{,-data} || die |
96 |
+ chmod +x xdgmime/src/{print,test}-mime{,-data} || die |
97 |
+ fi |
98 |
+ |
99 |
+ local emesonargs=( |
100 |
+ -Dbuild-tools=true |
101 |
+ -Dupdate-mimedb=false |
102 |
+ ) |
103 |
+ |
104 |
+ meson_src_configure |
105 |
+} |
106 |
+ |
107 |
+src_compile() { |
108 |
+ if use test ; then |
109 |
+ tc-export CC |
110 |
+ |
111 |
+ # xdgmime only has a homebrew Makefile |
112 |
+ emake -C xdgmime |
113 |
+ fi |
114 |
+ |
115 |
+ meson_src_compile |
116 |
+} |
117 |
+ |
118 |
+src_install() { |
119 |
+ meson_src_install |
120 |
+ |
121 |
+ # in prefix, install an env.d entry such that prefix patch is used/added |
122 |
+ if use prefix; then |
123 |
+ echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share\"" > "${T}"/50mimeinfo || die |
124 |
+ doenvd "${T}"/50mimeinfo |
125 |
+ fi |
126 |
+} |
127 |
+ |
128 |
+pkg_postinst() { |
129 |
+ use prefix && export XDG_DATA_DIRS="${EPREFIX}"/usr/share |
130 |
+ xdg_mimeinfo_database_update |
131 |
+} |