Giter VIP home page Giter VIP logo

jermbox's Introduction

NOTICE

I am moving this repository to Sourcehut. That means that this repository will be archived and any future development (if any) will be done there.

Jermbox

A Janet native module for working with a forked version of nullgemm's Termbox Next.

This module allows for easy buidng of terminal UIs.

OS Requirements

This module is build and tested on Arch Linux. I can only guarantee that this will work on most linux systems.

I don't have the means to test this on any other environment than Linux. If you would like to see it work on your OS of choice then feel free to put in a PR or fork from this repo.

Install Package

sudo jpm install https://github.com/MorganPeterson/jermbox

Examples

Example usage can be found in the examples and test directory.

Ackowledgement

This borrows heavily from sepisoad's code: jtbox. Their code, though, works with the original termbox which was abandoned by the author and refactored for some unknown reason.

There are a lot more additions to my module then what sepisoad had done. Hopefully, for the better.

jermbox's People

Contributors

cfiggers avatar morganpeterson avatar svercl avatar tionis avatar travonted avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jermbox's Issues

Problems building with the latest version on Arch Linux

With the latest version of jermbox I am receiving errors in the compilation phase with jpm -l build:

❱ jpm -l build
compiling termbox_next/src/term.c to build/termbox_next___src___term.static.o...
compiling termbox_next/src/termbox.c to build/termbox_next___src___termbox.o...
compiling termbox_next/src/ringbuffer.c to build/termbox_next___src___ringbuffer.o...
compiling src/jermbox.c to build/src___jermbox.o...
compiling termbox_next/src/utf8.c to build/termbox_next___src___utf8.o...
compiling termbox_next/src/term.c to build/termbox_next___src___term.o...
compiling termbox_next/src/input.c to build/termbox_next___src___input.o...
compiling termbox_next/src/memstream.c to build/termbox_next___src___memstream.o...
generating meta file build/jermbox.meta.janet...
compiling src/jermbox.c to build/src___jermbox.static.o...
compiling termbox_next/src/termbox.c to build/termbox_next___src___termbox.static.o...
compiling termbox_next/src/utf8.c to build/termbox_next___src___utf8.static.o...
compiling termbox_next/src/ringbuffer.c to build/termbox_next___src___ringbuffer.static.o...
compiling termbox_next/src/input.c to build/termbox_next___src___input.static.o...
compiling termbox_next/src/memstream.c to build/termbox_next___src___memstream.static.o...
termbox_next/src/termbox.c: In function ‘wait_fill_event.part.0’:
termbox_next/src/termbox.c:814:22: error: argument 2 is null but the corresponding size argument 3 value is 4 [-Werror=nonnull]
  814 |       ssize_t byts = read(winch_fds[0], 0, sizeof(int));
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from termbox_next/src/termbox.c:17:
/usr/include/unistd.h:360:16: note: in a call to function ‘read’ declared with attribute ‘access (write_only, 2, 3)’
  360 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
termbox_next/src/termbox.c: In function ‘wait_fill_event.part.0’:
termbox_next/src/termbox.c:814:22: error: argument 2 is null but the corresponding size argument 3 value is 4 [-Werror=nonnull]
  814 |       ssize_t byts = read(winch_fds[0], 0, sizeof(int));
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from termbox_next/src/termbox.c:17:
/usr/include/unistd.h:360:16: note: in a call to function ‘read’ declared with attribute ‘access (write_only, 2, 3)’
  360 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
cc1: all warnings being treated as errors

My OS:

uname -a
Linux bagr 5.10.75-1-MANJARO #1 SMP PREEMPT Wed Oct 20 19:19:52 UTC 2021 x86_64 GNU/Linux

My Janet:

❱ janet -v
1.18.2-dev-75f56b68

Can you please help me, how to fix this?

Ubuntu errs on unused-result

When I try to install jermbox on the VPS running Ubuntu, compilation fails with:

 error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]

OS:

Linux neil 5.4.0-42-generic #46-Ubuntu SMP Fri Jul 10 00:24:02 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

I am not very good with C, so there could be something I can do on my own, yet it is probably out of my expertise.

Full printout:

# jpm install https://github.com/MorganPeterson/jermbox.git
/usr/local/lib/janet/jpm/shutil.janet:68:25: compile warning (normal): file/popen is deprecated
Already up to date.
compiling termbox_next/src/termbox.c to build/termbox_next___src___termbox.o...
compiling termbox_next/src/memstream.c to build/termbox_next___src___memstream.o...
compiling termbox_next/src/termbox.c to build/termbox_next___src___termbox.static.o...
compiling termbox_next/src/memstream.c to build/termbox_next___src___memstream.static.o...
termbox_next/src/memstream.c: In function ‘memstream_flush’:
termbox_next/src/memstream.c:16:2: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
   16 |  write(s->file, s->data, s->pos);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
termbox_next/src/memstream.c: In function ‘memstream_flush’:
termbox_next/src/memstream.c:16:2: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
   16 |  write(s->file, s->data, s->pos);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
error: command failed with non-zero exit code 1
  in os/execute [src/core/os.c] on line 1031
  in shell [/usr/local/lib/janet/jpm/shutil.janet] (tailcall) on line 110, column 5
  in <anonymous> [/usr/local/lib/janet/jpm/rules.janet] on line 18, column 20
  in executor [/usr/local/lib/janet/jpm/rules.janet] on line 25, column 8
  in worker [/usr/local/lib/janet/jpm/dagbuild.janet] on line 65, column 23
  in <anonymous> [/usr/local/lib/janet/jpm/dagbuild.janet] on line 21, column 43
  in pmap [/usr/local/lib/janet/jpm/dagbuild.janet] on line 26, column 7
  in pdag [/usr/local/lib/janet/jpm/dagbuild.janet] (tailcall) on line 71, column 3
  in <anonymous> [/usr/local/lib/janet/jpm/pm.janet] on line 194, column 9
  in <anonymous> [/usr/local/lib/janet/jpm/pm.janet] on line 181, column 5
  in bundle-install [/usr/local/lib/janet/jpm/pm.janet] on line 179, column 3
  in install [/usr/local/lib/janet/jpm/commands.janet] (tailcall) on line 105, column 20
  in _thunk [/usr/local/bin/jpm] (tailcall) on line -1, column -1
  in cli-main [boot.janet] on line 3644, column 17
termbox_next/src/termbox.c: In function ‘sigwinch_handler’:
termbox_next/src/termbox.c:780:2: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
  780 |  write(winch_fds[1], &zzz, sizeof(int));
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
termbox_next/src/termbox.c: In function ‘wait_fill_event’:
termbox_next/src/termbox.c:879:4: error: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Werror=unused-result]
  879 |    read(winch_fds[0], &zzz, sizeof(int));
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
termbox_next/src/termbox.c: In function ‘sigwinch_handler’:
termbox_next/src/termbox.c:780:2: error: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Werror=unused-result]
  780 |  write(winch_fds[1], &zzz, sizeof(int));
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
termbox_next/src/termbox.c: In function ‘wait_fill_event’:
termbox_next/src/termbox.c:879:4: error: ignoring return value of ‘read’, declared with attribute warn_unused_result [-Werror=unused-result]
  879 |    read(winch_fds[0], &zzz, sizeof(int));
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
cc1: all warnings being treated as errors
cc1: all warnings being treated as errors

problems building on macOS

noting that macOS isn't supported... I just wanted to file this for other folks who might be wondering if it's just them, or who have macs and better C chops than me and can do something to fix it. ;)

macOS Monterey v12.4 on an m1 mac.

pertinent error:

termbox_next/src/termbox.c:115:13: error: use of undeclared identifier 'SIGWINCH'
  sigaction(SIGWINCH, &sa, 0);

full output:

❯ jpm install https://github.com/MorganPeterson/jermbox
Initialized empty Git repository in /usr/local/lib/janet/.cache/git__https___github.com_MorganPeterson_jermbox/.git/
remote: Enumerating objects: 105, done.
remote: Counting objects: 100% (105/105), done.
remote: Compressing objects: 100% (65/65), done.
Receiving objects: 100% (105/105), 18.04 KiB | 9.02 MiB/s, done.
Resolving deltas: 100% (46/46), done.
remote: Total 105 (delta 46), reused 78 (delta 25), pack-reused 0
From github.com:MorganPeterson/jermbox
 * [new branch]      bug-2-compiler -> origin/bug-2-compiler
 * [new branch]      formatting     -> origin/formatting
 * [new branch]      main           -> origin/main
From github.com:MorganPeterson/jermbox
 * branch            HEAD       -> FETCH_HEAD
HEAD is now at 4f0649a Merge pull request #5 from TravonteD/fix-header-path
Submodule 'termbox_next' (https://github.com/MorganPeterson/termbox_next) registered for path 'termbox_next'
Cloning into '/usr/local/lib/janet/.cache/git__https___github.com_MorganPeterson_jermbox/termbox_next'...
Submodule path 'termbox_next': checked out '3fdc0310432321846c597f386c7734925d32d188'
compiling src/jermbox.c to build/src___jermbox.o...
compiling termbox_next/src/memstream.c to build/termbox_next___src___memstream.o...
compiling termbox_next/src/term.c to build/termbox_next___src___term.o...
compiling termbox_next/src/termbox.c to build/termbox_next___src___termbox.o...
compiling termbox_next/src/utf8.c to build/termbox_next___src___utf8.o...
compiling termbox_next/src/ringbuffer.c to build/termbox_next___src___ringbuffer.o...
compiling termbox_next/src/input.c to build/termbox_next___src___input.o...
generating meta file build/jermbox.meta.janet...
termbox_next/src/termbox.c:115:13: error: use of undeclared identifier 'SIGWINCH'
  sigaction(SIGWINCH, &sa, 0);
            ^
1 error generated.
error: command failed with non-zero exit code 1
compiling src/jermbox.c to build/src___jermbox.static.o...
compiling termbox_next/src/memstream.c to build/termbox_next___src___memstream.static.o...
compiling termbox_next/src/term.c to build/termbox_next___src___term.static.o...
error: build fail
  in pdag [/usr/local/lib/janet/jpm/dagbuild.janet] (tailcall) on line 79, column 23
  in <anonymous> [/usr/local/lib/janet/jpm/pm.janet] on line 236, column 9
  in <anonymous> [/usr/local/lib/janet/jpm/pm.janet] on line 221, column 5
  in bundle-install [/usr/local/lib/janet/jpm/pm.janet] on line 219, column 3
  in install [/usr/local/lib/janet/jpm/commands.janet] (tailcall) on line 186, column 20
  in _thunk [/usr/local/bin/jpm] (tailcall) on line -1, column -1
  in cli-main [boot.janet] on line 3831, column 17

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.