diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index f163dd1da79..830d99b0864 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -214,6 +214,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n | [`ninja`](ninja/) | Ninja | 1.11.0 | https://ninja-build.org/ | | [`nippon`](nippon/) | Nippon Safes Inc. | 1.0 | https://www.scummvm.org/games/#games-nippon | | [`nlohmann-json`](nlohmann-json/) | JSON for Modern C++ | 3.11.2 | https://json.nlohmann.me/ | +| [`nnn`](nnn/) | nnn file manager | 4.8 | https://github.com/jarun/nnn | | [`npiet`](npiet/) | Piet language interpreter | 1.3f | https://www.bertnase.de/npiet/ | | [`npth`](npth/) | New GNU Portable Threads Library | 1.6 | https://gnupg.org/software/npth/index.html | | [`ntbtls`](ntbtls/) | The Not Too Bad TLS Library | 0.2.0 | https://gnupg.org/software/ntbtls/index.html | diff --git a/Ports/nnn/package.sh b/Ports/nnn/package.sh new file mode 100755 index 00000000000..a302a5fd6eb --- /dev/null +++ b/Ports/nnn/package.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env -S bash ../.port_include.sh +port='nnn' +version='4.8' +files=( + "https://github.com/jarun/nnn/releases/download/v${version}/nnn-v${version}.tar.gz 7027f830329ff3451b844d1f5fbeb1d866bed1af6f24a360d5c51888cb1ae8f0" +) +depends=( + 'gettext' + 'libfts' + 'ncurses' + 'readline' +) diff --git a/Ports/nnn/patches/0001-Remove-needless-include-of-ftw.patch b/Ports/nnn/patches/0001-Remove-needless-include-of-ftw.patch new file mode 100644 index 00000000000..e10b0caeba5 --- /dev/null +++ b/Ports/nnn/patches/0001-Remove-needless-include-of-ftw.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Rene Hickersberger +Date: Sat, 24 Jun 2023 01:15:26 +0200 +Subject: [PATCH] Remove needless include of ftw.h + +This header does not exist on Serenity, but it seems to be unused. +--- + src/nnn.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/nnn.c b/src/nnn.c +index b3c0f986ff843b80b0e3c349ac70e151cc9de844..76833f3e08d0a0abfa22ae65cb381855e85fd048 100644 +--- a/src/nnn.c ++++ b/src/nnn.c +@@ -105,7 +105,6 @@ + #ifndef __USE_XOPEN_EXTENDED + #define __USE_XOPEN_EXTENDED 1 + #endif +-#include + #include + #include + diff --git a/Ports/nnn/patches/0002-Link-with-fts-library.patch b/Ports/nnn/patches/0002-Link-with-fts-library.patch new file mode 100644 index 00000000000..5b321b30b66 --- /dev/null +++ b/Ports/nnn/patches/0002-Link-with-fts-library.patch @@ -0,0 +1,29 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Rene Hickersberger +Date: Sat, 24 Jun 2023 01:17:30 +0200 +Subject: [PATCH] Link with fts library + +Nnn depends on the non-standard fts functions to traverse the file +system. Most BSD systems provide them out of the box and on +GNU/Linux systems, they are part of glibc. + +On Serenity, they are provided by a separate library (the libfts port) +that was originally intended for musl-based Linux systems. +This patch makes nnn link against this library. +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index b6930330be77f9f2f252a96ba9b3e727ddfdc5aa..955965aad67967a5acd73822647b2ce11d4a819e 100644 +--- a/Makefile ++++ b/Makefile +@@ -59,7 +59,7 @@ ifeq ($(strip $(O_NORL)),1) + else ifeq ($(strip $(O_STATIC)),1) + CPPFLAGS += -DNORL + else +- LDLIBS += -lreadline ++ LDLIBS += -lreadline -lfts + endif + + ifeq ($(strip $(O_PCRE)),1) diff --git a/Ports/nnn/patches/0003-Disable-broken-features.patch b/Ports/nnn/patches/0003-Disable-broken-features.patch new file mode 100644 index 00000000000..3bf5dfed87c --- /dev/null +++ b/Ports/nnn/patches/0003-Disable-broken-features.patch @@ -0,0 +1,32 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Rene Hickersberger +Date: Sat, 24 Jun 2023 01:25:27 +0200 +Subject: [PATCH] Disable broken features + +Mouse support is currently broken and X11 does not make sense on Serenity. +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index 955965aad67967a5acd73822647b2ce11d4a819e..6e1f0476c761a8f7a8d53e2c4f0fe714a20198a6 100644 +--- a/Makefile ++++ b/Makefile +@@ -15,7 +15,7 @@ O_DEBUG := 0 # debug binary + O_NORL := 0 # no readline support + O_PCRE := 0 # link with PCRE library + O_NOLC := 0 # no locale support +-O_NOMOUSE := 0 # no mouse support ++O_NOMOUSE := 1 # no mouse support + O_NOBATCH := 0 # no built-in batch renamer + O_NOFIFO := 0 # no FIFO previewer support + O_CTX8 := 0 # enable 8 contexts +@@ -26,7 +26,7 @@ O_QSORT := 0 # use Alexey Tourbin's QSORT implementation + O_BENCH := 0 # benchmark mode (stops at first user input) + O_NOSSN := 0 # disable session support + O_NOUG := 0 # disable user, group name in status bar +-O_NOX11 := 0 # disable X11 integration ++O_NOX11 := 1 # disable X11 integration + O_MATCHFLTR := 0 # allow filters without matches + O_NOSORT := 0 # disable sorting entries on dir load + diff --git a/Ports/nnn/patches/ReadMe.md b/Ports/nnn/patches/ReadMe.md new file mode 100644 index 00000000000..11a5586d909 --- /dev/null +++ b/Ports/nnn/patches/ReadMe.md @@ -0,0 +1,26 @@ +# Patches for nnn on SerenityOS + +## `0001-Remove-needless-include-of-ftw.patch` + +Remove needless include of ftw.h + +This header does not exist on Serenity, but it seems to be unused. + +## `0002-Link-with-fts-library.patch` + +Link with fts library + +Nnn depends on the non-standard fts functions to traverse the file +system. Most BSD systems provide them out of the box and on +GNU/Linux systems, they are part of glibc. + +On Serenity, they are provided by a separate library (the libfts port) +that was originally intended for musl-based Linux systems. +This patch makes nnn link against this library. + +## `0003-Disable-broken-features.patch` + +Disable broken features + +Mouse support is currently broken and X11 does not make sense on Serenity. +