Package Details: ninvaders 0.1.1-3

Git Clone URL: https://aur.archlinux.org/ninvaders.git (read-only, click to copy)
Package Base: ninvaders
Description: Ncurses based space invaders clone
Upstream URL: http://ninvaders.sourceforge.net/
Licenses: GPL
Submitter: vodik
Maintainer: vodik
Last Packager: vodik
Votes: 60
Popularity: 0.000000
First Submitted: 2008-11-21 12:32 (UTC)
Last Updated: 2015-07-16 16:48 (UTC)

Latest Comments

lmat commented on 2025-11-12 16:47 (UTC)

My fork wasn't compiling and I fixed it. @Keystone my fix was much smaller than yours. I can't get your patch to apply.

Keystone commented on 2025-11-12 01:24 (UTC) (edited on 2025-11-12 01:40 (UTC) by Keystone)

Following up with a similar patch to lmat below, but also with a handler fix. PKGBUILD:

...
depends=('ncurses')
source=("http://downloads.sourceforge.net/sourceforge/ninvaders/$pkgname-$pkgver.tar.gz"
  "ld_errors.patch")
sha256sums=('bfbc5c378704d9cf5e7fed288dac88859149bee5ed0850175759d310b61fd30b'
  '7cf07e09952fe8d431e93b7a1a935dc7e59d68341847dc941d47288cbb7198ec')

prepare() {
  cd "${srcdir}"/$pkgname-$pkgver

  patch -Np2 -i ${srcdir}/ld_errors.patch
}
...

ld_errors.patch:

diff --color -ura src/ninvaders-0.1.1/aliens.h modded/ninvaders-0.1.1/aliens.h
--- src/ninvaders-0.1.1/aliens.h    2003-05-08 15:19:50.000000000 -0400
+++ modded/ninvaders-0.1.1/aliens.h 2025-11-11 19:15:01.524687065 -0500
@@ -37,24 +37,10 @@
    int bottom;
    int speed;    // 0: no movement; 1: one per turn; etc.
 };
-   
-Aliens aliens;
-       
-int shipnum;   

 #define ALIENS_MAX_NUMBER_X 10
 #define ALIENS_MAX_NUMBER_Y 5  
-#define ALIENS_MAX_MISSILES 10 
-
-// todo: move to structure
-int lowest_ship[ALIENS_MAX_NUMBER_X];
-int alienshotx[ALIENS_MAX_MISSILES];
-int alienshoty[ALIENS_MAX_MISSILES];
-int alienshotnum;
-int alienBlock[ALIENS_MAX_NUMBER_Y][ALIENS_MAX_NUMBER_X];
-
-int bunker[BUNKERHEIGHT][BUNKERWIDTH + 1]; 
-
+#define ALIENS_MAX_MISSILES 10

 void aliensReset();
 void bunkersReset();   
@@ -74,5 +60,19 @@
 extern void bunkersClearElement(int x, int y);
 extern void bunkersClear();
 extern void bunkersRefresh();
+
+// objects
+extern Aliens aliens;
+
+extern int shipnum;
+
+// todo: move to structure
+extern int lowest_ship[ALIENS_MAX_NUMBER_X];
+extern int alienshotx[ALIENS_MAX_MISSILES];
+extern int alienshoty[ALIENS_MAX_MISSILES];
+extern int alienshotnum;
+extern int alienBlock[ALIENS_MAX_NUMBER_Y][ALIENS_MAX_NUMBER_X];
+
+extern int bunker[BUNKERHEIGHT][BUNKERWIDTH + 1];

 #endif
diff --color -ura src/ninvaders-0.1.1/globals.h modded/ninvaders-0.1.1/globals.h
--- src/ninvaders-0.1.1/globals.h   2003-05-08 15:19:50.000000000 -0400
+++ modded/ninvaders-0.1.1/globals.h    2025-11-11 19:17:08.672461197 -0500
@@ -25,7 +25,7 @@
 #ifndef GLOBALS
 #define GLOBALS

-extern void doSleep();
+extern void doSleep(int);

 extern void showUsage();
 extern void showVersion();
diff --color -ura src/ninvaders-0.1.1/nInvaders.c modded/ninvaders-0.1.1/nInvaders.c
--- src/ninvaders-0.1.1/nInvaders.c 2003-05-08 15:19:50.000000000 -0400
+++ modded/ninvaders-0.1.1/nInvaders.c  2025-11-11 19:28:44.482601250 -0500
@@ -36,6 +36,37 @@
 long score;
 int status; // status handled in timer

+
+#include "aliens.h"
+#include "nInvaders.h"
+#include "ufo.h"
+
+// aliens.h
+
+Aliens aliens;
+
+int shipnum;
+
+
+int lowest_ship[ALIENS_MAX_NUMBER_X];
+int alienshotx[ALIENS_MAX_MISSILES];
+int alienshoty[ALIENS_MAX_MISSILES];
+int alienshotnum;
+int alienBlock[ALIENS_MAX_NUMBER_Y][ALIENS_MAX_NUMBER_X];
+
+int bunker[BUNKERHEIGHT][BUNKERWIDTH + 1];
+
+
+// nInvaders.h
+
+int weite;
+int level;
+int skill_level;
+
+// ufo.h
+
+Ufo ufo;
+
 #define GAME_LOOP 1
 #define GAME_NEXTLEVEL 2
 #define GAME_PAUSED 3
@@ -206,7 +237,7 @@
  * timer
  * this method is executed every 1 / FPS seconds  
  */
-void handleTimer()
+void handleTimer(int unused)
 {
    static int aliens_move_counter = 0; 
    static int aliens_shot_counter = 0;
diff --color -ura src/ninvaders-0.1.1/nInvaders.h modded/ninvaders-0.1.1/nInvaders.h
--- src/ninvaders-0.1.1/nInvaders.h 2003-05-08 15:19:50.000000000 -0400
+++ modded/ninvaders-0.1.1/nInvaders.h  2025-11-11 19:17:04.473647356 -0500
@@ -46,15 +46,8 @@
 void doScoring(int alienType);

 // todo: let's try to not having to declare these "public"
-int weite;
-int level;
-int skill_level;
-   
-// included from globals.h
-extern void doSleep();
-extern void showUsage();
-extern void showVersion();
-extern void showGplShort();
-extern void showGpl();
+extern int weite;
+extern int level;
+extern int skill_level;

 #endif
diff --color -ura src/ninvaders-0.1.1/ufo.h modded/ninvaders-0.1.1/ufo.h
--- src/ninvaders-0.1.1/ufo.h   2003-05-08 15:19:50.000000000 -0400
+++ modded/ninvaders-0.1.1/ufo.h    2025-11-11 19:18:10.455189757 -0500
@@ -33,8 +33,8 @@
    int posX;     // horizontal position of aliens
    int posY;     // vertical position of aliens
 };
-   
-Ufo ufo;
+
+extern Ufo ufo;

 void ufoReset();
 int ufoShowUfo();

lmat commented on 2023-01-02 17:30 (UTC)

I just fixed all these problems. Not sure how it was compiling before.

I created the following ticket upstream: https://sourceforge.net/p/ninvaders/bugs/2/

I am also hosting a fork here so that you can play it immediately! https://sourceforge.net/p/ninvaders0/code/ref/main/

knt commented on 2022-12-16 20:34 (UTC)

Hello. Not compiling

/usr/bin/ld: ufo.o:(.bss+0x6d0): multiple definition of `aliens'; aliens.o:(.bss+0x6d0): first defined here
/usr/bin/ld: ufo.o:(.bss+0x0): multiple definition of `skill_level'; aliens.o:(.bss+0x0): first defined here
/usr/bin/ld: ufo.o:(.bss+0x4): multiple definition of `level'; aliens.o:(.bss+0x4): first defined here
/usr/bin/ld: ufo.o:(.bss+0x8): multiple definition of `weite'; aliens.o:(.bss+0x8): first defined here
/usr/bin/ld: ufo.o:(.bss+0x20): multiple definition of `bunker'; aliens.o:(.bss+0x20): first defined here
/usr/bin/ld: ufo.o:(.bss+0x540): multiple definition of `alienBlock'; aliens.o:(.bss+0x540): first defined here
/usr/bin/ld: ufo.o:(.bss+0x608): multiple definition of `alienshotnum'; aliens.o:(.bss+0x608): first defined here
/usr/bin/ld: ufo.o:(.bss+0x620): multiple definition of `alienshoty'; aliens.o:(.bss+0x620): first defined here
/usr/bin/ld: ufo.o:(.bss+0x660): multiple definition of `alienshotx'; aliens.o:(.bss+0x660): first defined here
/usr/bin/ld: ufo.o:(.bss+0x6a0): multiple definition of `lowest_ship'; aliens.o:(.bss+0x6a0): first defined here
/usr/bin/ld: ufo.o:(.bss+0x6c8): multiple definition of `shipnum'; aliens.o:(.bss+0x6c8): first defined here
/usr/bin/ld: player.o:(.bss+0x6f0): multiple definition of `aliens'; aliens.o:(.bss+0x6d0): first defined here
/usr/bin/ld: player.o:(.bss+0x18): multiple definition of `skill_level'; aliens.o:(.bss+0x0): first defined here
/usr/bin/ld: player.o:(.bss+0x6e8): multiple definition of `shipnum'; aliens.o:(.bss+0x6c8): first defined here
/usr/bin/ld: player.o:(.bss+0x1c): multiple definition of `level'; aliens.o:(.bss+0x4): first defined here
/usr/bin/ld: player.o:(.bss+0x20): multiple definition of `weite'; aliens.o:(.bss+0x8): first defined here
/usr/bin/ld: player.o:(.bss+0x28): multiple definition of `ufo'; ufo.o:(.bss+0x6e8): first defined here
/usr/bin/ld: player.o:(.bss+0x40): multiple definition of `bunker'; aliens.o:(.bss+0x20): first defined here
/usr/bin/ld: player.o:(.bss+0x560): multiple definition of `alienBlock'; aliens.o:(.bss+0x540): first defined here
/usr/bin/ld: player.o:(.bss+0x628): multiple definition of `alienshotnum'; aliens.o:(.bss+0x608): first defined here
/usr/bin/ld: player.o:(.bss+0x640): multiple definition of `alienshoty'; aliens.o:(.bss+0x620): first defined here
/usr/bin/ld: player.o:(.bss+0x680): multiple definition of `alienshotx'; aliens.o:(.bss+0x660): first defined here
/usr/bin/ld: player.o:(.bss+0x6c0): multiple definition of `lowest_ship'; aliens.o:(.bss+0x6a0): first defined here
/usr/bin/ld: nInvaders.o:(.bss+0x6f0): multiple definition of `weite'; aliens.o:(.bss+0x8): first defined here
/usr/bin/ld: nInvaders.o:(.bss+0x6ec): multiple definition of `level'; aliens.o:(.bss+0x4): first defined here
/usr/bin/ld: nInvaders.o:(.bss+0x6e8): multiple definition of `skill_level'; aliens.o:(.bss+0x0): first defined here
/usr/bin/ld: nInvaders.o:(.bss+0x6c8): multiple definition of `shipnum'; aliens.o:(.bss+0x6c8): first defined here
/usr/bin/ld: nInvaders.o:(.bss+0x18): multiple definition of `ufo'; ufo.o:(.bss+0x6e8): first defined here
/usr/bin/ld: nInvaders.o:(.bss+0x20): multiple definition of `bunker'; aliens.o:(.bss+0x20): first defined here
/usr/bin/ld: nInvaders.o:(.bss+0x540): multiple definition of `alienBlock'; aliens.o:(.bss+0x540): first defined here
/usr/bin/ld: nInvaders.o:(.bss+0x608): multiple definition of `alienshotnum'; aliens.o:(.bss+0x608): first defined here
/usr/bin/ld: nInvaders.o:(.bss+0x620): multiple definition of `alienshoty'; aliens.o:(.bss+0x620): first defined here
/usr/bin/ld: nInvaders.o:(.bss+0x660): multiple definition of `alienshotx'; aliens.o:(.bss+0x660): first defined here
/usr/bin/ld: nInvaders.o:(.bss+0x6a0): multiple definition of `lowest_ship'; aliens.o:(.bss+0x6a0): first defined here
/usr/bin/ld: nInvaders.o:(.bss+0x6d0): multiple definition of `aliens'; aliens.o:(.bss+0x6d0): first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:11: nInvaders] Error 1
==> ERROR: A failure occurred in build().

lmat commented on 2021-04-25 01:03 (UTC)

Just tried to install; got lots of "multiple definition" errors:

"ufo.o:(.bss+0x6d0): multiple definition of aliens; aliens.o:(.bss+0x6d0): first defined here" etc.

xkero commented on 2017-10-27 01:18 (UTC)

Had to install ncurses-full to resolve issue with tinfo: /usr/lib/libtinfo.so.6: error adding symbols: DSO missing from command line So maybe add that as a dependency, unless there's a better way to fix it. Another issue while playing is that Shields aren't being drawn correctly (weirdly misaligned), not sure if related to previous issue.

blippy commented on 2015-11-22 19:08 (UTC)

ninvaders: error while loading shared libraries: libncursesw.so.5: cannot open shared object file: No such file or directory I think Arch switched to ncurses version 6.