sys-boot/gnu-efi: Fix building with clang-9
[gentoo.git] / sys-boot / plymouth / plymouth-0.9.4-r1.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit flag-o-matic
7 SRC_URI="https://dev.gentoo.org/~aidecoe/distfiles/${CATEGORY}/${PN}/gentoo-logo.png"
8
9 if [[ ${PV} == 9999 ]]; then
10         inherit git-r3
11         EGIT_REPO_URI="https://anongit.freedesktop.org/git/plymouth"
12 else
13         SRC_URI="${SRC_URI} https://www.freedesktop.org/software/plymouth/releases/${P}.tar.xz"
14         KEYWORDS="~alpha amd64 ~arm arm64 ~ia64 ~ppc ~ppc64 ~sparc x86"
15 fi
16
17 inherit autotools readme.gentoo-r1 systemd toolchain-funcs
18
19 DESCRIPTION="Graphical boot animation (splash) and logger"
20 HOMEPAGE="https://cgit.freedesktop.org/plymouth/"
21
22 LICENSE="GPL-2"
23 SLOT="0"
24 IUSE="debug gdm +gtk +libkms +pango +split-usr static-libs"
25
26 CDEPEND="
27         >=media-libs/libpng-1.2.16:=
28         gtk? (
29                 dev-libs/glib:2
30                 >=x11-libs/gtk+-3.14:3
31                 x11-libs/cairo
32         )
33         libkms? ( x11-libs/libdrm[libkms] )
34         pango? ( >=x11-libs/pango-1.21 )
35 "
36 DEPEND="${CDEPEND}
37         elibc_musl? ( sys-libs/rpmatch-standalone )
38         app-text/docbook-xsl-stylesheets
39         dev-libs/libxslt
40         virtual/pkgconfig
41 "
42 # Block due bug #383067
43 RDEPEND="${CDEPEND}
44         virtual/udev
45         !<sys-kernel/dracut-0.37-r3
46 "
47
48 DOC_CONTENTS="
49         Follow the following instructions to set up Plymouth:\n
50         https://wiki.gentoo.org/wiki/Plymouth#Configuration
51 "
52
53 PATCHES=(
54         "${FILESDIR}"/0.9.3-glibc-sysmacros.patch
55 )
56
57 src_prepare() {
58         use elibc_musl && append-ldflags -lrpmatch
59         default
60         eautoreconf
61 }
62
63 src_configure() {
64         local myconf=(
65                 --with-system-root-install=no
66                 --localstatedir=/var
67                 --without-rhgb-compat-link
68                 --enable-documentation
69                 --enable-systemd-integration
70                 --with-systemdunitdir="$(systemd_get_systemunitdir)"
71                 $(use_enable !static-libs shared)
72                 $(use_enable static-libs static)
73                 $(use_enable debug tracing)
74                 $(use_enable gtk gtk)
75                 $(use_enable libkms drm)
76                 $(use_enable pango)
77                 $(use_enable gdm gdm-transition)
78         )
79         econf "${myconf[@]}"
80 }
81
82 src_install() {
83         default
84
85         insinto /usr/share/plymouth
86         newins "${DISTDIR}"/gentoo-logo.png bizcom.png
87
88         if use split-usr ; then
89                 # Install compatibility symlinks as some rdeps hardcode the paths
90                 dosym ../usr/bin/plymouth /bin/plymouth
91                 dosym ../usr/sbin/plymouth-set-default-theme /sbin/plymouth-set-default-theme
92                 dosym ../usr/sbin/plymouthd /sbin/plymouthd
93         fi
94
95         readme.gentoo_create_doc
96
97         # looks like make install create /var/run/plymouth
98         # this is not needed for systemd, same should hold for openrc
99         # so remove
100         rm -rf "${D}"/var/run
101 }
102
103 pkg_postinst() {
104         readme.gentoo_print_elog
105         if ! has_version "sys-kernel/dracut" && ! has_version "sys-kernel/genkernel-next[plymouth]"; then
106                 ewarn "If you want initramfs builder with plymouth support, please emerge"
107                 ewarn "sys-kernel/dracut or sys-kernel/genkernel-next[plymouth]."
108         fi
109 }