summaryrefslogtreecommitdiff
path: root/Ports/mc
diff options
context:
space:
mode:
authorKenneth Myhra <kennethmyhra@gmail.com>2022-01-13 14:09:51 +0100
committerLinus Groh <mail@linusgroh.de>2022-01-13 18:46:22 +0100
commit2255e8859ce839a930d89a3e3ce07571f8bf3a83 (patch)
treea09482dcaa7f9667210f47011a1809c7d5be5e51 /Ports/mc
parent965b772f7061296d0ad45a9399cab4210fb3e5a3 (diff)
downloadserenity-2255e8859ce839a930d89a3e3ce07571f8bf3a83.zip
Ports/mc: Add Midnight Commander port
Diffstat (limited to 'Ports/mc')
-rwxr-xr-xPorts/mc/package.sh21
-rw-r--r--Ports/mc/patches/0001-config-config.sub-Add-SerenityOS-as-portable-system.patch29
-rw-r--r--Ports/mc/patches/0002-filemanager-ext.c-Include-strings.h-if-SerenityOS.patch30
-rw-r--r--Ports/mc/patches/0003-filemanager-ext.c-Use-str_ncasecmp-instead-of-strnca.patch30
-rw-r--r--Ports/mc/patches/ReadMe.md31
5 files changed, 141 insertions, 0 deletions
diff --git a/Ports/mc/package.sh b/Ports/mc/package.sh
new file mode 100755
index 0000000000..66248da7b3
--- /dev/null
+++ b/Ports/mc/package.sh
@@ -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
+}
diff --git a/Ports/mc/patches/0001-config-config.sub-Add-SerenityOS-as-portable-system.patch b/Ports/mc/patches/0001-config-config.sub-Add-SerenityOS-as-portable-system.patch
new file mode 100644
index 0000000000..53feb6b287
--- /dev/null
+++ b/Ports/mc/patches/0001-config-config.sub-Add-SerenityOS-as-portable-system.patch
@@ -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
+
diff --git a/Ports/mc/patches/0002-filemanager-ext.c-Include-strings.h-if-SerenityOS.patch b/Ports/mc/patches/0002-filemanager-ext.c-Include-strings.h-if-SerenityOS.patch
new file mode 100644
index 0000000000..ed0d7ca2cc
--- /dev/null
+++ b/Ports/mc/patches/0002-filemanager-ext.c-Include-strings.h-if-SerenityOS.patch
@@ -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
+
diff --git a/Ports/mc/patches/0003-filemanager-ext.c-Use-str_ncasecmp-instead-of-strnca.patch b/Ports/mc/patches/0003-filemanager-ext.c-Use-str_ncasecmp-instead-of-strnca.patch
new file mode 100644
index 0000000000..60a3fdb47b
--- /dev/null
+++ b/Ports/mc/patches/0003-filemanager-ext.c-Use-str_ncasecmp-instead-of-strnca.patch
@@ -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
+
diff --git a/Ports/mc/patches/ReadMe.md b/Ports/mc/patches/ReadMe.md
new file mode 100644
index 0000000000..8ac05fc503
--- /dev/null
+++ b/Ports/mc/patches/ReadMe.md
@@ -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