summaryrefslogtreecommitdiff
blob: 616bad6dd7ce37519d367fdf9681c1bde858ae80 (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
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit autotools flag-o-matic

DESCRIPTION="Platform abstraction code for tucnak package"
HOMEPAGE="http://tucnak.nagano.cz"
SRC_URI="http://tucnak.nagano.cz/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="ftdi"

RDEPEND="dev-libs/glib:2
	x11-libs/gtk+:2
	media-libs/libsdl2
	media-libs/libpng:0
	ftdi? ( dev-embedded/libftdi:1 )
	elibc_musl? ( sys-libs/libunwind )"
DEPEND="${RDEPEND}"
BDEPEND="virtual/pkgconfig"

MAKEOPTS+=" -j1"

src_prepare() {
	eapply_user
	sed -i -e "s/docsdir/#docsdir/g" \
		-e "s/docs_/#docs_/g" Makefile.am || die

	# Fix QA-Warning "QA Notice: pkg-config files with wrong LDFLAGS detected"
	sed -i -e 's/@LDFLAGS@//' libzia.pc.in || die

	# fix build for MUSL (bug #832235)
	if use elibc_musl ; then
		sed -i -e "s/ backtrace(/ unw_backtrace(/" src/zbfd.c || die
	fi
	eautoreconf
}

src_configure() {
	use elibc_musl && append-libs -lunwind
	econf \
		$(use_with ftdi) --with-sdl \
		--with-png --without-bfd \
		--disable-static
}

src_install() {
	emake DESTDIR="${D}" install
	find "${D}" -name '*.la' -type f -delete || die
}