Hi,

On 2/18/21 10:15 PM, Christian Weisgerber wrote:
Is anybody still interested in games/spider?  It's a 30-year old
solitaire game.

Please find attached the patch for -fnocommon. I hope I got it right.
Builds and works on amd64.

Best regards,

Michael
Index: patches/patch-gfx_c
===================================================================
RCS file: /cvs/ports/games/spider/patches/patch-gfx_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-gfx_c
--- patches/patch-gfx_c 16 Apr 2017 10:59:51 -0000      1.3
+++ patches/patch-gfx_c 18 Feb 2021 22:47:02 -0000
@@ -1,15 +1,60 @@
 $OpenBSD: patch-gfx_c,v 1.3 2017/04/16 10:59:51 espie Exp $
---- gfx.c.orig Sat Sep 28 19:46:10 1991
-+++ gfx.c      Sun Apr 16 12:08:18 2017
-@@ -15,6 +15,7 @@
-  */
+Index: gfx.c
+--- gfx.c.orig
++++ gfx.c
+@@ -16,6 +16,8 @@
  #include      "defs.h"
  #include      "globals.h"
-+#include <stdlib.h>
  
++#include <stdlib.h>
++
  #ifdef ROUND_CARDS
  #include      <X11/Xmu/Drawing.h>
-@@ -111,6 +112,12 @@ static GC backgc;
+ 
+@@ -25,8 +27,41 @@
+ Bool  round_cards = True;
+ #endif
+ 
+-static GC     cardgc;         /* gc in use when drawing cards */
+ 
++/* definitions of global variables */
++Display       *dpy;
++int   screen;
++Window        table;
++#ifdef        KITLESS
++Window        message_win;
++XFontStruct   *message_font;
++#endif        /* KITLESS */
++Pixmap        greenmap;
++Pixmap        redmap;
++Pixmap        logomap;
++
++unsigned long blackpixel;
++unsigned long whitepixel;
++unsigned long borderpixel;
++unsigned long greenpixel;
++
++Bool  is_color;
++
++CardList      deck;
++CardList      stack[NUM_STACKS];              /* tableau */
++CardList      piles[NUM_PILES];               /* full suits */
++
++int           table_height;
++int           table_width;
++
++int           draw_count;
++
++Bool          restart;
++int           deal_number;
++
++
++GC    cardgc;         /* gc in use when drawing cards */
++
+ #ifdef        KITLESS
+ static int    message_y;
+ static GC     textgc;
+@@ -111,6 +146,12 @@ static GC backgc;
  
  static int    back_delta_x, back_delta_y; /* how much to modify the TS origin 
by */
  
@@ -22,7 +67,7 @@ $OpenBSD: patch-gfx_c,v 1.3 2017/04/16 1
  #ifndef SMALL_CARDS
  static Bool   card_is_clipped;        /* optimizer for card drawing */
  #endif
-@@ -166,7 +173,7 @@ unsigned long      redpixel;
+@@ -166,7 +207,7 @@ unsigned long      redpixel;
        gcflags |= GCFont;
  
        textgc = XCreateGC(dpy, RootWindow(dpy, screen), gcflags, &gcv);
@@ -31,7 +76,7 @@ $OpenBSD: patch-gfx_c,v 1.3 2017/04/16 1
  
        tmpmap = XCreateBitmapFromData(dpy, RootWindow(dpy, screen),
                logo_bits, logo_width, logo_height);
-@@ -566,6 +573,7 @@ force_redraw()
+@@ -566,6 +607,7 @@ force_redraw()
   *
   * REMIND -- spread the deck a bit to show that there's more
   */
@@ -39,7 +84,7 @@ $OpenBSD: patch-gfx_c,v 1.3 2017/04/16 1
  redraw_deck(x, y, w, h)
  int   x, y, w, h;
  {
-@@ -599,6 +607,7 @@ CardPtr    tmp;
+@@ -599,6 +641,7 @@ CardPtr    tmp;
  }
  
  
@@ -47,7 +92,7 @@ $OpenBSD: patch-gfx_c,v 1.3 2017/04/16 1
  redraw_card_piles(x, y, w, h)
  int   x, y, w, h;
  {
-@@ -641,6 +650,7 @@ CardPtr    tmp;
+@@ -641,6 +684,7 @@ CardPtr    tmp;
  }
  
  
@@ -55,7 +100,7 @@ $OpenBSD: patch-gfx_c,v 1.3 2017/04/16 1
  redraw_card_stacks(x, y, w, h)
  int   x, y, w, h;
  {
-@@ -1011,6 +1021,7 @@ int      w, h;
+@@ -1011,6 +1055,7 @@ int      w, h;
   *
   * location is for center of pip
   */
@@ -63,7 +108,7 @@ $OpenBSD: patch-gfx_c,v 1.3 2017/04/16 1
  draw_did(suit, x, y)
  Suit  suit;
  int   x,y;
-@@ -1051,6 +1062,7 @@ int      w, h;
+@@ -1051,6 +1096,7 @@ int      w, h;
  /*
   * draws big center pip
   */
@@ -71,7 +116,7 @@ $OpenBSD: patch-gfx_c,v 1.3 2017/04/16 1
  draw_center_pip(suit, x, y)
  Suit  suit;
  int   x,y;
-@@ -1110,6 +1122,7 @@ int      x,y;
+@@ -1110,6 +1156,7 @@ int      x,y;
        draw_did(suit, x + CARD_COL3_X, y + CARD_ROW5_Y);
  }
  
@@ -79,7 +124,7 @@ $OpenBSD: patch-gfx_c,v 1.3 2017/04/16 1
  draw_six_pips(suit, x, y)
  Suit  suit;
  int   x, y;
-@@ -1129,6 +1142,7 @@ int      x, y;
+@@ -1129,6 +1176,7 @@ int      x, y;
        draw_did(suit, x + CARD_COL3_X, y + CARD_ROW5_Y);
  }
  
Index: patches/patch-globals_h
===================================================================
RCS file: /cvs/ports/games/spider/patches/patch-globals_h,v
retrieving revision 1.1
diff -u -p -r1.1 patch-globals_h
--- patches/patch-globals_h     25 Oct 2004 13:49:22 -0000      1.1
+++ patches/patch-globals_h     18 Feb 2021 22:47:02 -0000
@@ -1,6 +1,67 @@
 $OpenBSD: patch-globals_h,v 1.1 2004/10/25 13:49:22 brad Exp $
---- globals.h.orig     Sat Sep 28 13:46:20 1991
-+++ globals.h  Sun Oct 24 17:36:52 2004
+Index: globals.h
+--- globals.h.orig
++++ globals.h
+@@ -13,37 +13,37 @@
+ /*
+  * spider global variables
+  */
+-Display       *dpy;
+-int   screen;
+-Window        table;
++extern Display        *dpy;
++extern int    screen;
++extern Window table;
+ #ifdef        KITLESS
+-Window        message_win;
+-XFontStruct   *message_font;
++extern Window message_win;
++extern XFontStruct    *message_font;
+ #endif        /* KITLESS */
+-Pixmap        greenmap;
+-Pixmap        redmap;
+-Pixmap        logomap;
++extern Pixmap greenmap;
++extern Pixmap redmap;
++extern Pixmap logomap;
+ 
+-unsigned long blackpixel;
+-unsigned long whitepixel;
+-unsigned long borderpixel;
+-unsigned long greenpixel;
++extern unsigned long  blackpixel;
++extern unsigned long  whitepixel;
++extern unsigned long  borderpixel;
++extern unsigned long  greenpixel;
+ 
+-Bool  is_color;
++extern Bool   is_color;
+ 
+-CardList      deck;
+-CardList      stack[NUM_STACKS];              /* tableau */
+-CardList      piles[NUM_PILES];               /* full suits */
++extern CardList       deck;
++extern CardList       stack[NUM_STACKS];              /* tableau */
++extern CardList       piles[NUM_PILES];               /* full suits */
+ 
+-int           table_height;
+-int           table_width;
++extern int            table_height;
++extern int            table_width;
+ 
+-int           deck_index;
++extern int            deck_index;
+ 
+-int           draw_count;
++extern int            draw_count;
+ 
+-Bool          restart;
+-int           deal_number;
++extern Bool           restart;
++extern int            deal_number;
+ 
+ extern char   *version;
+ extern char   *build_date;
 @@ -90,12 +90,8 @@ void        redraw_table();
  void  button_press();
  void  button_release();

Reply via email to