summaryrefslogtreecommitdiff
path: root/x11-misc/shared-mime-info
diff options
context:
space:
mode:
Diffstat (limited to 'x11-misc/shared-mime-info')
-rw-r--r--x11-misc/shared-mime-info/Manifest3
-rw-r--r--x11-misc/shared-mime-info/shared-mime-info-2.2.ebuild93
2 files changed, 96 insertions, 0 deletions
diff --git a/x11-misc/shared-mime-info/Manifest b/x11-misc/shared-mime-info/Manifest
index c2e4686b3b88..9029b892104a 100644
--- a/x11-misc/shared-mime-info/Manifest
+++ b/x11-misc/shared-mime-info/Manifest
@@ -1,4 +1,7 @@
AUX shared-mime-info-2.1-itstool.patch 2841 BLAKE2B 4198fa232a034cf2c71f18973c0223af4944bc443c2b642e095cd842c8f206c20812d98d1466d50f345e35c8f61b213a58d711a3b7e515820c462e143dce9904 SHA512 af6772dc8bcceebcdc965e30f626b5ea415bbb0facff9ecaab6fadc23dbdc9ee0d72f588ac0d9637bcdf5930f30bd21102145e56def080cb946cd0f9b027a4b0
DIST shared-mime-info-2.1.tar.xz 5202496 BLAKE2B e8dfc7efe78feb5a38c8115a2b332f46c3dac2f89dffad0834fa7b77560b3ef528e779ab9e42822288f85d8c434fd590859db682f3f99494aa6a4387c985e912 SHA512 87e308281e83c4cf889594f7c2e8dcb4d0d0d3910124c3816fdb886ba7d6113b2581711adcb17032b47f9b8d8b7001fab58daa52b7da7c0ef87915e341d6f1b0
+DIST shared-mime-info-2.2.tar.gz 7064139 BLAKE2B 5e791893a60d64a8a1d421c1fabb5e214c6e34ae975d232a9d695b998e8e9aafb6449e858fd845feb120e170bf7c77f70c1fc23e3d4cf8e7c49c6e92418cab96 SHA512 490d96daf4214ab6ac537761b67f3ff4716b95d7ea3fedd2e2ab7b0b02d946acad49790a25efcb5e949551dc4c39ba08911e59f06b198b61dcb1bc44799a2b2e
+DIST xdgmime-92f6a09fda2b23c2ab95cede8eb0612ca96bd0f7.tar.gz 32703 BLAKE2B 865ff57c566b60fb2bd6cb37e259800ee72fb4b9f2d135db46e9a40206946677a7b50bfb8f13d9ce1493bac972e8a5230d7caa833733f3a8d8631e844a648436 SHA512 90abe20483d5ae2131d18740fffbc57c94470be99e9ea1b04e13bffaf3dda4aa9145cb92bb4defe0a655c0bdbd630aaa325e7a9095b9599faebb751699b9cdd8
EBUILD shared-mime-info-2.1.ebuild 1317 BLAKE2B 1ff8f3da6e43a8cc28ee849ee0a07b30ef39623317a60e7ce8ada17709aaa80a14915610ec4ca8e3515937e50703602460ddab30ba4d0e6181b2f88e1988d72a SHA512 31842f41f7cfe45ab3d99b1da1a4207c0b6c124daf510863e0e428d2e8cf5b5db401c6b619b155dabfec87caba78ef4c9ae2c1adaefb960e6d3f275e90b22ac8
+EBUILD shared-mime-info-2.2.ebuild 2635 BLAKE2B 08b59c341ceb3c079da158054375fa9065997b101cb24da5a81987388d33707a8fdb0143ec09c22a30c62dff9704fdc20189348cb1ccff791da719fd44fdba66 SHA512 b344cb461d4fa44bd81faa63b289aca7bc93d2775410b5d2ea650ace24d3a2706b910b1ae8d25f493f0f85579a0dc54236c286e60e14701787827cb3a77c7c95
MISC metadata.xml 229 BLAKE2B 35bd897953d3051382021de0742162ed1a166c98224fec04fc54dc467dfe5492289b1da910ae9213259b20a0bd5bbffc041624ccb3aacc23b56de2c397861d7d SHA512 7340f6b8c0a938920b7940a288c212e868ae0d8cb18b97c028e6e959f72f94e35f37a2d864bb662fc1d01b43bd7b72efdcbcc5d48e700aaf8c845eb6b9d67fed
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
new file mode 100644
index 000000000000..3d31957ca47c
--- /dev/null
+++ b/x11-misc/shared-mime-info/shared-mime-info-2.2.ebuild
@@ -0,0 +1,93 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit meson toolchain-funcs xdg-utils
+
+# Keep an eye on https://gitlab.freedesktop.org/xdg/xdgmime/-/merge_requests/25!
+# xdgmime is used for tests but doesn't make releases nowadays; do what
+# Fedora does and use a snapshot so we can run the test suite.
+MY_XDGMIME_COMMIT="92f6a09fda2b23c2ab95cede8eb0612ca96bd0f7"
+DESCRIPTION="The Shared MIME-info Database specification"
+HOMEPAGE="https://gitlab.freedesktop.org/xdg/shared-mime-info"
+SRC_URI="https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/${PV}/${P}.tar.gz"
+SRC_URI+=" test? ( https://gitlab.freedesktop.org/xdg/xdgmime/-/archive/${MY_XDGMIME_COMMIT}/xdgmime-${MY_XDGMIME_COMMIT}.tar.gz )"
+
+LICENSE="GPL-2"
+SLOT="0"
+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"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ app-text/docbook-xml-dtd:4.1.2
+ app-text/xmlto
+ sys-devel/gettext
+ virtual/pkgconfig
+"
+RDEPEND="
+ dev-libs/glib:2
+ dev-libs/libxml2
+"
+DEPEND="${RDEPEND}"
+
+DOCS=( HACKING.md NEWS README.md )
+
+src_prepare() {
+ default
+
+ if use test ; then
+ # Drop empty dir (it's a submodule in upstream git repo)
+ rm -r "${S}"/xdgmime || die
+ # Lead Meson to our snapshot
+ ln -s "${WORKDIR}"/xdgmime-${MY_XDGMIME_COMMIT} xdgmime || die
+ # Don't break parallel make
+ sed -i -e 's:make:$(MAKE):' xdgmime/Makefile || die
+ fi
+}
+
+src_configure() {
+ # We have to trick Meson into thinking it's there now so that
+ # we can run meson then emake to build xdgmime later, rather than
+ # building before running meson which would mean doing something
+ # unexpected in src_configure.
+ if use test ; then
+ # Paths from https://gitlab.freedesktop.org/xdg/shared-mime-info/-/blob/master/meson.build#L29
+ touch xdgmime/src/{print,test}-mime{,-data} || die
+ chmod +x xdgmime/src/{print,test}-mime{,-data} || die
+ fi
+
+ local emesonargs=(
+ -Dbuild-tools=true
+ -Dupdate-mimedb=false
+ )
+
+ meson_src_configure
+}
+
+src_compile() {
+ if use test ; then
+ tc-export CC
+
+ # xdgmime only has a homebrew Makefile
+ emake -C xdgmime
+ fi
+
+ meson_src_compile
+}
+
+src_install() {
+ meson_src_install
+
+ # in prefix, install an env.d entry such that prefix patch is used/added
+ if use prefix; then
+ echo "XDG_DATA_DIRS=\"${EPREFIX}/usr/share\"" > "${T}"/50mimeinfo || die
+ doenvd "${T}"/50mimeinfo
+ fi
+}
+
+pkg_postinst() {
+ use prefix && export XDG_DATA_DIRS="${EPREFIX}"/usr/share
+ xdg_mimeinfo_database_update
+}