# Maintainer: Alexey Pavlov _realname=ncurses pkgbase=mingw-w64-${_realname} pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}" pkgver=6.6 pkgrel=2 pkgdesc="System V Release 4.0 curses emulation library (mingw-w64)" arch=('any') mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64') url="https://www.gnu.org/software/ncurses/" msys2_references=( "cpe: cpe:/a:gnu:ncurses" "cpe: cpe:/a:ncurses_project:ncurses" ) license=('spdx:MIT') depends=("${MINGW_PACKAGE_PREFIX}-cc-libs" "${MINGW_PACKAGE_PREFIX}-libsystre") makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-autotools") source=("https://invisible-mirror.net/archives/ncurses/${_realname}-${pkgver}.tar.gz"{,.asc} 002-ncurses-config-win-paths.patch ncurses-6.3-cflags-private.patch ncurses-6.3-pkgconfig.patch) sha256sums=('355b4cbbed880b0381a04c46617b7656e362585d52e9cf84a67e2009b749ff11' 'SKIP' '5367d8f49aff92884b9daa014502df13e1812f1b7ee1b3a3cb18139f10039408' '3107029dfb807e338d34641d78329cd6725c58e6b873352621f4b9611a8380bf' 'b8544a607dfbeffaba2b087f03b57ed1fa81286afca25df65f61b04b5f3b3738') validpgpkeys=('19882D92DDA4C400C22C0D56CC2AF4472167BE03') # "Thomas E. Dickey (self-signed w/o SHA1) " apply_patch_with_msg() { for _patch in "$@" do msg2 "Applying ${_patch}" patch -Nbp1 -i "${srcdir}/${_patch}" done } prepare() { cd ${_realname}-${pkgver} apply_patch_with_msg 002-ncurses-config-win-paths.patch # do not leak build-time LDFLAGS into the pkgconfig files: # https://bugs.archlinux.org/task/68523 apply_patch_with_msg ncurses-6.3-pkgconfig.patch apply_patch_with_msg ncurses-6.3-cflags-private.patch } build() { mkdir -p build-${MSYSTEM} && cd build-${MSYSTEM} # It passes X_OK to access() on Windows which isn't supported with ucrt CFLAGS+=" -D__USE_MINGW_ACCESS" # nanosleep is only defined in pthread library export cf_cv_func_nanosleep=no ../${_realname}-${pkgver}/configure \ --prefix=${MINGW_PREFIX} \ --program-prefix="${MINGW_CHOST}-" \ --mandir=${MINGW_PREFIX}/share/man \ --with-cxx \ --with-cxx-shared \ --with-shared \ --without-ada \ --without-debug \ --without-pthread \ --enable-assertions \ --enable-colorfgbg \ --enable-database \ --enable-ext-colors \ --enable-ext-mouse \ --enable-interop \ --enable-sp-funcs \ --enable-term-driver \ --enable-widec \ --enable-pc-files \ --disable-home-terminfo \ --disable-rpath \ --disable-symlinks \ --with-pkg-config-libdir=${MINGW_PREFIX}/lib/pkgconfig make } package() { cd "${srcdir}"/build-${MSYSTEM} make DESTDIR="${pkgdir}" install # https://github.com/msys2/MINGW-packages/issues/27676#issuecomment-3902356595 rm "${pkgdir}"${MINGW_PREFIX}/include/ncursesw/nc_win32.h cp -r "${pkgdir}"${MINGW_PREFIX}/include/ncursesw "${pkgdir}"${MINGW_PREFIX}/include/ncurses cp "${pkgdir}"${MINGW_PREFIX}/lib/libncursesw.a "${pkgdir}"${MINGW_PREFIX}/lib/libncurses.a # Use predefined variables in pkgconfig files (#13958) for pcfile in "${pkgdir}${MINGW_PREFIX}"/lib/pkgconfig/*.pc; do sed -s "s|${MINGW_PREFIX}/include|\${includedir}|g" -i "${pcfile}" sed -s "s|${MINGW_PREFIX}/lib|\${libdir}|g" -i "${pcfile}" done install -Dm644 "${srcdir}"/${_realname}-${pkgver}/COPYING \ "${pkgdir}"${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE }