From fb3b81c774f567eb0fd15b8f43ff979e85a297e2 Mon Sep 17 00:00:00 2001 From: Sergei Reznikov Date: Mon, 31 Jul 2017 20:45:33 +0300 Subject: [PATCH] Far: add new recipe. Port is incomplete, help wanted --- app-misc/far/far-2~git.recipe | 47 ++++++++ app-misc/far/patches/far.patch | 204 +++++++++++++++++++++++++++++++++ 2 files changed, 251 insertions(+) create mode 100644 app-misc/far/far-2~git.recipe create mode 100644 app-misc/far/patches/far.patch diff --git a/app-misc/far/far-2~git.recipe b/app-misc/far/far-2~git.recipe new file mode 100644 index 000000000..07fa03649 --- /dev/null +++ b/app-misc/far/far-2~git.recipe @@ -0,0 +1,47 @@ +SUMMARY="Port of FAR v2" +DESCRIPTION="Haiku port of FAR v2 +Currently interesting only for entusiasts. + +Currently working plugins: colorer, multiarc, farftp, tmppanel, align, \ +autowrap, drawline, editcase, SimpleIndent" +HOMEPAGE="https://github.com/elfmz/far2l/" +COMMIT="de5554dbc0ec69329b75777d4a3b2f01851fc5ed" +SOURCE_URI="https://github.com/elfmz/far2l/archive/$COMMIT.zip" +CHECKSUM_SHA256="f35fa056dd3998039bbd4b322c64e2aa3d7d49b9dddf236448aa4b3b881ba9ef" +SOURCE_DIR="far2l-$COMMIT" +REVISION="1" +ARCHITECTURES="?x86 ?x86_64" +LICENSE="GNU GPL v2" +COPYRIGHT="2016-2017 elfmz" +PATCHES="far.patch" + +PROVIDES=" + far = $portVersion + cmd:far = $portVersion + app:Far = $portVersion + " + +REQUIRES=" + haiku + " +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + wxqt${secondaryArchSuffix}_devel + devel:libglib_2.0$secondaryArchSuffix + " + +BUILD_PREREQUIRES=" + cmd:cmake + cmd:g++ + cmd:make + cmd:pkg_config$secondaryArchSuffix + " + +INSTALL() +{ + cmake -G "Unix Makefiles" + make + mkdir -p $appsDir/Far + cp far2l/far $appsDir/Far/Far + addAppDeskbarSymlink $appsDir/Far/Far +} diff --git a/app-misc/far/patches/far.patch b/app-misc/far/patches/far.patch new file mode 100644 index 000000000..639c9acc5 --- /dev/null +++ b/app-misc/far/patches/far.patch @@ -0,0 +1,204 @@ +diff --git a/WinPort/WinCompat.h b/WinPort/WinCompat.h +index 746bc69..292a5ff 100644 +--- a/WinPort/WinCompat.h ++++ b/WinPort/WinCompat.h +@@ -83,7 +83,7 @@ typedef unsigned __int64 uint64_t; + # define st_atim st_atimespec + # include + #else +-# include ++# include + #endif + + #include +diff --git a/WinPort/src/APIClipboard.cpp b/WinPort/src/APIClipboard.cpp +index 3c668cd..248fb3a 100644 +--- a/WinPort/src/APIClipboard.cpp ++++ b/WinPort/src/APIClipboard.cpp +@@ -224,7 +224,7 @@ extern "C" { + + #ifdef _WIN32 + size_t len = _msize(mem); +-#elif defined(__APPLE__) ++#elif defined (__HAIKU__) + size_t len = malloc_size(mem); + #else + size_t len = malloc_usable_size(mem); +diff --git a/WinPort/src/APIFSNotify.cpp b/WinPort/src/APIFSNotify.cpp +index fde66fb..ee491a7 100644 +--- a/WinPort/src/APIFSNotify.cpp ++++ b/WinPort/src/APIFSNotify.cpp +@@ -4,7 +4,7 @@ + #include + #include + #include +-#ifndef __APPLE__ ++#if !defined (__APPLE__) && !defined (__HAIKU__) + #include + #endif + #include +@@ -32,7 +32,7 @@ class WinPortFSNotify : public WinPortEvent + void AddWatch(const char *path) + { + int w = -1; +-#ifndef __APPLE__ ++#if !defined (__APPLE__) && !defined (__HAIKU__) + uint32_t mask = 0; + + //TODO: be smarter with filtering +@@ -86,7 +86,7 @@ class WinPortFSNotify : public WinPortEvent + + void WatcherProc() + { +-#ifndef __APPLE__ ++#if !defined (__APPLE__) && !defined (__HAIKU__) + union { + struct inotify_event ie; + char space[ sizeof(struct inotify_event) + NAME_MAX + 10 ]; +@@ -131,7 +131,7 @@ class WinPortFSNotify : public WinPortEvent + + void StopWatching() + { +-#ifndef __APPLE__ ++#if !defined (__APPLE__) && !defined (__HAIKU__) + if (_fd!=-1) { + if (_watching) { + _watching = false; +@@ -155,7 +155,7 @@ public: + : WinPortEvent(true, false), _watcher(0), + _filter(dwNotifyFilter), _watching(false) + { +-#ifndef __APPLE__ ++#if !defined (__APPLE__) && !defined (__HAIKU__) + _fd = inotify_init1(IN_CLOEXEC | IN_NONBLOCK); + if (_fd==-1) + return; +diff --git a/WinPort/src/APIFiles.cpp b/WinPort/src/APIFiles.cpp +index a592989..01ea590 100644 +--- a/WinPort/src/APIFiles.cpp ++++ b/WinPort/src/APIFiles.cpp +@@ -625,7 +625,7 @@ extern "C" + + if ( PreMatchDType(de->d_type) && MatchName(de->d_name) ) { + mode_t hint_mode_type; +- switch (de->d_type) { ++/* switch (de->d_type) { + case DT_DIR: hint_mode_type = S_IFDIR; break; + case DT_REG: hint_mode_type = S_IFREG; break; + case DT_LNK: hint_mode_type = S_IFLNK; break; +@@ -635,7 +635,7 @@ extern "C" + case DT_SOCK: hint_mode_type = S_IFSOCK; break; + default: hint_mode_type = 0; + } +- if (MatchAttributesAndFillWFD(hint_mode_type, de->d_name, lpFindFileData)) ++*/ if (MatchAttributesAndFillWFD(hint_mode_type, de->d_name, lpFindFileData)) + return true; + } + } +@@ -713,12 +713,12 @@ extern "C" + + bool PreMatchDType(unsigned char d_type) + { +- switch (d_type) { ++/* switch (d_type) { + case DT_DIR: return (_flags & FIND_FILE_FLAG_NO_DIRS) == 0; + case DT_REG: return (_flags & FIND_FILE_FLAG_NO_FILES) == 0; + case DT_LNK: return (_flags & FIND_FILE_FLAG_NO_LINKS) == 0; + case DT_UNKNOWN: return true; +- ++*/ + default: return (_flags&FIND_FILE_FLAG_NO_DEVICES) == 0; + + } +diff --git a/WinPort/src/sudo/sudo_client_api.cpp b/WinPort/src/sudo/sudo_client_api.cpp +index 7c546aa..de9537e 100644 +--- a/WinPort/src/sudo/sudo_client_api.cpp ++++ b/WinPort/src/sudo/sudo_client_api.cpp +@@ -15,7 +15,7 @@ + #include "sudo_private.h" + #include "sudo.h" + +-#ifndef __APPLE__ ++#if !defined(__APPLE__) && !defined(__HAIKU__) + # include + # include + #endif +@@ -1012,7 +1012,7 @@ extern "C" __attribute__ ((visibility("default"))) int sdc_fsetxattr(int fd, con + + extern "C" __attribute__ ((visibility("default"))) int sdc_fs_flags_set(const char *path, int flags) + { +-#ifdef __APPLE__ ++#if defined(__APPLE__) || (__HAIKU__) + //TODO + return 0; + #else +diff --git a/WinPort/src/sudo/sudo_dispatcher.cpp b/WinPort/src/sudo/sudo_dispatcher.cpp +index 54af120..5e8bd6a 100644 +--- a/WinPort/src/sudo/sudo_dispatcher.cpp ++++ b/WinPort/src/sudo/sudo_dispatcher.cpp +@@ -6,6 +6,7 @@ + #include + #include + #include ++#ifndef __HAIKU__ + #ifdef __APPLE__ + #include + #else +@@ -13,6 +14,7 @@ + #include + #include + #endif ++#endif + #include + #include + #include +@@ -452,7 +454,7 @@ namespace Sudo + + static void OnSudoDispatch_FSFlagsGet(BaseTransaction &bt) + { +-#ifndef __APPLE__ ++#if !defined (__APPLE__) && !defined (__HAIKU__) + std::string path; + bt.RecvStr(path); + int r = -1; +diff --git a/WinPort/sudo.h b/WinPort/sudo.h +index 178192e..2f151b9 100644 +--- a/WinPort/sudo.h ++++ b/WinPort/sudo.h +@@ -3,8 +3,8 @@ + #include + #ifdef __APPLE__ + #include +-#else +- #include ++/*#else ++ #include */ + #endif + #include + +diff --git a/multiarc/src/ArcMix.cpp b/multiarc/src/ArcMix.cpp +index 3dcc61a..27034fc 100644 +--- a/multiarc/src/ArcMix.cpp ++++ b/multiarc/src/ArcMix.cpp +@@ -4,7 +4,7 @@ + #include + #include + #include +-#include ++//#include + #include + #include + #include +diff --git a/utils/src/utils.cpp b/utils/src/utils.cpp +index de2a9ec..01af2c5 100644 +--- a/utils/src/utils.cpp ++++ b/utils/src/utils.cpp +@@ -274,7 +274,7 @@ ErrnoSaver::~ErrnoSaver() + ////////// + int pipe_cloexec(int pipedes[2]) + { +-#ifdef __APPLE__ ++#if defined(__APPLE__) || (__HAIKU__) + int r = pipe(pipedes); + if (r==0) { + fcntl(pipedes[0], F_SETFD, FD_CLOEXEC);