summaryrefslogtreecommitdiff
path: root/sys-libs
diff options
context:
space:
mode:
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/Manifest.gzbin15076 -> 15079 bytes
-rw-r--r--sys-libs/ncurses/Manifest8
-rw-r--r--sys-libs/ncurses/ncurses-6.4_p20230527.ebuild437
3 files changed, 445 insertions, 0 deletions
diff --git a/sys-libs/Manifest.gz b/sys-libs/Manifest.gz
index 38cc416ba970..0f4e4dbee5ef 100644
--- a/sys-libs/Manifest.gz
+++ b/sys-libs/Manifest.gz
Binary files differ
diff --git a/sys-libs/ncurses/Manifest b/sys-libs/ncurses/Manifest
index 8ad72599c6aa..888b23c1d522 100644
--- a/sys-libs/ncurses/Manifest
+++ b/sys-libs/ncurses/Manifest
@@ -153,15 +153,23 @@ DIST ncurses-6.4-20230429.patch.gz 9195 BLAKE2B 6ed8c3cac11d3c3e52b7dce20be5b769
DIST ncurses-6.4-20230429.patch.gz.asc 729 BLAKE2B 2e063a7818ac443182ec4f4d8da13884accd563ab66e04297ca0bd4b9610f974efd3ca29dfcf13939cd9ee369c5e5799eb13a55050249036ebbc375e6ef8d6d1 SHA512 55167510e21aa3ad6d4a57fa37ae82308424ae9141e6e4756b4b335d30136675add5c00ee102d74ed93eccfc2d752eff5045d88e708928df3cecde3c0be77c79
DIST ncurses-6.4-20230506.patch.gz 52834 BLAKE2B 55d2351a507a60aa5baeb9e7e392fbbf714a6bffcf4729e9b195aabc2dc81372336d0dc3501f95abda04491013220060983d2186531471694f40b35d4ef3196d SHA512 04967b96d9723b2939fe64eff4388ceee0adf478f659b58cac8601770dd7763fa192d673e78b33c267e00f4ecbfc2863bc49b12fcdeaa8ce24df39126f20b4e1
DIST ncurses-6.4-20230506.patch.gz.asc 729 BLAKE2B 5ccb09f5b48a4a9c98ad4224cde68df659a365aca12210ec14a6519216e32b10531b1dfc4184bd12e62e1f0fdd9f06974b59866bba6115407d52712f5adff6f8 SHA512 2f63a62e37a15aa6a276a5d9a2c4b86a4e50af037ee5b1c339bccb02200d3e477b5b93ce5833a4d3933a952970caec3b38639412281c1df7c30d7b241bc3a2ab
+DIST ncurses-6.4-20230514.patch.gz 42963 BLAKE2B c2d27883884ebb2f14c523b5558d575b84fe8aa6b110a4f246f529d29288118d8393a955d8401aee675a764d52e76495d47487f52c3edb8548dc3419371def49 SHA512 0346fae238637c6a69024982485672e6b1447f5902d9cc6b9deff8296220a381b5b41b23b30d053881b09242a4e8ad728618342300c1dee63770286b81e362df
+DIST ncurses-6.4-20230514.patch.gz.asc 729 BLAKE2B 10ee649be87b46a03d1cb1c31a57ec9cb20da425604900540d04f806cc2c9e9a1e73009f62a96fafdbd81d66c7d47878e256d02cf5b9de9ee6f26621b73a4705 SHA512 57875d11844efbb23052e5cee32aa41a0bddb290069e33504e57613e4ab131efddc9c85f92af82b1d6bfa00182bcb9f1e86812538f5f209096b3ee84c67de280
+DIST ncurses-6.4-20230520.patch.gz 3090 BLAKE2B 93e376bc6250509c1a83e799efc2d4766354451931115d300b74c14af93dda4f3aefdd59f97467eb88e6ea29804595e84cb62c62733022b255d5368a74a38729 SHA512 bf854e4d6f8ed643b8841c9265057f06186699a083edb489e970d1cc8e752fdf49ecaa36518340a2b00a5c6ebf548b7651361b1bd2abb80467d2ce3f9861d28d
+DIST ncurses-6.4-20230520.patch.gz.asc 729 BLAKE2B 08db3a1a8152c4cc29fcc11b24ec3d1a6d3c425eed9a54f33bc370b86f26a13a9cdd273652c448e6e4dd179f5ca41ae653f7ef44902a10eaa18828e2be3a6247 SHA512 7bf2aa9442bc5041ce316af7edc2ff5c5da2ab1bf941c26c6592c8785dc0e47539da3bc2c1e570daafb6a293812f55b8b3b327f90ff9908984eba37e89d5eb7d
+DIST ncurses-6.4-20230527.patch.gz 9787 BLAKE2B 951a53b87056f2b3b530f03d0bab5a06ecf6bae0bf2fb580af8c0d96ae169e4813ed2063bf1696fd0fcc1cb0f7da03348904818de7ce454cbcb9a42bb939b6b8 SHA512 f600d7bdbde1f0752d3d530ceb98e9ba51a246a3bd898cc0d0d65bb8b51dab68fa5668789f5f86473c28eb890ec62cecf8e4dc901ac96fccf162c1a5f161f897
+DIST ncurses-6.4-20230527.patch.gz.asc 729 BLAKE2B 472421bd7c9093a293e99ec0f343ed471a77e7aa7f705cd99bb61f907c7059b134158c176fb232c542842ba042a1a88ca8e192df81d2d760a70f26a4d76ae624 SHA512 74a0ae5123b339c00f786d4d15a6c100d5d323731b7534e495dd396c9fd03b7ebc61d3fdf6eb71f2fa106160e15da5d093af6e4d53b4a6cfc53c436045a5a614
DIST ncurses-6.4-patches.tar.xz 63720 BLAKE2B 6b767f65a9c7e8f9fdebaa2623e3770872e710fa103d11e48509e5315ebf5ad1a37519b1b40c5138e631693fb2e2e30ea5eef11002698a341a623a85c5b0b4fc SHA512 5094f6cb8fa54d9df0802173f1e0ff2ad40fc3d4bd298c0742479f72ba4f9afee0ccf9f0a4eb068b0a5552523abf7b212861b61abbde6f69ff22d62dd686daa9
DIST ncurses-6.4.tar.gz 3612591 BLAKE2B 47fd9c2d27f44fa9942552881a471e5067465dbace40bf68b28998dded0556127a1d8662b96de4de4fd76c1c8b98bdae796036553ab4b05ca9f160839d841ba3 SHA512 1c2efff87a82a57e57b0c60023c87bae93f6718114c8f9dc010d4c21119a2f7576d0225dab5f0a227c2cfc6fb6bdbd62728e407f35fce5bf351bb50cf9e0fd34
DIST ncurses-6.4.tar.gz.sig 438 BLAKE2B e6a78b8d0cbce1577205b49b0260394094632cefd95294813c7e4e51a2908e8599a9f24b3b648e42ba16c015fb9424b2a82236f58aac3bf96f5400a50482e44e SHA512 f2a7859725b4d5d62f68006338d56598ac6b38a1448983108906e192f0ec922be287cc89bcc79c1ae49ebc80c967af3dd077427f35ae579b00d445c882414fed
DIST ncurses-6.4_p20230408-patches.tar.xz 80472 BLAKE2B 0ba8156ebd4f1691fec7bc1b800ef39ce6a4210573c027dd437919cdcd7c995830116da06c69f31c65923845a4d5c88e974673fac38acce5813f7d6cdc646e3e SHA512 32960e2cc4cd9dc60c38b49f46c5ce2c02179479abb66ca29f63cd06475ae8e26299a78b5f06762d114aefbbca3ba6fbebe7093a58106eeaa40cf500d21633a4
DIST ncurses-6.4_p20230424-patches.tar.xz 63080 BLAKE2B 3924b22d60d995766987a217b960b4c719a51f7334c9be80d19c0df4615e1f9c657507e77124cc8f5663249cbd480cac6570fdd49362a12e2fb69fcae8c800e8 SHA512 188b4da6d75cd15397977a07789ee6365262bd392fb7b2714e870834b2195d29fc5aadff6664a9a13d8d73e88aa43f502ae97c7b1f980231ce392a05ed4d3eb7
DIST ncurses-6.4_p20230506-patches.tar.xz 63132 BLAKE2B 5067aa5f82ff9c9ffad0cc9effc1990095b808a1c76ce1ad640aef39f896ed3f1a81caf000cbdb355a2f213133d877bad949ca14debeb88b2d0d3c3a8331e605 SHA512 cef883f486cf5b2abecfd951e408aeeb76257b53abea465b33b0e9f4b9bd9b7dc001f4aa48dcbd429143ed14b784bd841bcd5bc722d528d21521d5630dcf8315
+DIST ncurses-6.4_p20230527-patches.tar.xz 63080 BLAKE2B 9db4ac28c8936d3a9c6f3ca5cb8a4c92aa79ee4ce49789bcfc9c031a0454bf6f55a0544bc4a3dbb5c243ed9b2d0792afb98622a6a14b11675b7988100a650eb5 SHA512 3eacda173e8a177cd201ca3fef65311ac92e7e5af4039dc8a5792beae7db1d37efd06f5a55c249eebb771d1245995ff3a206a45794936b6b4299151666dbeade
EBUILD ncurses-6.3_p20221203-r2.ebuild 13799 BLAKE2B 76fd3bd7a051f7b43423498b1174d68cad7dec3049edc43b1ea1027622d91713d9e08f8a631ed7944e5a62feada261ea967df3f44afdb3f1e1532fec320af5ce SHA512 e61968d5618f12b1e75911646e97aeff820fbd00c48dd0d8c92d8a1ef4cbb3d21700f44e6d466f14d033d704c11d11b307c93fba55e6eec55fd55c53252ef29d
EBUILD ncurses-6.4.ebuild 13055 BLAKE2B 6064dd6f45e0a3854e7f53647ee3a6a8f9e7d0ca5326d9788a7a6a570d4b9f58b295d6ff5b3b9b0b725752d9afedae5132c03203d51b0e868bbba8eec2793c0c SHA512 57306ce9c1ef23661a81e39406669c063a9e773a26eb43af48d72b7ceed300fc03b4b174678ccfc9d5f2432d655fe02c0a26cdf48a501d322c18d4db48c9ad0f
EBUILD ncurses-6.4_p20230401.ebuild 13133 BLAKE2B d3f185d211e963223366560a70bfbf81c74aebe854dc67b224f0475f338fe9c4a5e6d226fd7f1e851ffd832ccf5118c3208b6b4eed125ed1f601ad4841b9d386 SHA512 64da8236a3fb8bd3c145b63a81bc34114dee8b7faafe0ea4f4b33b893e1656ab212e7c40e872b132aa46488ca8e93a07049c0e49fc91da55a800c09cd962d502
EBUILD ncurses-6.4_p20230424.ebuild 13196 BLAKE2B c60604211cfe1b032071ec2bc77784c468edde4b60cbc37f725cec82a297249550ac963a5266b47b6bb1962bc6739f0e7273cc406688b047f72549bb5109aebe SHA512 9257eaf910fee8e8860f1721a5b6cc88bbfd139d4776a3a7884fa5e2ad5ed4b453a715159e139484bfd68839dc7c69d936b40185060c05b6cc0396dbace47942
EBUILD ncurses-6.4_p20230506.ebuild 13343 BLAKE2B 365aeafe24d09c7020f5b4d561885f860c4c7aa1a0f59101865111252b6d3e9dea5034439851151a92bdb26a7e33e303928499c291021476e3b8280da21e3b3c SHA512 bae2072c674e3345cccb5fcfbfd78838852e13e847961a03eb12534e90701cda0dbac1a7827a0341a659affe6caa4d129ec39f96ce5ae1350e1a3ab8141b9bb1
+EBUILD ncurses-6.4_p20230527.ebuild 13376 BLAKE2B fac349fc116981a68f1fa38c064a91e3ae1d6a3754e3e3a8597ebcc40ba65940e67d580fe6d025c310769990f04bbc995d4cc83ec1060490d7bb3b9b941dd3db SHA512 a8ecbb165f1f1ff06a19ce2de5fe7ea10a8a408a4ceb6b4a51dc613e9ced07e6dd970c492e9df089b52b2d8c8927ee17ada002bf277e22a70f5ee1c20a5f87d1
MISC metadata.xml 1094 BLAKE2B a65bbb9584f77fb07fff735e6471ef48a5d63e7fa79112bf75df67f2f94e816706165fdd42a482708a7fd2ab3b3e308f9766eac0b39c3a4e31dcff5b3db25d57 SHA512 adf0f939a1e14c964bfb44ab80b1b8c1ee897a036a994848ba3e40280ab3a73ddb3beef540c905efd623e71b890c4c91e0b7c24651561d0e2bb2a4c86f039dba
diff --git a/sys-libs/ncurses/ncurses-6.4_p20230527.ebuild b/sys-libs/ncurses/ncurses-6.4_p20230527.ebuild
new file mode 100644
index 000000000000..7f0aa8fa0754
--- /dev/null
+++ b/sys-libs/ncurses/ncurses-6.4_p20230527.ebuild
@@ -0,0 +1,437 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# sys-libs/ncurses-compat can be bumped with sys-libs/ncurses as upstream
+# provide a configure option for the ABI version.
+
+VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/thomasdickey.asc
+inherit flag-o-matic toolchain-funcs multilib multilib-minimal preserve-libs usr-ldscript verify-sig
+
+MY_PV="${PV:0:3}"
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="Console display library"
+HOMEPAGE="https://www.gnu.org/software/ncurses/ https://invisible-island.net/ncurses/"
+# Keep invisible-mirror.net here as some users reported 403 forbidden with invisible-island.net
+SRC_URI="
+ mirror://gnu/ncurses/${MY_P}.tar.gz
+ https://invisible-island.net/archives/${PN}/${MY_P}.tar.gz
+ https://invisible-mirror.net/archives/${PN}/${MY_P}.tar.gz
+ verify-sig? ( mirror://gnu/ncurses/${MY_P}.tar.gz.sig )
+"
+
+GENTOO_PATCH_DEV=sam
+GENTOO_PATCH_PV=6.4_p20230527
+GENTOO_PATCH_NAME=${PN}-${GENTOO_PATCH_PV}-patches
+
+# Populated below in a loop. Do not add patches manually here.
+UPSTREAM_PATCHES=()
+
+if [[ ${PV} == *_p* ]] ; then
+ # Sometimes, after releases, there's no megapatch available yet.
+ #
+ # From upstream README at e.g. https://invisible-island.net/archives/ncurses/6.3/:
+ #
+ # "At times (generally to mark a relatively stable point), I create a rollup
+ # patch, which consists of all changes from the release through the current date."
+ #
+ # Also, from https://lists.gnu.org/archive/html/bug-ncurses/2019-08/msg00039.html,
+ # the patches are considered to be acceptable to use after some testing. They
+ # are both for development but also bug fixes.
+ #
+ # This array should contain a list of all the snapshots since the last
+ # release if there's no megapatch available yet.
+ PATCH_DATES=(
+ 20230107
+ 20230114
+ 20230121
+ 20230128
+ 20230211
+ 20230218
+ 20230225
+ 20230311
+ 20230401
+ 20230408
+ 20230415
+ 20230418
+ 20230423
+ 20230424
+ 20230429
+ 20230506
+ 20230514
+ 20230520
+
+ # Latest patch is just _pN = $(ver_cut 4)
+ $(ver_cut 4)
+ )
+
+ if [[ -z ${PATCH_DATES[@]} ]] ; then
+ SRC_URI+=" https://invisible-island.net/archives/${PN}/${PV/_p*}/${P/_p/-}.patch.sh.gz"
+ SRC_URI+=" verify-sig? ( https://invisible-island.net/archives/${PN}/${PV/_p*}/${P/_p/-}.patch.sh.gz.asc"
+
+ # If we have a rollup patch, use that instead of the individual ones.
+ UPSTREAM_PATCHES+=( "${WORKDIR}"/${P/_p/-}-patch.sh )
+ else
+ patch_url=
+ my_patch_index=
+
+ # We keep a bunch of mirrors here as we've had reports of invisible*.net
+ # being 403 forbidden for some users.
+ urls=(
+ "https://invisible-island.net/archives/${PN}/${PV/_p*}/${MY_P}-%s"
+ "https://invisible-mirror.net/archives/${PN}/${PV/_p*}/${MY_P}-%s"
+ "https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${MY_P}-%s"
+ )
+
+ for ((my_patch_index=0; my_patch_index < "${#PATCH_DATES[@]}"; my_patch_index++)); do
+ for url in "${urls[@]}" ; do
+ patch_url="$(printf ${urls} ${PATCH_DATES[${my_patch_index}]}.patch.gz)"
+ SRC_URI+=" ${patch_url}"
+ SRC_URI+=" verify-sig? ( ${patch_url}.asc )"
+ done
+
+ UPSTREAM_PATCHES+=( "${WORKDIR}"/${MY_P}-${PATCH_DATES[${my_patch_index}]}.patch )
+ done
+
+ unset patch_url
+ unset my_patch_index
+ unset urls
+ fi
+fi
+
+SRC_URI+=" https://dev.gentoo.org/~${GENTOO_PATCH_DEV}/distfiles/${CATEGORY}/${PN}/${GENTOO_PATCH_NAME}.tar.xz"
+
+LICENSE="MIT"
+# The subslot reflects the SONAME.
+SLOT="0/6"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="ada +cxx debug doc gpm minimal profile split-usr +stack-realign static-libs test tinfo trace"
+RESTRICT="!test? ( test )"
+
+DEPEND="gpm? ( sys-libs/gpm[${MULTILIB_USEDEP}] )"
+# Block the older ncurses that installed all files w/SLOT=5, bug #557472
+RDEPEND="
+ ${DEPEND}
+ !<=sys-libs/ncurses-5.9-r4:5
+ !<sys-libs/slang-2.3.2_pre23
+ !<x11-terms/rxvt-unicode-9.06-r3
+ !<x11-terms/st-0.6-r1
+"
+BDEPEND="verify-sig? ( sec-keys/openpgp-keys-thomasdickey )"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${UPSTREAM_PATCHES[@]}"
+
+ # When rebasing Gentoo's patchset, please use git from a clean
+ # src_prepare with upstream patches already applied. git am --reject
+ # the existing patchset and rebase as required. This makes it easier
+ # to manage future rebasing & adding new patches.
+ #
+ # For the same reasons, please include the original configure.in changes,
+ # NOT just the generated results!
+ "${WORKDIR}"/${GENTOO_PATCH_NAME}
+)
+
+src_unpack() {
+ # Avoid trying to verify our own patchset tarball, there's no point
+ if use verify-sig ; then
+ local file
+ for file in ${A} ; do
+ if [[ ${file} == ${MY_P}.tar.gz ]] ; then
+ verify-sig_verify_detached "${DISTDIR}"/${file} "${DISTDIR}"/${file}.sig
+ else
+ [[ ${file} == @(*${GENTOO_PATCH_NAME}.tar.xz|*.asc|*.sig) ]] && continue
+
+ verify-sig_verify_detached "${DISTDIR}"/${file} "${DISTDIR}"/${file}.asc
+ fi
+ done
+ fi
+
+ default
+}
+
+src_configure() {
+ # bug #115036
+ unset TERMINFO
+
+ tc-export_build_env BUILD_{CC,CXX,CPP}
+
+ # bug #214642
+ BUILD_CPPFLAGS+=" -D_GNU_SOURCE"
+
+ # Build the various variants of ncurses -- narrow, wide, and threaded. #510440
+ # Order matters here -- we want unicode/thread versions to come last so that the
+ # binaries in /usr/bin support both wide and narrow.
+ # The naming is also important as we use these directly with filenames and when
+ # checking configure flags.
+ NCURSES_TARGETS=(
+ ncurses
+ ncursesw
+ ncursest
+ ncursestw
+ )
+
+ # When installing ncurses, we have to use a compatible version of tic.
+ # This comes up when cross-compiling, doing multilib builds, upgrading,
+ # or installing for the first time. Build a local copy of tic whenever
+ # the host version isn't available. bug #249363, bug #557598
+ if ! has_version -b "~sys-libs/${P}:0" ; then
+ local lbuildflags="-static"
+
+ # some toolchains don't quite support static linking
+ local dbuildflags="-Wl,-rpath,${WORKDIR}/lib"
+ case ${CHOST} in
+ *-darwin*) dbuildflags= ;;
+ *-solaris*) dbuildflags="-Wl,-R,${WORKDIR}/lib" ;;
+ esac
+ echo "int main() {}" | \
+ $(tc-getCC) -o x -x c - ${lbuildflags} -pipe >& /dev/null \
+ || lbuildflags="${dbuildflags}"
+
+ # We can't re-use the multilib BUILD_DIR because we run outside of it.
+ BUILD_DIR="${WORKDIR}" \
+ CC=${BUILD_CC} \
+ CXX=${BUILD_CXX} \
+ CPP=${BUILD_CPP} \
+ CHOST=${CBUILD} \
+ CFLAGS=${BUILD_CFLAGS} \
+ CXXFLAGS=${BUILD_CXXFLAGS} \
+ CPPFLAGS=${BUILD_CPPFLAGS} \
+ LDFLAGS="${BUILD_LDFLAGS} ${lbuildflags}" \
+ do_configure cross --without-shared --with-normal --with-progs --without-ada
+ fi
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ if [[ ${ABI} == x86 ]] ; then
+ # For compatibility with older binaries at slight performance cost.
+ # bug #616402
+ use stack-realign && append-flags -mstackrealign
+ fi
+
+ local t
+ for t in "${NCURSES_TARGETS[@]}" ; do
+ do_configure "${t}"
+ done
+}
+
+do_configure() {
+ local target=$1
+ shift
+
+ mkdir "${BUILD_DIR}/${target}" || die
+ cd "${BUILD_DIR}/${target}" || die
+
+ local conf=(
+ # We need the basic terminfo files in /etc, bug #37026. We will
+ # add '--with-terminfo-dirs' and then populate /etc/terminfo in
+ # src_install() ...
+ --with-terminfo-dirs="${EPREFIX}/etc/terminfo:${EPREFIX}/usr/share/terminfo"
+
+ # Enable installation of .pc files.
+ --enable-pc-files
+ # This path is used to control where the .pc files are installed.
+ --with-pkg-config-libdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig"
+
+ # Now the rest of the various standard flags.
+ --with-shared
+ # (Originally disabled until bug #245417 is sorted out, but now
+ # just keeping it off for good, given nobody needed it until now
+ # (2022) and we're trying to phase out bdb.)
+ --without-hashed-db
+ $(use_with ada)
+ $(use_with cxx)
+ $(use_with cxx cxx-binding)
+ --with-cxx-shared
+ $(use_with debug)
+ $(use_with profile)
+ # The configure script uses ldd to parse the linked output which
+ # is flaky for cross-compiling/multilib/ldd versions/etc...
+ $(use_with gpm gpm libgpm.so.1)
+ # Required for building on mingw-w64, and possibly other windows
+ # platforms, bug #639670
+ $(use_enable kernel_Winnt term-driver)
+ --disable-termcap
+ --enable-symlinks
+ --with-manpage-format=normal
+ --enable-const
+ --enable-colorfgbg
+ --enable-hard-tabs
+ --enable-echo
+ $(use_enable !ada warnings)
+ $(use_with debug assertions)
+ $(use_enable !debug leaks)
+ $(use_with debug expanded)
+ $(use_with !debug macros)
+ $(multilib_native_with progs)
+ $(use_with test tests)
+ $(use_with trace)
+ $(use_with tinfo termlib)
+ --disable-stripping
+ --disable-pkg-ldflags
+ )
+
+ if [[ ${target} == ncurses*w ]] ; then
+ conf+=( --enable-widec )
+ else
+ conf+=( --disable-widec )
+ fi
+ if [[ ${target} == ncursest* ]] ; then
+ conf+=( --with-{pthread,reentrant} )
+ else
+ conf+=( --without-{pthread,reentrant} )
+ fi
+
+ # Make sure each variant goes in a unique location.
+ if [[ ${target} == "ncurses" ]] ; then
+ # "ncurses" variant goes into "${EPREFIX}"/usr/include
+ # It is needed on Prefix because the configure script appends
+ # "ncurses" to "${prefix}/include" if "${prefix}" is not /usr.
+ conf+=( --enable-overwrite )
+ else
+ conf+=( --includedir="${EPREFIX}"/usr/include/${target} )
+ fi
+ # See comments in src_configure.
+ if [[ ${target} != "cross" ]] ; then
+ local cross_path="${WORKDIR}/cross"
+ [[ -d ${cross_path} ]] && export TIC_PATH="${cross_path}/progs/tic"
+ fi
+
+ ECONF_SOURCE="${S}" econf "${conf[@]}" "$@"
+}
+
+src_compile() {
+ # See comments in src_configure.
+ if ! has_version -b "~sys-libs/${P}:0" ; then
+ BUILD_DIR="${WORKDIR}" do_compile cross -C progs tic$(get_exeext)
+ fi
+
+ multilib-minimal_src_compile
+}
+
+multilib_src_compile() {
+ local t
+ for t in "${NCURSES_TARGETS[@]}" ; do
+ do_compile "${t}"
+ done
+}
+
+do_compile() {
+ local target=$1
+ shift
+
+ cd "${BUILD_DIR}/${target}" || die
+
+ # A little hack to fix parallel builds ... they break when
+ # generating sources so if we generate the sources first (in
+ # non-parallel), we can then build the rest of the package
+ # in parallel. This is not really a perf hit since the source
+ # generation is quite small.
+ emake -j1 sources
+
+ # For some reason, sources depends on pc-files which depends on
+ # compiled libraries which depends on sources which ...
+ # Manually delete the pc-files file so the install step will
+ # create the .pc files we want.
+ rm -f misc/pc-files || die
+ emake "$@"
+}
+
+multilib_src_install() {
+ local target
+ for target in "${NCURSES_TARGETS[@]}" ; do
+ emake -C "${BUILD_DIR}/${target}" DESTDIR="${D}" install
+ done
+
+ # Move main libraries into /.
+ if multilib_is_native_abi ; then
+ gen_usr_ldscript -a \
+ "${NCURSES_TARGETS[@]}" \
+ $(usex tinfo 'tinfow tinfo' '')
+ fi
+
+ # Don't delete '*.dll.a', needed for linking, bug #631468
+ if ! use static-libs; then
+ find "${ED}"/usr/ -name '*.a' ! -name '*.dll.a' -delete || die
+ fi
+
+ # Build fails to create this ...
+ # -FIXME-
+ # Ugly hackaround for riscv having two parts libdir (bug #689240)
+ # Replace this hack with an official solution once we have one...
+ # -FIXME-
+ dosym $(sed 's@[^/]\+@..@g' <<< $(get_libdir))/share/terminfo \
+ /usr/$(get_libdir)/terminfo
+
+ # Remove obsolete libcurses symlink that is created by the build
+ # system. Technically, this could be also achieved
+ # via --disable-overwrite but it also moves headers implicitly,
+ # and we do not want to do this yet.
+ # bug #836696
+ rm "${ED}"/usr/$(get_libdir)/libcurses* || die
+}
+
+multilib_src_install_all() {
+ local terms=(
+ # Dumb/simple values that show up when using the in-kernel VT.
+ ansi console dumb linux
+ vt{52,100,102,200,220}
+ # [u]rxvt users used to be pretty common. Probably should drop this
+ # since upstream is dead and people are moving away from it.
+ rxvt{,-unicode}{,-256color}
+ # xterm users are common, as is terminals re-using/spoofing it.
+ xterm xterm-{,256}color
+ # screen is common (and reused by tmux).
+ screen{,-256color}
+ screen.xterm-256color
+ )
+ if use split-usr ; then
+ local x
+ # We need the basic terminfo files in /etc for embedded/recovery, bug #37026
+ einfo "Installing basic terminfo files in /etc..."
+ for x in "${terms[@]}"; do
+ local termfile=$(find "${ED}"/usr/share/terminfo/ -name "${x}" 2>/dev/null)
+ local basedir=$(basename "$(dirname "${termfile}")")
+
+ if [[ -n ${termfile} ]] ; then
+ dodir "/etc/terminfo/${basedir}"
+ mv "${termfile}" "${ED}/etc/terminfo/${basedir}/" || die
+ dosym "../../../../etc/terminfo/${basedir}/${x}" \
+ "/usr/share/terminfo/${basedir}/${x}"
+ fi
+ done
+
+ echo "CONFIG_PROTECT_MASK=\"/etc/terminfo\"" | newenvd - 50ncurses
+
+ use minimal && rm -r "${ED}"/usr/share/terminfo*
+ # Because ncurses5-config --terminfo returns the directory we keep it
+ # bug #245374
+ keepdir /usr/share/terminfo
+ elif use minimal ; then
+ # Keep only the basic terminfo files
+ find "${ED}"/usr/share/terminfo/ \
+ \( -type f -o -type l \) ${terms[*]/#/! -name } -delete , \
+ -type d -empty -delete || die
+ fi
+
+ cd "${S}" || die
+ dodoc ANNOUNCE MANIFEST NEWS README* TO-DO doc/*.doc
+ if use doc ; then
+ docinto html
+ dodoc -r doc/html/
+ fi
+}
+
+pkg_preinst() {
+ preserve_old_lib /$(get_libdir)/libncurses.so.5
+ preserve_old_lib /$(get_libdir)/libncursesw.so.5
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /$(get_libdir)/libncurses.so.5
+ preserve_old_lib_notify /$(get_libdir)/libncursesw.so.5
+}