summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2023-02-07 10:23:02 -0500
committerJohn Ericson <John.Ericson@Obsidian.Systems>2023-02-07 15:38:21 -0500
commit51d4fa881b70be4723ad08bf43888a5e2e4fd8c8 (patch)
treed78f27ff6ccc6e8614aa54e6523b9a3e8d0d85e3
parent49786f55e158fd4c8bc4c6f5ee96bede1250f646 (diff)
downloadnixpkgs-51d4fa881b70be4723ad08bf43888a5e2e4fd8c8.tar
nixpkgs-51d4fa881b70be4723ad08bf43888a5e2e4fd8c8.tar.gz
nixpkgs-51d4fa881b70be4723ad08bf43888a5e2e4fd8c8.tar.bz2
nixpkgs-51d4fa881b70be4723ad08bf43888a5e2e4fd8c8.tar.lz
nixpkgs-51d4fa881b70be4723ad08bf43888a5e2e4fd8c8.tar.xz
nixpkgs-51d4fa881b70be4723ad08bf43888a5e2e4fd8c8.tar.zst
nixpkgs-51d4fa881b70be4723ad08bf43888a5e2e4fd8c8.zip
ncurses: Add `meta.pkgConfigModules` and test
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
-rw-r--r--pkgs/development/libraries/ncurses/default.nix16
1 files changed, 13 insertions, 3 deletions
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index 4caf05ef3cf..4e2c731d7e2 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -8,14 +8,15 @@
 , withCxx ? !stdenv.hostPlatform.useAndroidPrebuilt
 , mouseSupport ? false, gpm
 , unicodeSupport ? true
+, testers
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   version = "6.4";
   pname = "ncurses" + lib.optionalString (abiVersion == "5") "-abi5-compat";
 
   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=";
   };
 
@@ -169,11 +170,20 @@ stdenv.mkDerivation rec {
       ANSI/POSIX-conforming UNIX. It has even been ported to OS/2 Warp!
     '';
     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;
   };
 
   passthru = {
     ldflags = "-lncurses";
     inherit unicodeSupport abiVersion;
+    tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
   };
-}
+})