Skip to content

Commit

Permalink
xinv3d (1.8.0), 2024 Apr 05, add configure --enable-as-xinv3d
Browse files Browse the repository at this point in the history
Some Distros are aligned to xinvaders3d, and others as xinv3d.
The default build is xinvaders3d, but using --enable-as-xinv3d
allows you to create binary xinv3d instead of xinvaders3d plus
xinv3d.6, and associated desktop files too.

bugfix, also removed xinvaders.pc.in since this is not library
  • Loading branch information
JoesCat committed Apr 5, 2024
1 parent d761ec7 commit ccc4431
Show file tree
Hide file tree
Showing 14 changed files with 205 additions and 97 deletions.
6 changes: 6 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
xinv3d/xinvaders3d (1.8.0)
* Added build option "./configure --enable-as-xinv3d" so that
Xinvaders3D builds binary, man file, and desktop as Xinv3D.
* Added desktop scalable icon.
-- Joe Da Silva <digital@joescat.com> 2024 Apr 05

xinvaders3d (1.7.0)
* Added player_2, two player duel mode to Xinvaders3d game.
-- Joe Da Silva <digital@joescat.com> 2023 July 17
Expand Down
47 changes: 36 additions & 11 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,51 @@ SUBDIRS = . desktop

ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}

bin_PROGRAMS = xinvaders3d
bin_PROGRAMS =
noinst_PROGRAMS =
man_MANS =
if !WANTXINV3D
bin_PROGRAMS += xinvaders3d
noinst_PROGRAMS += xinv3d
man_MANS += xinvaders3d.6
endif
if WANTXINV3D
bin_PROGRAMS += xinv3d
noinst_PROGRAMS += xinvaders3d
man_MANS += xinv3d.6
endif
invaderCode = aliens.c camera.c effects.c game.c object.c mat4x4.c player.c vec4x1.c main-x11.c
noinst_HEADERS = camera.h defines.h externs.h game.h gtext.h mat4x4.h object.h system.h vec4x1.h

xinvaders3d_CPPFLAGS = ${CFLAGS} ${WCFLAGS}
xinvaders3d_LDFLAGS = ${LDFLAGS}
xinvaders3d_LDADD = -lX11 -lm
xinvaders3d_SOURCES = aliens.c camera.c effects.c game.c object.c mat4x4.c player.c vec4x1.c main-x11.c
noinst_HEADERS = camera.h defines.h externs.h game.h gtext.h mat4x4.h object.h system.h vec4x1.h
xinvaders3d_SOURCES = ${invaderCode}
xinvaders3d.$(OBJEXT): ${noinst_HEADERS}

man_MANS = xinvaders3d.6
xinv3d_CPPFLAGS = ${CFLAGS} ${WCFLAGS}
xinv3d_LDFLAGS = ${LDFLAGS}
xinv3d_LDADD = -lX11 -lm
xinv3d_SOURCES = ${invaderCode}
xinv3d.$(OBJEXT): ${noinst_HEADERS}

pkgconfigdir = @pkgconfigdir@
pkgconfig_DATA = xinvaders3d.pc
DISTCLEANFILES = xinv3d.6
DISTCHECK_CONFIGURE_FLAGS = --enable-debuggame --enable-debugkeyboard --disable-silent-rules --enable-as-xinv3d

EXTRA_DIST = \
AUTHORS Changelog main-dos.c main-w.c Makefile.dos Makefile.lin \
README.md README.dos README.win xinvaders3d.jpg xinvaders3d.6 \
packaging/xinvaders3d.spec.in packaging/xinvaders3d.spec \
AUTHORS Changelog main-dos.c main-w.c Makefile.dos Makefile.lin \
README.md README.dos README.win xinvaders3d.jpg xinvaders3d.6.in \
packaging/xinvaders3d.spec.in packaging/xinvaders3d.spec \
m4/ax_check_compile_flag.m4 ${noinst_HEADERS}
nodist_EXTRA_DATA = .git .github
nodist_EXTRA_DATA = .git .github xinvaders3d.6 xinv3d.6

strip:
$(STRIP) $(builddir)/xinvaders3d
${STRIP} ${builddir}/xinvaders3d
${STRIP} ${builddir}/xinv3d

xinv3d.6:
cp ${builddir}/xinvaders3d.6 ${builddir}/xinv3d.6

clean-local:
rm -f ${builddir}/xinv3d.6

6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ For users who do not have autoconf or automake available, there are release tagp
The first release was [![v1.5.0]](https://github.com/JoesCat/xinvaders3d/releases/tag/1.5.0)
Download the -dist- file and expand it so that you can run it.

NOTE: Distros that are planning to follow xinv3d instead of xinvaders3d
should use "./configure --enable-as-xinv3d" to build the project as xinv3d.
The xinv3d option was added with v1.8.0

Installing on Linux
```sh
./configure
Expand Down Expand Up @@ -153,4 +157,4 @@ for a default build and install on Linux, run:
make
sudo make install
```
The default install location is /usr/local/bin/xinvaders3d and you should also find it in your desktop games menu folder.
The default install location is /usr/local/bin/xinvaders3d and you should also find icons in your desktop games menu folder.
31 changes: 28 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

AC_PREREQ(2.61)

m4_define([xinvaders3d_version], [1.7.0])
m4_define([xinvaders3d_version], [1.8.0])
AC_INIT([xinvaders3d],[xinvaders3d_version],[https://github.com/JoesCat/xinvaders3d/issues],
[xinvaders3d],[https://github.com/JoesCat/xinvaders3d])
AC_CONFIG_SRCDIR([aliens.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_SYSTEM
AC_CANONICAL_TARGET
AC_CANONICAL_HOST
AC_CANONICAL_BUILD
AM_INIT_AUTOMAKE([foreign -Wall])
Expand Down Expand Up @@ -74,6 +74,26 @@ if test "x$enable_debugkeyboard" = xyes || test "x$enable_debugkeyboard" = xtrue
AC_DEFINE([GAME_DEBUG_KEYBOARD],1,[Define if debugging Keyboard using printf.])
fi

# Enable xinv3d backwards compatibility
AC_ARG_ENABLE([as_xinv3d],
[AS_HELP_STRING([--enable-as-xinv3d],
[Install Game as xinv3d for backwards compatibility @<:@default=no@:>@])],
[],[enable_as_xinv3d=no])
make_as_xinv3d=no
make_as_xinvaders3d=xinvaders3d
make_as_xinvaders3d_fn=XInvaders3D
make_as_xinvaders3d_uc=XINVADERS3D
if test "x$enable_as_xinv3d" = xyes || test "x$enable_as_xinv3d" = xtrue ; then
make_as_xinv3d=yes
make_as_xinvaders3d=xinv3d
make_as_xinvaders3d_fn=XInv3D
make_as_xinvaders3d_uc=XINV3D
fi
AM_CONDITIONAL([WANTXINV3D],[test x$make_as_xinv3d = xyes])
AC_SUBST([make_as_xinvaders3d])
AC_SUBST([make_as_xinvaders3d_fn])
AC_SUBST([make_as_xinvaders3d_uc])

#-------------------------------------------
# Check for and add usable compiler warnings
WCFLAGS=""
Expand All @@ -90,7 +110,11 @@ AC_LANG_POP
AC_SUBST([WCFLAGS])

#-------------------------------------------
AC_CONFIG_FILES([Makefile xinvaders3d.pc desktop/Makefile packaging/xinvaders3d.spec])
AC_CONFIG_FILES([
Makefile xinvaders3d.6 desktop/Makefile
desktop/xinvaders3d.desktop desktop/xinvaders3d.appdata.xml
desktop/xinvaders3d.xml desktop/xinvaders3d.metainfo.xml
packaging/xinvaders3d.spec])
AC_OUTPUT
AC_MSG_NOTICE([
Expand All @@ -104,5 +128,6 @@ Configuration:
Config CFLAGS "${CFLAGS}"
Config WFLAGS "${WCFLAGS}"
Config LDFLAGS "${LDFLAGS}"
Build project as ${make_as_xinvaders3d_fn}
])
122 changes: 93 additions & 29 deletions desktop/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,104 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#

# Where .desktop files go.
desktopdir = ${datarootdir}/applications
desktop_DATA = xinvaders3d.desktop

# Where appdata and metainfo xml files go
appdatadir = ${datarootdir}/appdata
appdata_DATA = xinvaders3d.appdata.xml
appdata_DATA =
deskpixsdir = ${datarootdir}/pixmaps
deskpixs_DATA =
desktopdir = ${datarootdir}/applications
desktop_DATA =
ICONSDIR = ${datarootdir}/icons
HICOLORDIR = ${datarootdir}/icons/hicolor
hicolor32x32dir = ${HICOLORDIR}/32x32/apps
hicolor64x64dir = ${HICOLORDIR}/64x64/apps
hicolor128x128dir = ${HICOLORDIR}/128x128/apps
hicolor256x256dir = ${HICOLORDIR}/256x256/apps
hicolorscalabledir = ${HICOLORDIR}/scalable/apps
hicolor32x32_DATA =
hicolor64x64_DATA =
hicolor128x128_DATA =
hicolor256x256_DATA =
hicolorscalable_DATA =
metainfodir = ${datarootdir}/metainfo
metainfo_DATA = xinvaders3d.metainfo.xml

# Where MIME data goes (Support for .xinvaders3d data files, for instance).
metainfo_DATA =
mimedir = ${datarootdir}/mime
mimepackagesdir = ${datarootdir}/mime/packages
mimepackages_DATA = xinvaders3d.xml
mimepackages_DATA =
if !WANTXINV3D
appdata_DATA += xinvaders3d.appdata.xml
deskpixs_DATA += 32x32/xinvaders3d.xpm 32x32/xinvaders3d.png
desktop_DATA += xinvaders3d.desktop
hicolor32x32_DATA += 32x32/xinvaders3d.png
hicolor64x64_DATA += 64x64/xinvaders3d.png
hicolor128x128_DATA += 128x128/xinvaders3d.png
hicolor256x256_DATA += 256x256/xinvaders3d.png
hicolorscalable_DATA += svg/xinvaders3d.svgz
metainfo_DATA += xinvaders3d.metainfo.xml
mimepackages_DATA += xinvaders3d.xml
endif
if WANTXINV3D
appdata_DATA += xinv3d.appdata.xml
deskpixs_DATA += ${builddir}/32x32/xinv3d.xpm ${builddir}/32x32/xinv3d.png
desktop_DATA += xinv3d.desktop
hicolor32x32_DATA += ${builddir}/32x32/xinv3d.png
hicolor64x64_DATA += ${builddir}/64x64/xinv3d.png
hicolor128x128_DATA += ${builddir}/128x128/xinv3d.png
hicolor256x256_DATA += ${builddir}/256x256/xinv3d.png
hicolorscalable_DATA += ${builddir}/svg/xinv3d.svgz
metainfo_DATA += xinv3d.metainfo.xml
mimepackages_DATA += xinv3d.xml
endif

#update-mime-database ${mimedir}
EXTRA_DIST = \
xinvaders3d.appdata.xml.in xinvaders3d.metainfo.xml.in \
xinvaders3d.xml.in 32x32/xinvaders3d.xpm 32x32/xinvaders3d.png \
64x64/xinvaders3d.png 128x128/xinvaders3d.png 256x256/xinvaders3d.png \
svg/xinvaders3d.svgz xinvaders3d.desktop.in

ICONSDIR = ${datarootdir}/icons
HICOLORDIR = ${datarootdir}/icons/hicolor
hicolor32x32dir = $(HICOLORDIR)/32x32/apps
hicolor64x64dir = $(HICOLORDIR)/64x64/apps
hicolor128x128dir = $(HICOLORDIR)/128x128/apps
hicolor256x256dir = $(HICOLORDIR)/256x256/apps
hicolorscalabledir = $(HICOLORDIR)/scalable/apps

hicolor32x32_DATA = 32x32/xinvaders3d.png
hicolor64x64_DATA = 64x64/xinvaders3d.png
hicolor128x128_DATA = 128x128/xinvaders3d.png
hicolor256x256_DATA = 256x256/xinvaders3d.png
hicolorscalable_DATA = svg/xinvaders3d.svgz
xinv3d.desktop:
cp ${builddir}/xinvaders3d.desktop ${builddir}/xinv3d.desktop

deskpixsdir = ${datarootdir}/pixmaps
deskpixs_DATA = 32x32/xinvaders3d.xpm 32x32/xinvaders3d.png
xinv3d.appdata.xml:
cp ${builddir}/xinvaders3d.appdata.xml ${builddir}/xinv3d.appdata.xml

xinv3d.metainfo.xml:
cp ${builddir}/xinvaders3d.metainfo.xml ${builddir}/xinv3d.metainfo.xml

xinv3d.xml:
cp ${builddir}/xinvaders3d.xml ${builddir}/xinv3d.xml

32x32/xinv3d.xpm:
mkdir -p ${builddir}/32x32
cp ${srcdir}/32x32/xinvaders3d.xpm ${builddir}/32x32/xinv3d.xpm

32x32/xinv3d.png:
mkdir -p ${builddir}/32x32
cp ${srcdir}/32x32/xinvaders3d.png ${builddir}/32x32/xinv3d.png

64x64/xinv3d.png:
mkdir -p ${builddir}/64x64
cp ${srcdir}/64x64/xinvaders3d.png ${builddir}/64x64/xinv3d.png

128x128/xinv3d.png:
mkdir -p ${builddir}/128x128
cp ${srcdir}/128x128/xinvaders3d.png ${builddir}/128x128/xinv3d.png

256x256/xinv3d.png:
mkdir -p ${builddir}/256x256
cp ${srcdir}/256x256/xinvaders3d.png ${builddir}/256x256/xinv3d.png

svg/xinv3d.svgz:
mkdir -p ${builddir}/svg
cp ${srcdir}/svg/xinvaders3d.svgz ${builddir}/svg/xinv3d.svgz

EXTRA_DIST = xinvaders3d.desktop xinvaders3d.appdata.xml xinvaders3d.metainfo.xml xinvaders3d.xml \
32x32/xinvaders3d.xpm 32x32/xinvaders3d.png 64x64/xinvaders3d.png 128x128/xinvaders3d.png \
256x256/xinvaders3d.png svg/xinvaders3d.svgz
clean-local:
rm -f ${builddir}/xinv3d.desktop
rm -f ${builddir}/xinv3d.appdata.xml
rm -f ${builddir}/xinv3d.metainfo.xml
rm -f ${builddir}/xinv3d.xml
rm -f ${builddir}/32x32/xinv3d.png
rm -f ${builddir}/32x32/xinv3d.xpm
rm -f ${builddir}/64x64/xinv3d.png
rm -f ${builddir}/128x128/xinv3d.png
rm -f ${builddir}/256x256/xinv3d.png
rm -f ${builddir}/svg/xinv3d.svgz
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2023 Joe Da Silva <digital@joescat.com> -->
<application>
<id type="desktop">xinvaders3d.desktop</id>
<id type="desktop">@make_as_xinvaders3d@.desktop</id>
<license>CC0-1.0</license>
<name>X Invaders 3D</name>
<name>@make_as_xinvaders3d_fn@</name>
<description>
<p xml:lang="C">
XInvaders 3D is a 3D vector-based space-invaders clone for the X Window System.</p>
@make_as_xinvaders3d@ is a 3D vector-based space-invaders clone for the X Window System.</p>
</description>
<url type="homepage">https://github.com/JoesCat/xinvaders3d</url>
</application>
14 changes: 0 additions & 14 deletions desktop/xinvaders3d.desktop

This file was deleted.

14 changes: 14 additions & 0 deletions desktop/xinvaders3d.desktop.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Desktop Entry]
Version=1.0
Name=@make_as_xinvaders3d_fn@
GenericName=X Invaders 3D Game
Comment=@make_as_xinvaders3d_fn@ is a 3D Vector Graphics Space Invaders clone for X11.
TryExec=@make_as_xinvaders3d@
Exec=@make_as_xinvaders3d@
Icon=@make_as_xinvaders3d@
StartupNotify=true
Terminal=false
Type=Application
Categories=Game;ArcadeGame;
MimeType=application/x-@make_as_xinvaders3d@
Keywords=space;invaders;action;arcade;game;X;window;
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2023 Joe Da Silva <digital@joescat.com> -->
<component type="desktop">
<id>xinvaders3d</id>
<launchable type="desktop-id">xinvaders3d.desktop</launchable>
<id>@make_as_xinvaders3d@</id>
<launchable type="desktop-id">@make_as_xinvaders3d@.desktop</launchable>
<metadata_license>CC0-1.0</metadata_license>
<name>X Invaders 3D</name>
<name>@make_as_xinvaders3d_fn@</name>
<summary>3D space invaders for X</summary>
<description>
<p xml:lang="C">
X Invaders 3D is a 3D vector-based space-invaders clone for the X Window System.</p>
@make_as_xinvaders3d_fn@ is a 3D vector-based space-invaders clone for the X Window System.</p>
<p xml:lang="C">
You are a lone star fighter facing endless waves of space aliens.
Your sole objective is to shoot down as many aliens as you can.
All objects are represented with 3D vector graphics, allowing the
aliens to grow in size as they move closer to you.</p>
<p xml:lang="es">
X Invaders 3D es un clon de space-invaders basado en vectores en 3D para el sistema X Window.</p>
@make_as_xinvaders3d_fn@ es un clon de space-invaders basado en vectores en 3D para el sistema X Window.</p>
<p xml:lang="es">
Eres un piloto que se enfrenta a interminables oleadas de extraterrestres.
Tienes que disparar a tantos alienígenas como puedas.
Todos los Aliens están representados en gráficos vectoriales en 3D.</p>
<p xml:lang="fr">
X Invaders 3D est un clone vectoriel d'envahisseurs spatiaux 3D pour le système X Window.</p>
@make_as_xinvaders3d_fn@ est un clone vectoriel d'envahisseurs spatiaux 3D pour le système X Window.</p>
<p xml:lang="fr">
Vous êtes un combattant solitaire face à des vagues interminables d'extraterrestres.
Votre seul objectif est d'abattre autant d'extraterrestres que vous le pouvez.
Tous les objets sont représentés avec des graphiques vectoriels 3D, permettant la
les extraterrestres grandissent à mesure qu'ils se rapprochent de vous.</p>
<p xml:lang="pt">
X Invaders 3D é um clone de space-invaders baseado em vetor 3D para o X11.</p>
@make_as_xinvaders3d_fn@ é um clone de space-invaders baseado em vetor 3D para o X11.</p>
<p xml:lang="pt">
Você é um piloto enfrentando ondas intermináveis de alienígenas do espaço.
Você tem que atirar no maior número de alienígenas que puder.
Expand All @@ -43,9 +43,7 @@
<update_contact>digital@joescat.com</update_contact>
<content_rating type="oars-1.1"/>
<releases>
<release date="2023-07-17" version="1.7.0"/>
<release date="2023-07-16" version="1.6.0"/>
<release date="2023-02-23" version="1.5.0"/>
<release date="2024-03-29" version="1.8.0"/>
</releases>
<project_license>GPL</project_license>
<developer_name>Don Llopis</developer_name>
Expand Down
6 changes: 3 additions & 3 deletions desktop/xinvaders3d.xml → desktop/xinvaders3d.xml.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/x-xinvaders3d">
<comment>XBall script</comment>
<mime-type type="application/x-@make_as_xinvaders3d@">
<comment>@make_as_xinvaders3d_fn@ scores</comment>
<generic-icon name="text-x-script"/>
<sub-class-of type="text/plain"/>
<glob pattern="*.xinvaders3d"/>
<glob pattern="*.@make_as_xinvaders3d@"/>
</mime-type>
</mime-info>
Loading

0 comments on commit ccc4431

Please sign in to comment.