Ports: Added a cmatrix port

This commit is contained in:
Manuel Palenzuela 2021-04-03 16:38:52 +02:00 committed by Andreas Kling
parent 5c67b2cb8f
commit d09cd85b6c
4 changed files with 57 additions and 0 deletions

View file

@ -13,6 +13,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`c-ray`](c-ray/) | C-Ray | | https://github.com/vkoskiv/c-ray |
| [`chester`](chester/) | Chester Gameboy Emulator | | https://github.com/veikkos/chester |
| [`cmake`](cmake/) | CMake | 3.19.4 | https://cmake.org/ |
| [`cmatrix`](cmatrix/) | cmatrix | | https://github.com/abishekvashok/cmatrix |
| [`curl`](curl/) | curl | 7.65.3 | https://curl.se/ |
| [`dash`](dash/) | DASH | 0.5.10.2 | http://gondor.apana.org.au/~herbert/dash |
| [`diffutils`](diffutils/) | GNU Diffutils | 3.5 | https://www.gnu.org/software/diffutils/ |

16
Ports/cmatrix/package.sh Executable file
View file

@ -0,0 +1,16 @@
#!/usr/bin/env -S bash ../.port_include.sh
port=cmatrix
useconfigure=true
version=git
depends="ncurses"
workdir=cmatrix-master
configopts="-DCMAKE_TOOLCHAIN_FILE=$SERENITY_ROOT/Toolchain/CMakeToolchain.txt"
files="https://github.com/abishekvashok/cmatrix/archive/refs/heads/master.zip cmatrix.zip"
configure() {
run cmake $configopts
}
install() {
run cp cmatrix "${SERENITY_BUILD_DIR}/Root/bin"
}

View file

@ -0,0 +1,27 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a808a98..7b8753a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,6 +5,9 @@ cmake_minimum_required(VERSION 2.8)
project(CMatrix LANGUAGES C)
set(VERSION "2.0")
+set(CMAKE_INCLUDE_PATH "${SERENITY_BUILD_DIR}/Root/usr/local/include/ncurses")
+set(CURSES_NCURSES_LIBRARY "${SERENITY_BUILD_DIR}/Root/usr/local/lib/libncurses.a")
+
# These are relative to CMAKE_INSTALL_PREFIX
# which by default is "/usr/local"
set(CONSOLE_FONTS_DIRS "share/consolefonts" "lib/kbd/consolefonts")
@@ -49,10 +52,8 @@ if (HAVE_GETOPT_H)
add_definitions(-DHAVE_GETOPT_H)
endif ()
-Set(CURSES_NEED_NCURSES TRUE)
-find_package(Curses)
-include_directories(${CURSES_INCLUDE_DIR})
-add_definitions(-DHAVE_NCURSES_H)
+find_package(Curses REQUIRED)
+include_directories(${CURSES_INCLUDE_PATH})
add_executable(cmatrix cmatrix.c)

View file

@ -0,0 +1,13 @@
diff --git a/cmatrix.c b/cmatrix.c
index d1f6b98..26d0648 100644
--- a/cmatrix.c
+++ b/cmatrix.c
@@ -48,7 +48,7 @@
#ifdef HAVE_NCURSES_H
#include <ncurses.h>
#else
-#include <curses.h>
+#include <ncurses/curses.h>
#endif
#ifdef HAVE_SYS_IOCTL_H