aboutsummaryrefslogtreecommitdiff
path: root/sysutils/showbeastie
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2016-03-14 14:45:32 +0000
committerMark Felder <feld@FreeBSD.org>2016-03-14 14:45:32 +0000
commita279f6a74df512f80b5e7ceea2d176876e030cab (patch)
treeb10de8c1f81d6439b7c09184db693a65099778db /sysutils/showbeastie
parentb3909d5c4d2434aafcf77495a66d999ec8199e0a (diff)
downloadports-a279f6a74df512f80b5e7ceea2d176876e030cab.tar.gz
ports-a279f6a74df512f80b5e7ceea2d176876e030cab.zip
Preview FreeBSD loader logos in your terminal
PR: 207645 Submitted by: Tobias Kortkamp <t@tobik.me>
Notes
Notes: svn path=/head/; revision=411080
Diffstat (limited to 'sysutils/showbeastie')
-rw-r--r--sysutils/showbeastie/Makefile36
-rw-r--r--sysutils/showbeastie/files/patch-testmain.c43
-rw-r--r--sysutils/showbeastie/pkg-descr1
3 files changed, 80 insertions, 0 deletions
diff --git a/sysutils/showbeastie/Makefile b/sysutils/showbeastie/Makefile
new file mode 100644
index 000000000000..d58a6cc0b848
--- /dev/null
+++ b/sysutils/showbeastie/Makefile
@@ -0,0 +1,36 @@
+# Created by: Tobias Kortkamp <t@tobik.me>
+# $FreeBSD$
+
+PORTNAME= showbeastie
+PORTVERSION= 0.1
+CATEGORIES= sysutils
+MASTER_SITES=
+DISTFILES=
+
+MAINTAINER= t@tobik.me
+COMMENT= Preview FreeBSD loader logos
+
+LICENSE= BSD2CLAUSE
+
+# Let's pretend we build a kernel module, because we require the
+# kernel sources
+USES= kmod
+
+NO_FETCH= yes
+
+ALL_TARGET= testmain
+
+PLIST_FILES= bin/${PORTNAME}
+
+pre-patch:
+ @${MKDIR} ${WRKSRC}
+ @(cd ${SRC_BASE}/sys/boot/ficl && ${COPYTREE_SHARE} . ${WRKSRC})
+
+post-patch:
+ ${REINPLACE_CMD} 's|-I.*/\.\./common|-I${SRC_BASE}/sys/boot/common|g' \
+ ${WRKSRC}/Makefile
+
+do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/testmain ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+
+.include <bsd.port.mk>
diff --git a/sysutils/showbeastie/files/patch-testmain.c b/sysutils/showbeastie/files/patch-testmain.c
new file mode 100644
index 000000000000..1a9b24a062b1
--- /dev/null
+++ b/sysutils/showbeastie/files/patch-testmain.c
@@ -0,0 +1,43 @@
+--- testmain.c.orig 2016-03-02 15:04:22 UTC
++++ testmain.c
+@@ -316,17 +316,38 @@ int main(int argc, char **argv)
+ buildTestInterface(pSys);
+ pVM = ficlNewVM(pSys);
+
+- ficlEvaluate(pVM, ".ver .( " __DATE__ " ) cr quit");
++ ficlEvaluate(pVM, ": loader_color? ( -- ) TRUE ;");
++ ficlEvaluate(pVM, "vocabulary support-functions");
++ ficlEvaluate(pVM, ": contains? ( -- ) FALSE ;");
++ ficlEvaluate(pVM, ": any_conf_read? ( -- ) FALSE ;");
++ ficlEvaluate(pVM, ": load_kernel ( -- ) ;");
++ ficlEvaluate(pVM, ": load_modules ( -- ) ;");
++ ficlEvaluate(pVM, ": delay_execute ( -- ) ;");
++ ficlEvaluate(pVM, "variable logoX");
++ ficlEvaluate(pVM, "variable logoY");
++
++ sprintf(in, "load %s", "/boot/screen.4th");
++ ficlEvaluate(pVM, in);
++ sprintf(in, "load %s", "/boot/beastie.4th");
++ ficlEvaluate(pVM, in);
+
+ /*
+ ** load file from cmd line...
+ */
+ if (argc > 1)
+ {
+- sprintf(in, ".( loading %s ) cr load %s\n cr", argv[1], argv[1]);
++ sprintf(in, "load %s", argv[1], argv[1]);
+ ficlEvaluate(pVM, in);
++ } else {
++ fprintf(stderr, "usage: %s <logo.4th>\n", argv[0]);
++ return 1;
+ }
+
++ system("clear");
++ ficlEvaluate(pVM, "draw-beastie");
++ printf("\n\n");
++ return 0;
++
+ for (;;)
+ {
+ int ret;
diff --git a/sysutils/showbeastie/pkg-descr b/sysutils/showbeastie/pkg-descr
new file mode 100644
index 000000000000..f92725d28d7b
--- /dev/null
+++ b/sysutils/showbeastie/pkg-descr
@@ -0,0 +1 @@
+Preview FreeBSD loader logos in your terminal