diff options
-rw-r--r-- | Ports/AvailablePorts.md | 1 | ||||
-rwxr-xr-x | Ports/cmatrix/package.sh | 16 | ||||
-rw-r--r-- | Ports/cmatrix/patches/fix_cmakelists.patch | 27 | ||||
-rw-r--r-- | Ports/cmatrix/patches/fix_include_header.patch | 13 |
4 files changed, 57 insertions, 0 deletions
diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 956961fa77..b9903c4ac2 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -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/ | diff --git a/Ports/cmatrix/package.sh b/Ports/cmatrix/package.sh new file mode 100755 index 0000000000..ed0cefa3fd --- /dev/null +++ b/Ports/cmatrix/package.sh @@ -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" +} diff --git a/Ports/cmatrix/patches/fix_cmakelists.patch b/Ports/cmatrix/patches/fix_cmakelists.patch new file mode 100644 index 0000000000..aaa5f9411c --- /dev/null +++ b/Ports/cmatrix/patches/fix_cmakelists.patch @@ -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) + diff --git a/Ports/cmatrix/patches/fix_include_header.patch b/Ports/cmatrix/patches/fix_include_header.patch new file mode 100644 index 0000000000..fb4eb62d93 --- /dev/null +++ b/Ports/cmatrix/patches/fix_include_header.patch @@ -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 |