From 562b96c4ac0945795e416a983a00e0fa516a383a Mon Sep 17 00:00:00 2001 From: George Hilliard Date: Fri, 2 Aug 2019 17:54:59 -0500 Subject: [PATCH] Add games --- Config.in | 3 ++ .../thirtythreeforty_businesscard_defconfig | 3 ++ package/2048/2048.mk | 21 ++++++++++ package/2048/Config.in | 7 ++++ .../robotfindskitten/0001-execgamesdir.patch | 11 ++++++ package/robotfindskitten/Config.in | 7 ++++ package/robotfindskitten/robotfindskitten.mk | 18 +++++++++ .../rogue/0001-fix-build-from-archlinux.patch | 16 ++++++++ package/rogue/Config.in | 7 ++++ package/rogue/rogue.mk | 18 +++++++++ .../0001-ignore-setgid-if-unsupported.patch | 38 +++++++++++++++++++ 11 files changed, 149 insertions(+) create mode 100644 package/2048/2048.mk create mode 100644 package/2048/Config.in create mode 100644 package/robotfindskitten/0001-execgamesdir.patch create mode 100644 package/robotfindskitten/Config.in create mode 100644 package/robotfindskitten/robotfindskitten.mk create mode 100644 package/rogue/0001-fix-build-from-archlinux.patch create mode 100644 package/rogue/Config.in create mode 100644 package/rogue/rogue.mk create mode 100644 patches/rogue/0001-ignore-setgid-if-unsupported.patch diff --git a/Config.in b/Config.in index be9f66c..ce8e5c2 100644 --- a/Config.in +++ b/Config.in @@ -1,2 +1,5 @@ source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/sunxi-tools-f1c100s/Config.in.host" source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/sunxi-tools-f1c100s/Config.in" +source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/2048/Config.in" +source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/robotfindskitten/Config.in" +source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/rogue/Config.in" diff --git a/configs/thirtythreeforty_businesscard_defconfig b/configs/thirtythreeforty_businesscard_defconfig index 21b1c9d..827a098 100644 --- a/configs/thirtythreeforty_businesscard_defconfig +++ b/configs/thirtythreeforty_businesscard_defconfig @@ -60,3 +60,6 @@ BR2_PACKAGE_HOST_MKPASSWD=y BR2_PACKAGE_HOST_MTD=y BR2_PACKAGE_HOST_MTOOLS=y BR2_PACKAGE_HOST_SUNXI_TOOLS_F1C100S=y +BR2_PACKAGE_2048=y +BR2_PACKAGE_ROBOTFINDSKITTEN=y +BR2_PACKAGE_ROGUE=y diff --git a/package/2048/2048.mk b/package/2048/2048.mk new file mode 100644 index 0000000..a7ea710 --- /dev/null +++ b/package/2048/2048.mk @@ -0,0 +1,21 @@ +################################################################################ +# +# 2048 +# +################################################################################ + +2048_VERSION = 72725bab07d7686e5e5b3f68e398f43ffb6f49ce +2048_SITE = $(call github,mevdschee,2048.c,$(2048_VERSION)) +2048_LICENSE = MIT +2048_LICENSE_FILES = LICENSE +2048_DEPENDENCIES = ncurses + +define 2048_BUILD_CMDS + $(TARGET_CC) -o $(@D)/2048 $(@D)/2048.c +endef + +define 2048_INSTALL_TARGET_CMDS + $(INSTALL) -D -m 755 $(@D)/2048 $(TARGET_DIR)/usr/bin/2048 +endef + +$(eval $(generic-package)) diff --git a/package/2048/Config.in b/package/2048/Config.in new file mode 100644 index 0000000..e45fcea --- /dev/null +++ b/package/2048/Config.in @@ -0,0 +1,7 @@ +config BR2_PACKAGE_2048 + bool "2048" + select BR2_PACKAGE_NCURSES + help + Console version of the game "2048" for GNU/Linux + + https://github.com/mevdschee/2048.c diff --git a/package/robotfindskitten/0001-execgamesdir.patch b/package/robotfindskitten/0001-execgamesdir.patch new file mode 100644 index 0000000..ea5bfa8 --- /dev/null +++ b/package/robotfindskitten/0001-execgamesdir.patch @@ -0,0 +1,11 @@ +--- a/src/Makefile.in 2019-08-04 20:02:11.495635471 -0500 ++++ b/src/Makefile.in 2012-12-21 13:56:49.000000000 -0600 +@@ -199,7 +199,7 @@ + top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ +-execgamesdir = $(prefix)/games ++execgamesdir = $(prefix)/bin + AM_CPPFLAGS = -DSYSTEM_NKI_DIR=\"$(datadir)/games/robotfindskitten\" + robotfindskitten_SOURCES = robotfindskitten.c + SPLINT_SUPPRESSIONS = +charintliteral +charindex diff --git a/package/robotfindskitten/Config.in b/package/robotfindskitten/Config.in new file mode 100644 index 0000000..f520205 --- /dev/null +++ b/package/robotfindskitten/Config.in @@ -0,0 +1,7 @@ +config BR2_PACKAGE_ROBOTFINDSKITTEN + bool "robotfindskitten" + select BR2_PACKAGE_NCURSES + help + A Zen simulation. + + http://robotfindskitten.org/ diff --git a/package/robotfindskitten/robotfindskitten.mk b/package/robotfindskitten/robotfindskitten.mk new file mode 100644 index 0000000..cf55002 --- /dev/null +++ b/package/robotfindskitten/robotfindskitten.mk @@ -0,0 +1,18 @@ +################################################################################ +# +# robotfindskitten +# +################################################################################ + +ROBOTFINDSKITTEN_VERSION = 2.7182818.701 +ROBOTFINDSKITTEN_SITE = http://robotfindskitten.org/download/POSIX +ROBOTFINDSKITTEN_LICENSE = GPL-2.0 +ROBOTFINDSKITTEN_LICENSE_FILES = COPYING +ROBOTFINDSKITTEN_DEPENDENCIES = ncurses + +define ROBOTFINDSKITTEN_INSTALL_NKI + $(INSTALL) -Dm644 "$(@D)/nki/vanilla.nki" "$(TARGET_DIR)/usr/share/games/robotfindskitten/vanilla.nki" +endef +ROBOTFINDSKITTEN_POST_INSTALL_TARGET_HOOKS += ROBOTFINDSKITTEN_INSTALL_NKI + +$(eval $(autotools-package)) diff --git a/package/rogue/0001-fix-build-from-archlinux.patch b/package/rogue/0001-fix-build-from-archlinux.patch new file mode 100644 index 0000000..a387ec7 --- /dev/null +++ b/package/rogue/0001-fix-build-from-archlinux.patch @@ -0,0 +1,16 @@ +diff --git a/mdport.c b/mdport.c +index 72fdbb7..5ff523e 100644 +--- a/mdport.c ++++ b/mdport.c +@@ -259,9 +259,10 @@ md_hasclreol() + { + #if defined(clr_eol) + #ifdef NCURSES_VERSION ++TERMTYPE *tp = (TERMTYPE *) (cur_term); + if (cur_term == NULL) + return(0); +- if (cur_term->type.Strings == NULL) ++ if (tp->Strings == NULL) + return(0); + #endif + return((clr_eol != NULL) && (*clr_eol != 0)); diff --git a/package/rogue/Config.in b/package/rogue/Config.in new file mode 100644 index 0000000..3f2775c --- /dev/null +++ b/package/rogue/Config.in @@ -0,0 +1,7 @@ +config BR2_PACKAGE_ROGUE + bool "rogue" + select BR2_PACKAGE_NCURSES + help + The original dungeon crawl game + + http://www.roguebasin.com/index.php?title=Rogue diff --git a/package/rogue/rogue.mk b/package/rogue/rogue.mk new file mode 100644 index 0000000..dea6500 --- /dev/null +++ b/package/rogue/rogue.mk @@ -0,0 +1,18 @@ +################################################################################ +# +# rogue +# +################################################################################ + +ROGUE_VERSION = 5.4.4 +ROGUE_SITE = https://github.com/phs/rogue/archive +ROGUE_SOURCE = v$(ROGUE_VERSION).tar.gz +ROGUE_LICENSE = Custom +ROGUE_LICENSE_FILES = LICENSE.TXT +ROGUE_DEPENDENCIES = ncurses + +ROGUE_CONF_OPTS = \ + --enable-scorefile=/root/.rogue.scr \ + --enable-lockfile=/tmp/rogue.lck \ + +$(eval $(autotools-package)) diff --git a/patches/rogue/0001-ignore-setgid-if-unsupported.patch b/patches/rogue/0001-ignore-setgid-if-unsupported.patch new file mode 100644 index 0000000..e88cba7 --- /dev/null +++ b/patches/rogue/0001-ignore-setgid-if-unsupported.patch @@ -0,0 +1,38 @@ +diff --git a/mdport.c b/mdport.c +index 72fdbb7..6f90ebb 100644 +--- a/mdport.c ++++ b/mdport.c +@@ -29,6 +29,7 @@ + SUCH DAMAGE. + */ + ++#include + #include + #include + +@@ -377,8 +378,10 @@ md_normaluser() + #else + if (0) { + #endif +- perror("Could not drop setgid privileges. Aborting."); +- exit(1); ++ if(errno != ENOSYS) { ++ perror("Could not drop setgid privileges. Aborting."); ++ exit(1); ++ } + } + + #if defined(HAVE_SETRESUID) +@@ -390,8 +393,10 @@ md_normaluser() + #else + if (0) { + #endif +- perror("Could not drop setuid privileges. Aborting."); +- exit(1); ++ if(errno != ENOSYS) { ++ perror("Could not drop setuid privileges. Aborting."); ++ exit(1); ++ } + } + #endif + }