Added fortune

This commit is contained in:
Alexander Hill 2026-01-11 18:31:57 -05:00
parent d4643cc677
commit fe29305d05
4 changed files with 51 additions and 2 deletions

View File

@ -19,7 +19,7 @@ Definitions:
| `diffutils` | Yes | Yes | | `diffutils` | Yes | Yes |
| `findutils` | Yes | Yes | | `findutils` | Yes | Yes |
| `flex` | Yes | Yes | | `flex` | Yes | Yes |
| `fortune-mod` | | `fortune-mod` | Yes | Yes |
| `gettext` | | `gettext` |
| `grep` | Yes | Yes | | `grep` | Yes | Yes |
| `groff` | Yes | Yes | | `groff` | Yes | Yes |

View File

@ -35,10 +35,11 @@ echo "Done!"
# NOTE: nasm requires autoconf and automake to build. ~ahill # NOTE: nasm requires autoconf and automake to build. ~ahill
# NOTE: dash requires flex and mawk to build. ~ahill # NOTE: dash requires flex and mawk to build. ~ahill
# NOTE: libelf requires zlib to build. ~ahill # NOTE: libelf requires zlib to build. ~ahill
# NOTE: fortune-mod requires cmake to build. ~ahill
cd /maple cd /maple
LAYER0="byacc bzip2 coreutils diffutils findutils grep gzip libressl m4 make mawk muon musl patch perl pkgconf sed tar xz zlib" LAYER0="byacc bzip2 coreutils diffutils findutils grep gzip libressl m4 make mawk muon musl patch perl pkgconf sed tar xz zlib"
LAYER1="autoconf automake flex groff libarchive libelf libtool" LAYER1="autoconf automake flex groff libarchive libelf libtool"
LAYER2="dash nasm cmake" LAYER2="dash nasm cmake fortune-mod"
PACKAGES="$LAYER0 $LAYER1 $LAYER2" PACKAGES="$LAYER0 $LAYER1 $LAYER2"
for pkg in $PACKAGES; do for pkg in $PACKAGES; do
treetap fetch /maple/sources/$pkg/$pkg.spec treetap fetch /maple/sources/$pkg/$pkg.spec

View File

@ -0,0 +1,38 @@
# Maintainer: Alexander Hill <ahill@breadpudding.dev>
SRC_HASH="1f387877254e95eab61f937257b42609f29b994ef0571531655bbfc3a2ac74ac"
SRC_NAME="fortune-mod"
SRC_URL="https://github.com/shlomif/fortune-mod/releases/download/fortune-mod-3.24.0/fortune-mod-3.24.0.tar.xz"
SRC_VERSION="3.24.0"
build() {
tar xf ../$SRC_FILENAME
# NOTE: There is no other way to prevent fortune from installing itself
# under /games, so we have to modify the CMakeLists in this case.
# ~ahill
sed -i "/fortune\/fortune.c/{n; s/games/bin/}" fortune-mod-$SRC_VERSION/CMakeLists.txt
# NOTE: Similarly, the same thing happens for man pages. ~ahill
sed -i "s|share/man/man|usr/share/man/man|" fortune-mod-$SRC_VERSION/cmake/Shlomif_Common.cmake
cat fortune-mod-3.24.0/cmake/Shlomif_Common.cmake
# NOTE: I don't agree with the offensive jokes included in this distribution
# but they are hidden behind the -o flag, and I want them to be seen
# as "unfunny" before the next generation thinks they're funny. ~ahill
cmake \
-B build-$SRC_VERSION \
-S fortune-mod-$SRC_VERSION \
-DCMAKE_INSTALL_PREFIX=$TT_INSTALLDIR \
-DCOOKIEDIR=$TT_INSTALLDIR/usr/share/games/fortunes \
-DNO_OFFENSIVE=OFF
cmake --build build-$SRC_VERSION --parallel $TT_PROCS
# Finally, we add our custom fortunefile into the mix. ~ahill
cp ../maple .
# NOTE: Is there a better way to do this? This probably won't survive
# cross-compilation. ~ahill
./build-$SRC_VERSION/strfile maple
}
package() {
cmake --install build-$SRC_VERSION --parallel $TT_PROCS
cp maple $TT_INSTALLDIR/usr/share/games/fortunes/
cp maple.dat $TT_INSTALLDIR/usr/share/games/fortunes/
ln -sf maple $TT_INSTALLDIR/usr/share/games/fortunes/maple.u8
}

10
sources/fortune-mod/maple Normal file
View File

@ -0,0 +1,10 @@
I am the power user and the daemons are my friend!
-- Alex
%
On a scale from telegraph to Pony Express, the carrier pigeons are freezing
mid-transit in this storm.
-- Alex
%
I'm just raw dogging it with the text editor.
-- Alex
%