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

EAPI=6

DIST_AUTHOR=GIRAFFED
DIST_VERSION=1.36
DIST_EXAMPLES=("demo" "demo2" "demo.form" "demo.menu" "demo.panel" "gdc")
inherit perl-module

DESCRIPTION="Curses interface modules for Perl"

SLOT="0"
KEYWORDS="~alpha amd64 arm hppa ia64 ppc ppc64 s390 ~sh sparc x86 ~sparc-solaris ~x86-solaris"
IUSE="+unicode test"
RESTRICT="!test? ( test )"

RDEPEND=">=sys-libs/ncurses-5:0=[unicode?]
	virtual/perl-Data-Dumper
"
DEPEND="${RDEPEND}
	virtual/perl-ExtUtils-MakeMaker
	test? ( virtual/perl-Test-Simple )
"

my_curses_unicode() {
	echo ncurses$(use unicode && echo w)
}

my_curses_version() {
	echo ncurses$(use unicode && echo w)$(has_version '>sys-libs/ncurses-6' && echo 6 || echo 5)
}

pkg_setup() {
	myconf="${myconf} FORMS PANELS MENUS"
	mydoc=HISTORY
	export CURSES_LIBTYPE=$(my_curses_unicode)
	export CURSES_LDFLAGS=$($(my_curses_version)-config --libs)
	export CURSES_CFLAGS=$( $(my_curses_version)-config --cflags)
}

src_configure() {
	perl-module_src_configure
	if ! use unicode ; then
		sed -i 's:<form.h>:"/usr/include/form.h":' "${S}"/c-config.h || die
	fi
}