Package and add fortune-mod

You deserve a cookie!
This commit is contained in:
George Hilliard 2019-08-04 22:39:10 -05:00
parent 0d1560e3b0
commit dd718e3cdb
9 changed files with 152 additions and 0 deletions

View file

@ -1,5 +1,8 @@
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/fortune-mod/Config.in"
source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/robotfindskitten/Config.in"
source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/rogue/Config.in"
source "$BR2_EXTERNAL_BUSINESSCARD_PATH/package/librecode/Config.in"

View file

@ -4,6 +4,7 @@ BR2_CCACHE=y
BR2_SHARED_STATIC_LIBS=y
BR2_GLOBAL_PATCH_DIR="$(BR2_EXTERNAL_BUSINESSCARD_PATH)/patches"
BR2_KERNEL_HEADERS_5_1=y
BR2_TOOLCHAIN_BUILDROOT_WCHAR=y
# BR2_UCLIBC_INSTALL_UTILS is not set
BR2_GCC_VERSION_8_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
@ -63,5 +64,7 @@ BR2_PACKAGE_HOST_MTD=y
BR2_PACKAGE_HOST_MTOOLS=y
BR2_PACKAGE_HOST_SUNXI_TOOLS_F1C100S=y
BR2_PACKAGE_2048=y
BR2_PACKAGE_FORTUNE_MOD=y
BR2_PACKAGE_FORTUNE_MOD_COOKIES="computers;humorists;linuxcookie;literature;pratchett;startrek;wisdom"
BR2_PACKAGE_ROBOTFINDSKITTEN=y
BR2_PACKAGE_ROGUE=y

View file

@ -0,0 +1,11 @@
diff --git a/fortune-mod/datfiles/CMakeLists.txt b/fortune-mod/datfiles/CMakeLists.txt
index 00aa838..aa23f4c 100644
--- a/fortune-mod/datfiles/CMakeLists.txt
+++ b/fortune-mod/datfiles/CMakeLists.txt
@@ -1,4 +1,5 @@
-SET (_strfile "${CMAKE_CURRENT_BINARY_DIR}/../strfile")
+SET(STRFILE_PATH "${CMAKE_CURRENT_BINARY_DIR}/../strfile" CACHE STRING "Use host strfile (for cross compilation)")
+SET (_strfile "${STRFILE_PATH}")
FOREACH(c ${COOKIES})
SET(TARGET_NAME "cookie__${c}")
SET(DEST "${c}.dat")

View file

@ -0,0 +1,20 @@
diff --git a/fortune-mod/CMakeLists.txt b/fortune-mod/CMakeLists.txt
index dbe120d..cc272b8 100644
--- a/fortune-mod/CMakeLists.txt
+++ b/fortune-mod/CMakeLists.txt
@@ -261,6 +261,7 @@ SET (COOKIES
paradoxum
zippy
debian
+ CACHE STRING "Cookies to include"
)
SET (OFFENSIVE_COOKIES
@@ -290,6 +291,7 @@ SET (OFFENSIVE_COOKIES
songs-poems
vulgarity
zippy
+ CACHE STRING "Offensive cookies to include"
)
ADD_SUBDIRECTORY("datfiles")

View file

@ -0,0 +1,13 @@
diff --git a/fortune-mod/CMakeLists.txt b/fortune-mod/CMakeLists.txt
index dbe120d..cf36ad0 100644
--- a/fortune-mod/CMakeLists.txt
+++ b/fortune-mod/CMakeLists.txt
@@ -152,7 +152,7 @@ ENDMACRO()
my_exe(
"fortune"
"fortune/fortune.c"
- "games"
+ "bin"
)
my_exe(

View file

@ -0,0 +1,32 @@
config BR2_PACKAGE_FORTUNE_MOD
bool "fortune-mod"
select BR2_PACKAGE_LIBRECODE
help
The Fortune Cookie Program from BSD games
https://www.shlomifish.org/open-source/projects/fortune-mod/
if BR2_PACKAGE_FORTUNE_MOD
config BR2_PACKAGE_FORTUNE_MOD_COOKIES
string "fortune cookie files"
help
Specify which fortunes to include in a semicolon-separated list.
If empty, include them all.
config BR2_PACKAGE_FORTUNE_MOD_OFFENSIVE
bool "offensive cookies"
help
Enable potentially-offensive cookies.
if BR2_PACKAGE_FORTUNE_MOD_OFFENSIVE
config BR2_PACKAGE_FORTUNE_MOD_OCOOKIES
string "offensive fortune cookie files"
help
Specify which offensive fortunes to include in a semicolon-separated
list. If empty, include them all.
endif
endif

View file

@ -0,0 +1,47 @@
################################################################################
#
# fortune-mod
#
################################################################################
FORTUNE_MOD_VERSION = 2.10.0
FORTUNE_MOD_SITE = https://github.com/shlomif/fortune-mod/archive
FORTUNE_MOD_LICENSE = GPL-2.0
FORTUNE_MOD_LICENSE_FILES = COPYING
FORTUNE_MOD_DEPENDENCIES = host-fortune-mod librecode
FORTUNE_MOD_SUBDIR = fortune-mod
FORTUNE_MOD_SUPPORTS_IN_SOURCE_BUILD = NO
# This is a hack... fortune's build is mostly sane, but unfortunately it builds
# a helper tool, strfile, during build. CMake cannot cope with two toolchains.
# So, we build once for the host (it will install a bunch of fortunes into the
# host sysroot, but no matter). Then, to build the target, we patch the CMake
# very slightly to allow us to specify STRFILE_PATH, and give it the strfile we
# built earlier.
FORTUNE_MOD_CONF_OPTS += \
-DLOCALDIR=/usr/share/fortune/ \
-DCOOKIEDIR=/usr/share/fortune/ \
-DSTRFILE_PATH=$(HOST_DIR)/bin/strfile \
ifneq ($(BR2_PACKAGE_FORTUNE_MOD_COOKIES),)
# Do not double quote; Kconfig does that for us
FORTUNE_MOD_CONF_OPTS += -DCOOKIES=$(BR2_PACKAGE_FORTUNE_MOD_COOKIES)
endif
ifeq ($(BR2_PACKAGE_FORTUNE_MOD_OFFENSIVE),y)
FORTUNE_MOD_CONF_OPTS += \
-DLOCALODIR=/usr/share/fortune/off/ \
-DOCOOKIEDIR=/usr/share/fortune/off/ \
ifneq ($(BR2_PACKAGE_FORTUNE_MOD_OCOOKIES),)
# Do not double quote; Kconfig does that for us
FORTUNE_MOD_CONF_OPTS += -DOFFENSIVE_COOKIES=$(BR2_PACKAGE_FORTUNE_MOD_OCOOKIES)
endif
else
FORTUNE_MOD_CONF_OPTS += -DNO_OFFENSIVE=ON
endif
$(eval $(cmake-package))
$(eval $(host-cmake-package))

View file

@ -0,0 +1,8 @@
config BR2_PACKAGE_LIBRECODE
bool "librecode"
depends on BR2_USE_WCHAR
select BR2_PACKAGE_LIBICONV
help
Converts files between various character sets and usages
https://github.com/rrthomas/recode

View file

@ -0,0 +1,15 @@
################################################################################
#
# librecode
#
################################################################################
LIBRECODE_VERSION = 3.7.1
LIBRECODE_SITE = https://github.com/rrthomas/recode/releases/download/v$(LIBRECODE_VERSION)
LIBRECODE_SOURCE = recode-$(LIBRECODE_VERSION).tar.gz
LIBRECODE_LICENSE = LGPL-3.0
LIBRECODE_LICENSE_FILES = COPYING
LIBRECODE_INSTALL_STAGING = YES
LIBRECODE_DEPENDENCIES = libiconv
$(eval $(autotools-package))