ncurses: Add meta.pkgConfigModules and test

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
John Ericson 2023-02-07 10:23:02 -05:00
parent 49786f55e1
commit 51d4fa881b

View file

@ -8,14 +8,15 @@
, withCxx ? !stdenv.hostPlatform.useAndroidPrebuilt , withCxx ? !stdenv.hostPlatform.useAndroidPrebuilt
, mouseSupport ? false, gpm , mouseSupport ? false, gpm
, unicodeSupport ? true , unicodeSupport ? true
, testers
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation (finalAttrs: {
version = "6.4"; version = "6.4";
pname = "ncurses" + lib.optionalString (abiVersion == "5") "-abi5-compat"; pname = "ncurses" + lib.optionalString (abiVersion == "5") "-abi5-compat";
src = fetchurl { src = fetchurl {
url = "https://invisible-island.net/archives/ncurses/ncurses-${version}.tar.gz"; url = "https://invisible-island.net/archives/ncurses/ncurses-${finalAttrs.version}.tar.gz";
hash = "sha256-aTEoPZrIfFBz8wtikMTHXyFjK7T8NgOsgQCBK+0kgVk="; hash = "sha256-aTEoPZrIfFBz8wtikMTHXyFjK7T8NgOsgQCBK+0kgVk=";
}; };
@ -169,11 +170,20 @@ stdenv.mkDerivation rec {
ANSI/POSIX-conforming UNIX. It has even been ported to OS/2 Warp! ANSI/POSIX-conforming UNIX. It has even been ported to OS/2 Warp!
''; '';
license = licenses.mit; license = licenses.mit;
pkgConfigModules = let
base = [
"form"
"menu"
"ncurses"
"panel"
] ++ lib.optional withCxx "ncurses++";
in base ++ lib.optionals unicodeSupport (map (p: p + "w") base);
platforms = platforms.all; platforms = platforms.all;
}; };
passthru = { passthru = {
ldflags = "-lncurses"; ldflags = "-lncurses";
inherit unicodeSupport abiVersion; inherit unicodeSupport abiVersion;
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
}; };
} })