mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-23 04:00:05 +02:00
Far: add new recipe. Port is incomplete, help wanted
This commit is contained in:
47
app-misc/far/far-2~git.recipe
Normal file
47
app-misc/far/far-2~git.recipe
Normal file
@@ -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
|
||||
}
|
||||
204
app-misc/far/patches/far.patch
Normal file
204
app-misc/far/patches/far.patch
Normal file
@@ -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 <sys/syslimits.h>
|
||||
#else
|
||||
-# include <linux/limits.h>
|
||||
+# include <limits.h>
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
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 <chrono>
|
||||
#include <thread>
|
||||
#include <condition_variable>
|
||||
-#ifndef __APPLE__
|
||||
+#if !defined (__APPLE__) && !defined (__HAIKU__)
|
||||
#include <sys/inotify.h>
|
||||
#endif
|
||||
#include <pthread.h>
|
||||
@@ -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 <sys/ioctl.h>
|
||||
# include <linux/fs.h>
|
||||
#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 <fcntl.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
+#ifndef __HAIKU__
|
||||
#ifdef __APPLE__
|
||||
#include <sys/mount.h>
|
||||
#else
|
||||
@@ -13,6 +14,7 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include <linux/fs.h>
|
||||
#endif
|
||||
+#endif
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
@@ -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 <sys/statvfs.h>
|
||||
#ifdef __APPLE__
|
||||
#include <sys/mount.h>
|
||||
-#else
|
||||
- #include <sys/statfs.h>
|
||||
+/*#else
|
||||
+ #include <sys/statfs.h>*/
|
||||
#endif
|
||||
#include <dirent.h>
|
||||
|
||||
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 <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
-#include <wordexp.h>
|
||||
+//#include <wordexp.h>
|
||||
#include <sys/stat.h>
|
||||
#include <windows.h>
|
||||
#include <string>
|
||||
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);
|
||||
Reference in New Issue
Block a user