From nobody Wed Jun 12 09:15:22 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vzfyf4PfNz5P41b; Wed, 12 Jun 2024 09:15:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vzfyf3rwWz4cpV; Wed, 12 Jun 2024 09:15:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718183722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y7VGoH7spu4fdQNqiaUS5jsujvOavzNuV9Zz53A2tlM=; b=jscFWsHPlz3axwJdMfKuGyAqSFd9HTIcfwb3gcK5s9AJCTDPeSznbrBIzrXPEelmA1OakC XzBVWlMGGYUlmJ7ccOuKMKMYb85Hu4jJ8Bs4dYXzavFkJg+iwKbcdWeDbG0yoT4O03yh1Z l/9ELglspGvhmFc2rN3UCdv7jKdxj2J8AUv4W7MOddfsqzm8Qgzq4dS1V7E1sQ+w0CewYT PMF6GJc7o4JCk2u6X3MOs+QBE466nn0o3McqEZ+S1G85hwEEURaTxjXodxs6D9tMhyBeuY lhUrJVB+E91n3ZDp3qedawkJqUyrJaOyEPMOgYq+9qcNnHp3ViHgkb2dGunDIw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1718183722; a=rsa-sha256; cv=none; b=r9yaIaRz77dpFtPievSGBWddUIA4IgyyQ9qdqIuuL76RRullZRMrr+wzYMIWqgShi9syhs lkpRostqiPbNYemuv/lTRV8m8clhgRkj1igJWaSmlyxrs4KvIWTb0VCTdZguymqQy/OiR8 TdhDfmIlTi/RLAAtLqdjEw0GtLsZGLW3IPdlBdbHReKgoo1ahxL654Z6ugWkWcscKBcjZ0 W6iy3ZYpbkVqGFoMh0C1k2gIe/HatL8Fzw6rfQDmKwvniZsxKiVtpvUxK+V/wcio5xQ3ef IZ0Yaz0QF2BomdX4WVmA36TBHBT7ka3kU47e36LOanaXnN74bdBiaEPK29Sehg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1718183722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Y7VGoH7spu4fdQNqiaUS5jsujvOavzNuV9Zz53A2tlM=; b=Y0ipV785gcRKiSAROwaMHSjfgAnFPcF9yBl4e10B1E/mwg+Qm2mzRUmTKwG6rV1zVUwvBK XytGOwDaAWkh2vhdWgGPeQRaZ38Of7zn58wEnAWGt9yMn0f/v67FspkDvON56lsQELMCPz Fl0C44BR+IHO+b1bilxcpzYvkLV620u9a3CLVNAptgiKDRt56Zlqt+DzETtxC7XrCq83Bo tJj9usRtgEgJE9sCeMK+8MBD0kmlj5X1eEIzc0JtfPB3DbRvWMvGkW0ybBu2Q7yVaWWx/N hKZoz9kPnI8MffvZlgVjX2Xk4ui3Q4giTwQKmQAFGJreUT4+TNV+h7E3DBuTdQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vzfyf3SNgzn5k; Wed, 12 Jun 2024 09:15:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45C9FMQf089082; Wed, 12 Jun 2024 09:15:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45C9FMS9089079; Wed, 12 Jun 2024 09:15:22 GMT (envelope-from git) Date: Wed, 12 Jun 2024 09:15:22 GMT Message-Id: <202406120915.45C9FMS9089079@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: 4c4329a8a3cb - main - sysutils/rw-tui: New port: Read & Write Everything (only memory for now on FreeBSD) List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4c4329a8a3cbae54ceb2d16c6ce90e60eb02d456 Auto-Submitted: auto-generated The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=4c4329a8a3cbae54ceb2d16c6ce90e60eb02d456 commit 4c4329a8a3cbae54ceb2d16c6ce90e60eb02d456 Author: Yuri Victorovich AuthorDate: 2024-06-12 09:14:44 +0000 Commit: Yuri Victorovich CommitDate: 2024-06-12 09:15:20 +0000 sysutils/rw-tui: New port: Read & Write Everything (only memory for now on FreeBSD) --- sysutils/Makefile | 1 + sysutils/rw-tui/Makefile | 26 ++++++++++ sysutils/rw-tui/distinfo | 3 ++ sysutils/rw-tui/files/patch-CMakeLists.txt | 16 +++++++ sysutils/rw-tui/files/patch-src_dataview.cpp | 21 ++++++++ sysutils/rw-tui/files/patch-src_main.cpp | 72 ++++++++++++++++++++++++++++ sysutils/rw-tui/pkg-descr | 1 + 7 files changed, 140 insertions(+) diff --git a/sysutils/Makefile b/sysutils/Makefile index 5d5dc42e3c8f..25665d4d2792 100644 --- a/sysutils/Makefile +++ b/sysutils/Makefile @@ -1324,6 +1324,7 @@ SUBDIR += rust-coreutils SUBDIR += rust-findutils SUBDIR += rw + SUBDIR += rw-tui SUBDIR += s-tui SUBDIR += s6 SUBDIR += s6-rc diff --git a/sysutils/rw-tui/Makefile b/sysutils/rw-tui/Makefile new file mode 100644 index 000000000000..eb60676d76db --- /dev/null +++ b/sysutils/rw-tui/Makefile @@ -0,0 +1,26 @@ +PORTNAME= rw-tui +DISTVERSIONPREFIX= v +DISTVERSION= 1.0.0-1 +DISTVERSIONSUFFIX= -gfd62cef +CATEGORIES= sysutils + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Read & Write Everything (only memory for now on FreeBSD) +WWW= https://github.com/LeeKyuHyuk/rw-tui + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +LIB_DEPENDS= libftxui-screen.so:devel/ftxui + +USES= cmake #localbase:ldflags + +USE_GITHUB= yes +GH_ACCOUNT= LeeKyuHyuk + +PLIST_FILES= bin/${PORTNAME} + +do-install: + ${INSTALL_PROGRAM} ${BUILD_WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin + +.include diff --git a/sysutils/rw-tui/distinfo b/sysutils/rw-tui/distinfo new file mode 100644 index 000000000000..509023c1485b --- /dev/null +++ b/sysutils/rw-tui/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1718043067 +SHA256 (LeeKyuHyuk-rw-tui-v1.0.0-1-gfd62cef_GH0.tar.gz) = 920ce14c2d4932277fac1a97906cdd731953a7eaeb30f99a6d0c4254cbedfbd1 +SIZE (LeeKyuHyuk-rw-tui-v1.0.0-1-gfd62cef_GH0.tar.gz) = 2005010 diff --git a/sysutils/rw-tui/files/patch-CMakeLists.txt b/sysutils/rw-tui/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..3bceb9a1b4a7 --- /dev/null +++ b/sysutils/rw-tui/files/patch-CMakeLists.txt @@ -0,0 +1,16 @@ +--- CMakeLists.txt.orig 2023-07-30 15:32:56 UTC ++++ CMakeLists.txt +@@ -14,11 +14,10 @@ set_property(TARGET rw-tui PROPERTY CXX_STANDARD 17) + + set_property(TARGET rw-tui PROPERTY CXX_STANDARD 17) + +-add_subdirectory(${CMAKE_SOURCE_DIR}/lib/ftxui ${CMAKE_BINARY_DIR}/ftxui EXCLUDE_FROM_ALL) ++find_package(ftxui REQUIRED) + + target_link_libraries(rw-tui + PRIVATE ftxui::screen + PRIVATE ftxui::dom + PRIVATE ftxui::component +- -static + ) +\ No newline at end of file diff --git a/sysutils/rw-tui/files/patch-src_dataview.cpp b/sysutils/rw-tui/files/patch-src_dataview.cpp new file mode 100644 index 000000000000..802791eb1b14 --- /dev/null +++ b/sysutils/rw-tui/files/patch-src_dataview.cpp @@ -0,0 +1,21 @@ +--- src/dataview.cpp.orig 2023-07-30 15:32:56 UTC ++++ src/dataview.cpp +@@ -5,6 +5,9 @@ + #include "global.hpp" + #include "utils/hex_string.hpp" + ++#include ++ ++ + DataView::DataView(uint64_t address) { + mContainer = Container::Vertical({}); + mAddress = address; +@@ -25,7 +28,7 @@ void DataView::refresh() { + void DataView::refresh() { + void *mapBase, *virtAddress; + mContainer->DetachAllChildren(); +- mapBase = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, ++ mapBase = mmap(0, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, + *gFileDescriptor, mAddress & ~MAP_MASK); + if (mapBase == (void *)-1) + FATAL; diff --git a/sysutils/rw-tui/files/patch-src_main.cpp b/sysutils/rw-tui/files/patch-src_main.cpp new file mode 100644 index 000000000000..f303ecfd92f3 --- /dev/null +++ b/sysutils/rw-tui/files/patch-src_main.cpp @@ -0,0 +1,72 @@ +--- src/main.cpp.orig 2023-07-30 15:32:56 UTC ++++ src/main.cpp +@@ -25,7 +25,13 @@ + #include "utils/is_file_exist.hpp" + + #define DEV_MEM "/dev/mem" +-#define DEV_FMEM "/dev/fmem" ++#if defined(__linux__) ++# define DEV_FMEM "/dev/fmem" ++#elif defined(__FreeBSD__) ++# define DEV_KMEM "/dev/kmem" ++#else ++# error "Unsupported OS" ++#endif + + using namespace std; + using namespace ftxui; +@@ -71,6 +77,7 @@ int main(int argc, char *argv[]) { + gShowMessageModal = &showMessageModal; + gMessageStr = &messageStr; + ++#if defined(__linux__) + if (isFileExist(DEV_FMEM) == false) { + if (isFileExist(DEV_MEM) == false) { + cerr << "[ERROR] Neither /dev/mem nor /dev/fmem exist.\nGet the source " +@@ -90,9 +97,21 @@ int main(int argc, char *argv[]) { + return EXIT_FAILURE; + } + } ++#elif defined(__FreeBSD__) ++ if (isFileExist(DEV_MEM) == false /*|| isFileExist(DEV_KMEM) == false*/) { ++ cerr << "[ERROR] Either /dev/mem or /dev/kmem doesn't exist.\n" ++ "Please check if the kernel was configured with 'device mem'." ++ << endl; ++ return EXIT_FAILURE; ++ } ++#endif + + int fileDescriptor; ++#if defined(__linux__) + if ((fileDescriptor = open(DEV_FMEM, O_RDWR | O_SYNC)) == -1) ++#elif defined(__FreeBSD__) ++ if ((fileDescriptor = open(DEV_MEM, O_RDWR | O_SYNC)) == -1) ++#endif + FATAL; + gFileDescriptor = &fileDescriptor; + +@@ -102,7 +121,7 @@ int main(int argc, char *argv[]) { + int tabSelected = 0; + vector tabValues{ + " Memory ", +- " PCI ", ++ //" PCI ", + }; + auto tabToggle = + Menu(&tabValues, &tabSelected, MenuOption::Horizontal()) | border; +@@ -110,7 +129,7 @@ int main(int argc, char *argv[]) { + Component tabContainer = Container::Tab( + { + (new Memory(0x00000000))->getComponent(), +- (new PCI(*gBaseAddress))->getComponent(), ++ //(new PCI(*gBaseAddress))->getComponent(), + }, + &tabSelected); + +@@ -140,4 +159,4 @@ int main(int argc, char *argv[]) { + center); + close(fileDescriptor); + return EXIT_SUCCESS; +-} +\ No newline at end of file ++} diff --git a/sysutils/rw-tui/pkg-descr b/sysutils/rw-tui/pkg-descr new file mode 100644 index 000000000000..1bf5a47a90d4 --- /dev/null +++ b/sysutils/rw-tui/pkg-descr @@ -0,0 +1 @@ +rgb-tui is a color picker with a terminal UI.