Ports/mc: Add Midnight Commander port

This commit is contained in:
Kenneth Myhra 2022-01-13 14:09:51 +01:00 committed by Linus Groh
parent 965b772f70
commit 2255e8859c
Notes: sideshowbarker 2024-07-17 20:56:31 +09:00
6 changed files with 142 additions and 0 deletions

View File

@ -113,6 +113,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`mandoc`](mandoc/) | mandoc | 1.14.5 | https://mandoc.bsd.lv/ |
| [`mawk`](mawk/) | mawk | 1.3.4-20200120 | https://invisible-island.net/mawk/ |
| [`mbedtls`](mbedtls/) | Mbed TLS | 2.16.2 | https://tls.mbed.org/ |
| [`mc`](mc/) | Midnight Commander | 4.8.27 | http://midnight-commander.org/ |
| [`milkytracker`](milkytracker/) | milkytracker | 1.03.00 | https://github.com/milkytracker/MilkyTracker |
| [`mold`](mold/) | | 1.0.1 | https://github.com/rui314/mold |
| [`mpc`](mpc/) | GNU Multiple Precision Complex Library (MPC) | 1.2.1 | http://www.multiprecision.org/mpc/ |

21
Ports/mc/package.sh Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env -S bash ../.port_include.sh
port=mc
version=4.8.27
useconfigure=true
files="https://github.com/MidnightCommander/mc/archive/refs/tags/${version}.tar.gz ${port}-${version}.tar.gz 3bab1460d187e1f09409be4bb8550ea7dab125fb9b50036a8dbd2b16e8b1985b"
auth_type=sha256
depends=("gettext" "glib" "libtool" "ncurses" "vim")
configopts=(
"--disable-largefile"
"--disable-vfs"
"--without-edit"
"--without-x"
"--with-homedir"
"--with-screen=ncurses"
"--with-ncurses-includes=$SERENITY_BUILD_DIR/Root/usr/local/include/ncurses"
"--with-ncurses-libs=$SERENITY_BUILD_DIR/Root/usr/local/lib"
)
pre_patch() {
run ./autogen.sh
}

View File

@ -0,0 +1,29 @@
From 34a4ba3c619add44391b7d7a7422babab9993fbb Mon Sep 17 00:00:00 2001
From: Kenneth Myhra <kennethmyhra@gmail.com>
Date: Sat, 25 Dec 2021 19:01:58 +0100
Subject: [PATCH 1/3] config/config.sub: Add SerenityOS as portable system
- [ ] Local?
- [X] Should be merged to upstream?
- [ ] Resolves issue(s) with our side of things
- [ ] Hack
---
config/config.sub | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/config.sub b/config/config.sub
index 1d8e98b..85b7fde 100755
--- a/config/config.sub
+++ b/config/config.sub
@@ -1363,7 +1363,7 @@ case $os in
# The portable systems comes first.
# Each alternative MUST end in a * to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* | -serenity* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
--
2.25.1

View File

@ -0,0 +1,30 @@
From 749c81e5006dea41daf16e99c8a60926236d2373 Mon Sep 17 00:00:00 2001
From: Kenneth Myhra <kennethmyhra@gmail.com>
Date: Sat, 25 Dec 2021 19:15:35 +0100
Subject: [PATCH 2/3] filemanager/ext.c: Include strings.h if SerenityOS
- [ ] Local?
- [X] Should be merged to upstream?
- [ ] Resolves issue(s) with our side of things
- [ ] Hack
---
src/filemanager/ext.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/filemanager/ext.c b/src/filemanager/ext.c
index 781a763..33baf8c 100644
--- a/src/filemanager/ext.c
+++ b/src/filemanager/ext.c
@@ -36,6 +36,9 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#ifdef __serenity__
+#include <strings.h>
+#endif
#include <unistd.h>
#include "lib/global.h"
--
2.25.1

View File

@ -0,0 +1,30 @@
From 0a5b0b9c2bf5befae8e2e831e75a95f2f0bb26a3 Mon Sep 17 00:00:00 2001
From: Kenneth Myhra <kennethmyhra@gmail.com>
Date: Tue, 11 Jan 2022 19:56:13 +0100
Subject: [PATCH 3/3] filemanager/ext.c: Use str_ncasecmp instead of
strncasecmp if SerenityOS
- [ ] Local?
- [X] Should be merged to upstream?
- [ ] Resolves issue(s) with our side of things
- [ ] Hack
---
src/filemanager/ext.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/filemanager/ext.c b/src/filemanager/ext.c
index 33baf8c..a48d6e1 100644
--- a/src/filemanager/ext.c
+++ b/src/filemanager/ext.c
@@ -950,7 +950,7 @@ regex_command_for (void *target, const vfs_path_t * filename_vpath, const char *
if (case_insense)
{
p += 2;
- cmp_func = strncasecmp;
+ cmp_func = str_ncasecmp;
}
if (*p == '.' && file_len >= (size_t) (q - p))
--
2.25.1

View File

@ -0,0 +1,31 @@
+# Patches for mc on SerenityOS
+
+## `0001-config-config.sub-Add-SerenityOS-as-portable-system.patch`
+
+config/config.sub: Add SerenityOS as portable system
+
+### Status
+- [ ] Local?
+- [X] Should be merged to upstream?
+- [ ] Resolves issue(s) with our side of things
+- [ ] Hack
+
+## 0002-filemanager-ext.c-Include-strings.h-if-SerenityOS.patch
+
+filemanager/ext.c: Include strings.h if SerenityOS
+
+### Status
+- [ ] Local?
+- [X] Should be merged to upstream?
+- [ ] Resolves issue(s) with our side of things
+- [ ] Hack
+
+## 0003-filemanager-ext.c-Use-str_ncasecmp-instead-of-strncasecmp-if-SerenityOS.patch
+
+filemanager/ext.c: Use str_ncasecmp instead of strncasecmp if SerenityOS
+
+### Status
+- [ ] Local?
+- [X] Should be merged to upstream?
+- [ ] Resolves issue(s) with our side of things
+- [ ] Hack