aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2023-01-15 02:00:55 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2023-01-15 03:13:58 +0000
commit1c0f318b761394f2ee0ea17bb6df7124f901ae47 (patch)
treef6134a01d3d1620775578dc52c632cde0dc77fc8
parent2d00178fd4d952c698d3413800c3bd1b6cfc98a9 (diff)
downloadports-1c0f318b761394f2ee0ea17bb6df7124f901ae47.tar.gz
ports-1c0f318b761394f2ee0ea17bb6df7124f901ae47.zip
misc/json-tui: New port: JSON terminal UI made in C++
-rw-r--r--misc/Makefile1
-rw-r--r--misc/json-tui/Makefile25
-rw-r--r--misc/json-tui/distinfo3
-rw-r--r--misc/json-tui/files/patch-CMakeLists.txt97
-rw-r--r--misc/json-tui/pkg-descr12
5 files changed, 138 insertions, 0 deletions
diff --git a/misc/Makefile b/misc/Makefile
index 6603fa0ecfe4..33e6f49aa1db 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -195,6 +195,7 @@
SUBDIR += jargon
SUBDIR += jbidwatcher
SUBDIR += jojodiff
+ SUBDIR += json-tui
SUBDIR += kbdscan
SUBDIR += kcd
SUBDIR += kde-thumbnailer-chm
diff --git a/misc/json-tui/Makefile b/misc/json-tui/Makefile
new file mode 100644
index 000000000000..619a95e04ce3
--- /dev/null
+++ b/misc/json-tui/Makefile
@@ -0,0 +1,25 @@
+PORTNAME= json-tui
+DISTVERSIONPREFIX= v
+DISTVERSION= 1.3.0-13
+DISTVERSIONSUFFIX= -g6b38aba
+CATEGORIES= misc
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= JSON terminal UI made in C++
+WWW= https://github.com/ArthurSonzogni/json-tui
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= args>0:devel/args \
+ nlohmann-json>0:devel/nlohmann-json
+LIB_DEPENDS= libftxui-component.so:devel/ftxui
+
+USES= cmake compiler:c++20-lang
+
+USE_GITHUB= yes
+GH_ACCOUNT= ArthurSonzogni
+
+PLIST_FILES= bin/json-tui
+
+.include <bsd.port.mk>
diff --git a/misc/json-tui/distinfo b/misc/json-tui/distinfo
new file mode 100644
index 000000000000..2603f6e7c10f
--- /dev/null
+++ b/misc/json-tui/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1673746734
+SHA256 (ArthurSonzogni-json-tui-v1.3.0-13-g6b38aba_GH0.tar.gz) = dd7f9af11d9cf43418aad4ef79c3cf45c25565ddee6167423c14cc5b11e6df31
+SIZE (ArthurSonzogni-json-tui-v1.3.0-13-g6b38aba_GH0.tar.gz) = 353029
diff --git a/misc/json-tui/files/patch-CMakeLists.txt b/misc/json-tui/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..afefde952465
--- /dev/null
+++ b/misc/json-tui/files/patch-CMakeLists.txt
@@ -0,0 +1,97 @@
+--- CMakeLists.txt.orig 2023-01-15 01:39:31 UTC
++++ CMakeLists.txt
+@@ -1,47 +1,53 @@
+ cmake_minimum_required (VERSION 3.11)
+
++enable_language(CXX)
++
+ # Dependencies -----------------------------------------------------------------
+
+-include(FetchContent)
+-set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)
+-set(FETCHCONTENT_QUIET FALSE)
++#include(FetchContent)
++#set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)
++#set(FETCHCONTENT_QUIET FALSE)
+
+-FetchContent_Declare(ftxui
+- GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
+- GIT_TAG b56afce48ccd472cd2c3a53e619de0db1e7227a4
+- GIT_PROGRESS TRUE
+- GIT_SHALLOW FALSE
+-)
++#FetchContent_Declare(ftxui
++# GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
++# GIT_TAG b56afce48ccd472cd2c3a53e619de0db1e7227a4
++# GIT_PROGRESS TRUE
++# GIT_SHALLOW FALSE
++#)
+
+-FetchContent_Declare(json
+- URL https://github.com/nlohmann/json/releases/download/v3.10.5/json.tar.xz
+-)
++#FetchContent_Declare(json
++# URL https://github.com/nlohmann/json/releases/download/v3.10.5/json.tar.xz
++#)
+
+-FetchContent_Declare(args
+- GIT_REPOSITORY https://github.com/Taywee/args
+- GIT_TAG a48e1f880813b367d2354963a58dedbf2b708584
+- GIT_PROGRESS TRUE
+- GIT_SHALLOW FALSE
+-)
++#FetchContent_Declare(args
++# GIT_REPOSITORY https://github.com/Taywee/args
++# GIT_TAG a48e1f880813b367d2354963a58dedbf2b708584
++# GIT_PROGRESS TRUE
++# GIT_SHALLOW FALSE
++#)
+
+-FetchContent_GetProperties(ftxui)
+-if(NOT ftxui_POPULATED)
+- FetchContent_Populate(ftxui)
+- add_subdirectory(${ftxui_SOURCE_DIR} ${ftxui_BINARY_DIR} EXCLUDE_FROM_ALL)
+-endif()
++#FetchContent_GetProperties(ftxui)
++#if(NOT ftxui_POPULATED)
++# FetchContent_Populate(ftxui)
++# add_subdirectory(${ftxui_SOURCE_DIR} ${ftxui_BINARY_DIR} EXCLUDE_FROM_ALL)
++#endif()
+
+-FetchContent_GetProperties(json)
+-if(NOT json_POPULATED)
+- FetchContent_Populate(json)
+- add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
+-endif()
++#FetchContent_GetProperties(json)
++#if(NOT json_POPULATED)
++# FetchContent_Populate(json)
++# add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
++#endif()
+
+-FetchContent_GetProperties(args)
+-if(NOT args_POPULATED)
+- FetchContent_Populate(args)
+- add_subdirectory(${args_SOURCE_DIR} ${args_BINARY_DIR} EXCLUDE_FROM_ALL)
+-endif()
++#FetchContent_GetProperties(args)
++#if(NOT args_POPULATED)
++# FetchContent_Populate(args)
++# add_subdirectory(${args_SOURCE_DIR} ${args_BINARY_DIR} EXCLUDE_FROM_ALL)
++#endif()
+
++find_package(args REQUIRED)
++find_package(ftxui REQUIRED)
++find_package(nlohmann_json REQUIRED)
++
+ # Build ------------------------------------------------------------------------
+
+ configure_file(
+@@ -83,7 +89,6 @@ target_link_libraries(json-tui-lib
+
+ target_link_libraries(json-tui
+ PRIVATE json-tui-lib
+- PRIVATE args
+ )
+
+ include(cmake/options.cmake)
diff --git a/misc/json-tui/pkg-descr b/misc/json-tui/pkg-descr
new file mode 100644
index 000000000000..d552040289ab
--- /dev/null
+++ b/misc/json-tui/pkg-descr
@@ -0,0 +1,12 @@
+json-tui is a JSON terminal UI made in C++.
+
+Features:
+* Interactive: Use keyboard or mouse to scroll/expand objects.
+* Colors
+* Responsive: Adapt to the terminal dimensions. Very long text values are
+ wrapped on several lines.
+* Cross-platform
+* The output is displayed inline with the previous commands. Meaning you can
+ still see the json after leaving json-tui.
+* (Vim users): Also support j/k for navigation.
+* Table view: Turn arrays of objects into tables.