about summary refs log tree commit diff
path: root/pkgs/development/libraries/libviper
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2021-11-28 16:14:46 +0000
committerSergei Trofimovich <slyich@gmail.com>2021-11-28 16:16:34 +0000
commit54765edc0bc6e349d52d46e7d52ee98e02c161d1 (patch)
treefbc46711a120011bbca5db393f23679cfeff16b8 /pkgs/development/libraries/libviper
parent78cb77b29d37a9663e05b61abb4fa09465da4b70 (diff)
libviper: fix build against ncurses-6.3
Without the change the build on upcoming `ncurses-6.3` fails as:

    w_decorate.c:45:17: error: format not a string literal and no format arguments [-Werror=format-security]
       45 |                 mvwprintw(window,0,x,title);
          |                 ^~~~~~~~~
Diffstat (limited to 'pkgs/development/libraries/libviper')
-rw-r--r--pkgs/development/libraries/libviper/default.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/pkgs/development/libraries/libviper/default.nix b/pkgs/development/libraries/libviper/default.nix
index e3b3674acc9f0..993e260b7bd35 100644
--- a/pkgs/development/libraries/libviper/default.nix
+++ b/pkgs/development/libraries/libviper/default.nix
@@ -7,8 +7,18 @@ stdenv.mkDerivation rec {
     sha256 = "1jvm7wdgw6ixyhl0pcfr9lnr9g6sg6whyrs9ihjiz0agvqrgvxwc";
   };
 
-  patchPhase = ''
+  postPatch = ''
     sed -i -e s@/usr/local@$out@ -e /ldconfig/d -e '/cd vdk/d' Makefile
+
+    # Fix pending upstream inclusion for ncurses-6.3 support:
+    #   https://github.com/TragicWarrior/libviper/pull/16
+    # Not applied as it due to unrelated code changes in context.
+    substituteInPlace viper_msgbox.c --replace \
+      'mvwprintw(window,height-3,tmp,prompt);' \
+      'mvwprintw(window,height-3,tmp,"%s",prompt);'
+    substituteInPlace w_decorate.c --replace \
+      'mvwprintw(window,0,x,title);' \
+      'mvwprintw(window,0,x,"%s",title);'
   '';
 
   preInstall = ''