sys-libs/ncurses-compat/ncurses-compat-6.2-r1.ebuild
author gabriel
Thu, 08 Apr 2021 14:09:23 +0100
changeset 34 b351c25cacd8
parent 23 fbf657536960
permissions -rw-r--r--
wlroots 0.13
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
     1
# Copyright 1999-2020 Gentoo Authors
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
     2
# Distributed under the terms of the GNU General Public License v2
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
     3
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
     4
# This version is just for the ABI .5 library
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
     5
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
     6
EAPI=7
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
     7
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
     8
inherit flag-o-matic toolchain-funcs multilib-minimal preserve-libs usr-ldscript
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
     9
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    10
MY_PV="${PV:0:3}"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    11
MY_P="${PN/-compat}-${MY_PV}"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    12
MY_PN="${PN/-compat}"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    13
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    14
DESCRIPTION="console display library (ABI version 5)"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    15
HOMEPAGE="https://www.gnu.org/software/ncurses/ https://invisible-island.net/ncurses/"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    16
SRC_URI="mirror://gnu/ncurses/${MY_P}.tar.gz"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    17
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    18
if [[ "${PV}" == *_p* ]] ; then
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    19
	SRC_URI+=" ftp://ftp.invisible-island.net/ncurses/${PV/_p*}/${MY_PN}-${PV/_p/-}-patch.sh.bz2
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    20
		https://invisible-mirror.net/archives/ncurses/${PV/_p*}/${MY_PN}-${PV/_p/-}-patch.sh.bz2"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    21
fi
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    22
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    23
LICENSE="MIT"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    24
# The subslot reflects the SONAME.
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    25
SLOT="5/5"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    26
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    27
IUSE="gpm tinfo unicode -versyms"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    28
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    29
DEPEND="gpm? ( sys-libs/gpm[${MULTILIB_USEDEP}] )"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    30
# Block the ncurses-5 that installs the same lib. #557472
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    31
RDEPEND="${DEPEND}
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    32
	!<sys-libs/ncurses-6:0
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    33
	!sys-libs/ncurses:5"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    34
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    35
S="${WORKDIR}/${MY_P}"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    36
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    37
PATCHES=(
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    38
	"${FILESDIR}/ncurses-5.7-nongnu.patch"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    39
	"${FILESDIR}/ncurses-6.0-rxvt-unicode-9.15.patch" #192083 #383871
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    40
	"${FILESDIR}/ncurses-6.0-pkg-config.patch"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    41
	"${FILESDIR}/ncurses-5.9-gcc-5.patch" #545114
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    42
	"${FILESDIR}/ncurses-6.0-ticlib.patch" #557360
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    43
	"${FILESDIR}/ncurses-6.0-cppflags-cross.patch" #601426
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    44
)
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    45
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    46
src_prepare() {
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    47
	if [[ "${PV}" == *_p* ]] ; then
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    48
		eapply "${WORKDIR}/${MY_PN}-${PV/_p/-}-patch.sh"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    49
	fi
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    50
	default
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    51
}
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    52
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    53
src_configure() {
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    54
	unset TERMINFO #115036
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    55
	tc-export_build_env BUILD_{CC,CPP}
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    56
	BUILD_CPPFLAGS+=" -D_GNU_SOURCE" #214642
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    57
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    58
	# Build the various variants of ncurses -- narrow, wide, and threaded. #510440
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    59
	# Order matters here -- we want unicode/thread versions to come last so that the
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    60
	# binaries in /usr/bin support both wide and narrow.
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    61
	# The naming is also important as we use these directly with filenames and when
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    62
	# checking configure flags.
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    63
	NCURSES_TARGETS=(
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    64
		ncurses
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    65
		$(usex unicode 'ncursesw' '')
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    66
	)
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    67
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    68
	# When installing ncurses, we have to use a compatible version of tic.
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    69
	# This comes up when cross-compiling, doing multilib builds, upgrading,
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    70
	# or installing for the first time.  Build a local copy of tic whenever
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    71
	# the host version isn't available. #249363 #557598
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    72
	if ! ROOT=/ has_version -b "~sys-libs/${P}:0" ; then
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    73
		local lbuildflags="-static"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    74
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    75
		# some toolchains don't quite support static linking
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    76
		local dbuildflags="-Wl,-rpath,${WORKDIR}/lib"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    77
		case ${CHOST} in
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    78
			*-darwin*)  dbuildflags=     ;;
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    79
			*-aix*)     dbuildflags=     ;;
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    80
		esac
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    81
		echo "int main() {}" | \
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    82
			$(tc-getCC) -o x -x c - ${lbuildflags} -pipe >& /dev/null \
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    83
			|| lbuildflags="${dbuildflags}"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    84
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    85
		# We can't re-use the multilib BUILD_DIR because we run outside of it.
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    86
		BUILD_DIR="${WORKDIR}" \
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    87
		CHOST=${CBUILD} \
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    88
		CFLAGS=${BUILD_CFLAGS} \
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    89
		CXXFLAGS=${BUILD_CXXFLAGS} \
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    90
		CPPFLAGS=${BUILD_CPPFLAGS} \
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    91
		LDFLAGS="${BUILD_LDFLAGS} ${lbuildflags}" \
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    92
		do_configure cross --without-shared --with-normal
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    93
	fi
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    94
	multilib-minimal_src_configure
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    95
}
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    96
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    97
multilib_src_configure() {
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    98
	local t
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
    99
	for t in "${NCURSES_TARGETS[@]}" ; do
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   100
		do_configure "${t}"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   101
	done
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   102
}
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   103
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   104
do_configure() {
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   105
	local target=$1
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   106
	shift
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   107
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   108
	mkdir "${BUILD_DIR}/${target}" || die
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   109
	cd "${BUILD_DIR}/${target}" || die
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   110
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   111
	local conf=(
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   112
		# We need the basic terminfo files in /etc, bug #37026.  We will
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   113
		# add '--with-terminfo-dirs' and then populate /etc/terminfo in
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   114
		# src_install() ...
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   115
		##--with-rel-version=5.9 ??
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   116
		--with-abi-version=5
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   117
		--with-terminfo-dirs="${EPREFIX}/etc/terminfo:${EPREFIX}/usr/share/terminfo"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   118
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   119
		# Now the rest of the various standard flags.
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   120
		--without-hashed-db
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   121
		--disable-pc-files
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   122
		--with-shared
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   123
		--without-hashed-db
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   124
		--without-ada
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   125
		--without-cxx
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   126
		--without-cxx-binding
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   127
		--without-debug
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   128
		--without-profile
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   129
		# The configure script uses ldd to parse the linked output which
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   130
		# is flaky for cross-compiling/multilib/ldd versions/etc...
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   131
		$(use_with gpm gpm libgpm.so.1)
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   132
		--disable-termcap
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   133
		--enable-symlinks
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   134
		--with-rcs-ids
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   135
		--with-manpage-format=normal
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   136
		--enable-const
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   137
		--enable-colorfgbg
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   138
		--enable-echo
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   139
		--disable-warnings
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   140
		--without-assertions
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   141
		--enable-leaks
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   142
		--without-expanded
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   143
		--with-macros
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   144
		--without-progs
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   145
		--without-tests
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   146
		--without-trace
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   147
		$(use_with tinfo termlib)
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   148
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   149
		# The chtype/mmask-t settings below are to retain ABI compat
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   150
		# with ncurses-5.4 so dont change em !
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   151
		--with-chtype=long
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   152
		--with-mmask-t=long
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   153
		--disable-ext-colors
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   154
		--disable-ext-mouse
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   155
		--without-{pthread,reentrant}
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   156
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   157
		# Buidl versioned symbols, some binaries may want this
23
fbf657536960 Fix typo
gabriel
parents: 22
diff changeset
   158
		$(use_with versyms versioned-syms)
22
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   159
	)
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   160
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   161
	if [[ ${target} == ncurses*w ]] ; then
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   162
		conf+=( --enable-widec )
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   163
	else
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   164
		conf+=( --disable-widec )
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   165
	fi
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   166
	# Make sure each variant goes in a unique location.
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   167
	if [[ ${target} != "ncurses" ]] ; then
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   168
		conf+=( --includedir="${EPREFIX}"/usr/include/${target} )
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   169
	fi
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   170
	# See comments in src_configure.
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   171
	if [[ ${target} != "cross" ]] ; then
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   172
		local cross_path="${WORKDIR}/cross"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   173
		[[ -d ${cross_path} ]] && export TIC_PATH="${cross_path}/progs/tic"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   174
	else
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   175
		conf+=( --with-progs )
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   176
	fi
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   177
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   178
	# Force bash until upstream rebuilds the configure script with a newer
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   179
	# version of autotools. #545532
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   180
	CONFIG_SHELL="${EPREFIX}"/bin/bash \
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   181
	ECONF_SOURCE="${S}" \
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   182
	econf "${conf[@]}" "$@"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   183
}
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   184
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   185
src_compile() {
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   186
	# See comments in src_configure.
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   187
	if ! ROOT=/ has_version -b "~sys-libs/${P}:0" ; then
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   188
		BUILD_DIR="${WORKDIR}" \
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   189
		do_compile cross -C progs tic
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   190
	fi
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   191
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   192
	multilib-minimal_src_compile
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   193
}
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   194
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   195
multilib_src_compile() {
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   196
	local t
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   197
	for t in "${NCURSES_TARGETS[@]}" ; do
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   198
		do_compile "${t}"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   199
	done
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   200
}
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   201
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   202
do_compile() {
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   203
	local target=$1
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   204
	shift
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   205
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   206
	cd "${BUILD_DIR}/${target}" || die
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   207
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   208
	# A little hack to fix parallel builds ... they break when
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   209
	# generating sources so if we generate the sources first (in
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   210
	# non-parallel), we can then build the rest of the package
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   211
	# in parallel.  This is not really a perf hit since the source
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   212
	# generation is quite small.
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   213
	emake -j1 sources
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   214
	# For some reason, sources depends on pc-files which depends on
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   215
	# compiled libraries which depends on sources which ...
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   216
	# Manually delete the pc-files file so the install step will
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   217
	# create the .pc files we want.
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   218
	rm -f misc/pc-files || die
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   219
	emake "$@"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   220
}
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   221
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   222
multilib_src_install() {
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   223
	local target lib
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   224
	for target in "${NCURSES_TARGETS[@]}" ; do
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   225
		cd "${BUILD_DIR}/${target}/lib" || die
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   226
		for lib in *5.9 ; do
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   227
			newlib.so "${lib}" "${lib%%.9}"
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   228
		done
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   229
	done
9803496ddf72 Add --with-verisoned-symbols to ncurses-compat
gabriel
parents:
diff changeset
   230
}