summaryrefslogtreecommitdiff
path: root/media-libs/libwmf/libwmf-0.2.16.ebuild
blob: efc2a46d2f015ed34a84deed4a86c55cd51ae79f (plain)
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
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit gnome2-utils

DESCRIPTION="Library for reading vector images in Microsoft's Windows Metafile Format (WMF)"
HOMEPAGE="
	https://github.com/caolanm/libwmf
	https://wvware.sourceforge.net/
"
SRC_URI="https://github.com/caolanm/libwmf/releases/download/v${PV}/${P}.tar.gz"

LICENSE="LGPL-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~x64-macos ~x64-solaris"
IUSE="debug doc expat gd gdk-pixbuf X"

RDEPEND="
	app-text/ghostscript-gpl
	media-fonts/urw-fonts
	media-libs/freetype:2=
	media-libs/libpng:=
	media-libs/libjpeg-turbo:=
	virtual/zlib:=
	expat? ( dev-libs/expat )
	!expat? ( dev-libs/libxml2:2= )
	gd? ( media-libs/gd:2= )
	gdk-pixbuf? ( x11-libs/gdk-pixbuf:2 )
	X? (
		x11-libs/libX11
		x11-libs/libXt
		x11-libs/libXpm
	)
"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"

DOCS=( AUTHORS BUILDING ChangeLog CREDITS INSTALL NEWS README TODO )

PATCHES=(
	"${FILESDIR}"/${PN}-0.2.8.4-libpng-1.5.patch
)

src_configure() {
	local myeconfargs=(
		$(use_enable debug)
		$(use_enable gd)
		$(use_enable gdk-pixbuf pixbuf)
		$(use_with expat)
		$(use_with !expat libxml2)
		$(use_with X x)
		--with-fontdir="${EPREFIX}"/usr/share/fonts/urw-fonts
		--with-freetype
		--with-gsfontdir="${EPREFIX}"/usr/share/fonts/urw-fonts
		--with-gsfontmap="${EPREFIX}"/usr/share/ghostscript/9.21/Resource/Init/Fontmap
		--with-jpeg
		--with-layers
		--with-png
		--with-sys-gd
		--with-zlib
	)

	econf "${myeconfargs[@]}"
}

src_install() {
	default
	find "${D}" -name '*.la' -delete || die

	# We unbundle the fonts from media-fonts/urw-fonts
	rm -r "${ED}"/usr/share/fonts/urw-fonts || die
}

pkg_postinst() {
	use gdk-pixbuf && gnome2_gdk_pixbuf_update
}

pkg_postrm() {
	use gdk-pixbuf && gnome2_gdk_pixbuf_update
}