Skip to content

Commit fe359e9

Browse files
committed
pmars: Fix FTBFS due to ncurses change
WINDOW struct was turned opaque in recent versions, meaning that direct access to struct members is no longer supported. Add patch to replace direct access with calls to getter functions.
1 parent d778e0e commit fe359e9

2 files changed

Lines changed: 60 additions & 0 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
diff '--color=auto' -ruN a/src/curdisp.c b/src/curdisp.c
2+
--- a/src/curdisp.c 2025-05-08 23:23:48.070346219 +0200
3+
+++ b/src/curdisp.c 2025-05-08 23:29:33.851400436 +0200
4+
@@ -28,12 +28,6 @@
5+
#include "sim.h"
6+
#endif
7+
8+
-/* For window structure in BSD 4.4/Curses 8.x library */
9+
-#ifdef BSD44
10+
-#define _curx curx
11+
-#define _cury cury
12+
-#endif
13+
-
14+
typedef struct win_st {
15+
WINDOW *win;
16+
int page;
17+
@@ -428,18 +422,18 @@
18+
str--;
19+
maxchar++;
20+
leaveok(curwin, TRUE);
21+
- if (ox = curwin->_curx) {
22+
+ if (ox = getcurx(curwin)) {
23+
#if 0
24+
#ifdef ATTRIBUTE
25+
- mvwaddch(curwin, curwin->_cury, --ox, ' ' | attr);
26+
+ mvwaddch(curwin, getcury(curwin), --ox, ' ' | attr);
27+
#else
28+
- mvwaddch(curwin, curwin->_cury, --ox, ' ');
29+
+ mvwaddch(curwin, getcury(curwin), --ox, ' ');
30+
#endif
31+
#endif /* 0 */
32+
- mvwaddch(curwin, curwin->_cury, --ox, ' ');
33+
- wmove(curwin, curwin->_cury, ox);
34+
+ mvwaddch(curwin, getcury(curwin), --ox, ' ');
35+
+ wmove(curwin, getcury(curwin), ox);
36+
} else {
37+
- oy = curwin->_cury - 1;
38+
+ oy = getcury(curwin) - 1;
39+
#if 0
40+
#ifdef ATTRIBUTE
41+
mvwaddch(curwin, oy, COLS - 1, ' ' | attr);
42+
@@ -470,12 +464,12 @@
43+
if (ox--)
44+
#if 0
45+
#ifdef ATTRIBUTE
46+
- mvwaddch(curwin, curwin->_cury, ox, ' ' | attr);
47+
+ mvwaddch(curwin, getcury(curwin), ox, ' ' | attr);
48+
#else
49+
- mvwaddch(curwin, curwin->_cury, ox, ' ');
50+
+ mvwaddch(curwin, getcury(curwin), ox, ' ');
51+
#endif
52+
#endif /* 0 */
53+
- mvwaddch(curwin, curwin->_cury, ox, ' ');
54+
+ mvwaddch(curwin, getcury(curwin), ox, ' ');
55+
else
56+
#if 0
57+
#ifdef ATTRIBUTE

pkgs/by-name/pm/pmars/package.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ stdenv.mkDerivation (finalAttrs: {
3535

3636
# call to undeclared function 'sighandler' & undefined sighandler on Darwin
3737
./0002-fix-sighandler.patch
38+
39+
# ncurses' WINDOW struct was turned opaque for outside code, use functions for accessing values instead
40+
./0003-fix-ncurses-opaque-WINDOW.patch
3841
];
3942

4043
postPatch = ''

0 commit comments

Comments
 (0)