Files
haikuports/kde-frameworks/kio/patches/kio-5.65.0.patchset
2019-12-15 16:06:39 +03:00

143 lines
4.3 KiB
Plaintext

From d0593e0583654b50a200c4b7e1e692bc54fed801 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Sat, 14 Dec 2019 22:01:34 +0300
Subject: Fix build on Haiku
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index d2d35d3..c8cf79b 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -166,6 +166,10 @@ if (UNIX)
target_link_libraries(KF5KIOCore PRIVATE KF5::AuthCore) #SlaveBase uses KAuth::Action
endif()
+if (HAIKU)
+ target_link_libraries(KF5KIOCore PRIVATE network)
+endif ()
+
if(ACL_FOUND)
target_link_libraries(KF5KIOCore PRIVATE ${ACL_LIBS})
endif()
diff --git a/src/core/kmountpoint.cpp b/src/core/kmountpoint.cpp
index ca634b5..823f147 100644
--- a/src/core/kmountpoint.cpp
+++ b/src/core/kmountpoint.cpp
@@ -127,7 +127,7 @@ KMountPoint::~KMountPoint()
#define MOUNTTYPE(var) var->mnt_type
#define MOUNTOPTIONS(var) var->mnt_opts
#define FSNAME(var) var->mnt_fsname
-#else
+#elif !defined(__HAIKU__)
#define SETMNTENT fopen
#define ENDMNTENT fclose
#define STRUCT_MNTENT struct mnttab
@@ -318,7 +318,7 @@ KMountPoint::List KMountPoint::currentMountPoints(DetailsNeededFlags infoNeeded)
}
}
-#elif !defined(Q_OS_ANDROID)
+#elif !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU)
STRUCT_SETMNTENT mnttab;
if ((mnttab = SETMNTENT(MNTTAB, "r")) == nullptr) {
return result;
diff --git a/src/ioslaves/file/CMakeLists.txt b/src/ioslaves/file/CMakeLists.txt
index 78b88f2..3bd43bf 100644
--- a/src/ioslaves/file/CMakeLists.txt
+++ b/src/ioslaves/file/CMakeLists.txt
@@ -29,6 +29,10 @@ if(UNIX)
target_link_libraries(kio_file Qt5::Network KF5::AuthCore)
endif()
+if (HAIKU)
+ target_link_libraries(kio_file gnu network)
+endif ()
+
if (HAVE_VOLMGT AND CMAKE_SYSTEM_NAME MATCHES SunOS)
target_link_libraries(kio_file -lvolmgt)
endif ()
diff --git a/src/ioslaves/file/file_unix.cpp b/src/ioslaves/file/file_unix.cpp
index 7293ba4..003facd 100644
--- a/src/ioslaves/file/file_unix.cpp
+++ b/src/ioslaves/file/file_unix.cpp
@@ -57,6 +57,11 @@
#include <sys/sendfile.h>
#endif
+#ifdef __HAIKU__
+#undef HAVE_DIRENT_D_TYPE
+#undef HAVE_SYS_XATTR_H
+#endif
+
using namespace KIO;
#define MAX_IPC_SIZE (1024*32)
diff --git a/src/ioslaves/file/kauth/CMakeLists.txt b/src/ioslaves/file/kauth/CMakeLists.txt
index 8b77a28..344c168 100644
--- a/src/ioslaves/file/kauth/CMakeLists.txt
+++ b/src/ioslaves/file/kauth/CMakeLists.txt
@@ -1,6 +1,10 @@
add_executable(file_helper filehelper.cpp fdsender.cpp)
target_link_libraries(file_helper Qt5::Network KF5::AuthCore KF5::I18n KF5::KIOCore)
+if (HAIKU)
+ target_link_libraries(file_helper network)
+endif ()
+
#install(TARGETS file_helper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
#kauth_install_helper_files(file_helper org.kde.kio.file root)
#kauth_install_actions(org.kde.kio.file file.actions)
diff --git a/src/ioslaves/file/sharefd_p.h b/src/ioslaves/file/sharefd_p.h
index 728ca4c..ea7c95b 100644
--- a/src/ioslaves/file/sharefd_p.h
+++ b/src/ioslaves/file/sharefd_p.h
@@ -22,6 +22,7 @@
#define SHAREFD_P_H
#include <sys/un.h>
+#include <cstring>
#include <iostream>
#include <unistd.h>
#include <sys/socket.h>
diff --git a/src/kpac/CMakeLists.txt b/src/kpac/CMakeLists.txt
index d46d895..32ebb9a 100644
--- a/src/kpac/CMakeLists.txt
+++ b/src/kpac/CMakeLists.txt
@@ -48,6 +48,9 @@ if (Qt5Qml_FOUND)
if (HAVE_RESOLV_LIBRARY)
target_link_libraries(kded_proxyscout resolv)
endif ()
+ if (HAIKU)
+ target_link_libraries(kded_proxyscout network)
+ endif ()
endif()
set_package_properties(Qt5Qml PROPERTIES DESCRIPTION "QtQml, one of the Qt5 modules"
@@ -69,6 +72,10 @@ if (HAVE_SOCKET_LIBRARY)
target_link_libraries(kpac_dhcp_helper socket)
endif ()
+if (HAIKU)
+ target_link_libraries(kpac_dhcp_helper network)
+endif ()
+
install(TARGETS kpac_dhcp_helper DESTINATION ${KDE_INSTALL_LIBEXECDIR_KF5} )
########### install files ###############
diff --git a/src/widgets/previewjob.cpp b/src/widgets/previewjob.cpp
index 5c421fb..29a3a30 100644
--- a/src/widgets/previewjob.cpp
+++ b/src/widgets/previewjob.cpp
@@ -22,7 +22,7 @@
#include "previewjob.h"
-#if defined(Q_OS_UNIX) && !defined(Q_OS_ANDROID)
+#if defined(Q_OS_UNIX) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU)
#define WITH_SHM 1
#else
#define WITH_SHM 0
--
2.24.0