Package: kde4libs / 4:4.14.2-5+deb8u2

kfreebsd_support.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
Make kdelibs build in Debian's kFreeBSD.
We can not push this patch to upstream since the:
CMAKE_SYSTEM_NAME MATCHES kFreeBSD stuff, needs the Debian patched
cmake.

Index: kde4libs/ConfigureChecks.cmake
===================================================================
--- kde4libs.orig/ConfigureChecks.cmake	2014-08-19 22:34:36.773683562 +0200
+++ kde4libs/ConfigureChecks.cmake	2014-08-19 22:34:36.741684892 +0200
@@ -138,11 +138,11 @@
         set(UTIL_LIBRARY util)
       endif (login_in_libutil)
     endif (NOT login_in_libc)
-    if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES GNU/FreeBSD OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+    if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES GNU/FreeBSD OR CMAKE_SYSTEM_NAME STREQUAL GNU OR CMAKE_SYSTEM_NAME MATCHES kFreeBSD)
       set (HAVE_UTMPX)
-    else (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES GNU/FreeBSD OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+    else (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES GNU/FreeBSD OR CMAKE_SYSTEM_NAME STREQUAL GNU OR CMAKE_SYSTEM_NAME MATCHES kFreeBSD)
       check_function_exists(getutxent HAVE_UTMPX)
-    endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES GNU/FreeBSD OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+    endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME MATCHES Darwin OR CMAKE_SYSTEM_NAME MATCHES GNU/FreeBSD OR CMAKE_SYSTEM_NAME STREQUAL GNU OR CMAKE_SYSTEM_NAME MATCHES kFreeBSD)
     if (HAVE_UTMPX)
       set(utmp utmpx)
       if (login_in_libutil)
Index: kde4libs/kio/kfile/kpropertiesdialog.cpp
===================================================================
--- kde4libs.orig/kio/kfile/kpropertiesdialog.cpp	2014-08-19 22:34:36.773683562 +0200
+++ kde4libs/kio/kfile/kpropertiesdialog.cpp	2014-08-19 22:34:36.757684227 +0200
@@ -1894,7 +1894,15 @@
     fileSystemSupportsACLs = ( statfs( path.data(), &buf ) == 0 ) && ( buf.f_flags & MNT_ACLS );
 #else
     fileSystemSupportsACLs =
-            getxattr( path.data(), "system.posix_acl_access", NULL, 0 ) >= 0 || errno == ENODATA;
+      getxattr( path.data(), "system.posix_acl_access", NULL, 0 ) >= 0
+#ifdef ENODATA
+           || (errno == ENODATA)
+#endif
+#ifdef ENOATTR
+           || (errno == ENOATTR)
+#endif
+           ;
+
 #endif
     return fileSystemSupportsACLs;
 }
Index: kde4libs/kioslave/file/file.cpp
===================================================================
--- kde4libs.orig/kioslave/file/file.cpp	2014-08-19 22:34:36.773683562 +0200
+++ kde4libs/kioslave/file/file.cpp	2014-08-19 22:34:36.765683895 +0200
@@ -310,8 +310,10 @@
     }
 
 #if HAVE_FADVISE
+#ifdef POSIX_FADV_SEQUENTIAL
     posix_fadvise( fd, 0, 0, POSIX_FADV_SEQUENTIAL);
 #endif
+#endif
 
     // Determine the mimetype of the file to be retrieved, and emit it.
     // This is mandatory in all slaves (for KRun/BrowserRun to work)
Index: kde4libs/kioslave/file/file_unix.cpp
===================================================================
--- kde4libs.orig/kioslave/file/file_unix.cpp	2014-08-19 22:34:36.773683562 +0200
+++ kde4libs/kioslave/file/file_unix.cpp	2014-08-19 22:34:36.769683728 +0200
@@ -145,8 +145,10 @@
     }
 
 #if HAVE_FADVISE
+#ifdef POSIX_FADV_SEQUENTIAL
     posix_fadvise(src_fd,0,0,POSIX_FADV_SEQUENTIAL);
 #endif
+#endif
     // WABA: Make sure that we keep writing permissions ourselves,
     // otherwise we can be in for a surprise on NFS.
     mode_t initialMode;
@@ -168,8 +170,10 @@
     }
 
 #if HAVE_FADVISE
+#ifdef POSIX_FADV_SEQUENTIAL
     posix_fadvise(dest_fd,0,0,POSIX_FADV_SEQUENTIAL);
 #endif
+#endif
 
 #ifdef HAVE_POSIX_ACL
     acl = acl_get_fd(src_fd);
Index: kde4libs/kpty/kpty.cpp
===================================================================
--- kde4libs.orig/kpty/kpty.cpp	2014-08-19 22:34:36.773683562 +0200
+++ kde4libs/kpty/kpty.cpp	2014-08-19 22:34:36.769683728 +0200
@@ -109,24 +109,24 @@
 # define _NEW_TTY_CTRL
 #endif
 
-#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__bsdi__) || defined(__APPLE__) || defined (__DragonFly__)
+#if defined(HAVE_TCGETATTR)
+# define _tcgetattr(fd, ttmode) tcgetattr(fd, ttmode)
+#elif defined(TIOCGETA)
 # define _tcgetattr(fd, ttmode) ioctl(fd, TIOCGETA, (char *)ttmode)
+#elif defined(TCGETS)
+# define _tcgetattr(fd, ttmode) ioctl(fd, TCGETS, (char *)ttmode)
 #else
-# if defined(_HPUX_SOURCE) || defined(__Lynx__) || defined (__CYGWIN__) || defined(__sun)
-#  define _tcgetattr(fd, ttmode) tcgetattr(fd, ttmode)
-# else
-#  define _tcgetattr(fd, ttmode) ioctl(fd, TCGETS, (char *)ttmode)
-# endif
+# error
 #endif
 
-#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__bsdi__) || defined(__APPLE__) || defined (__DragonFly__)
+#if defined(HAVE_TCSETATTR) && defined(TCSANOW)
+# define _tcsetattr(fd, ttmode) tcsetattr(fd, TCSANOW, ttmode)
+#elif defined(TIOCSETA)
 # define _tcsetattr(fd, ttmode) ioctl(fd, TIOCSETA, (char *)ttmode)
+#elif defined(TCSETS)
+# define _tcsetattr(fd, ttmode) ioctl(fd, TCSETS, (char *)ttmode)
 #else
-# if defined(_HPUX_SOURCE) || defined(__CYGWIN__) || defined(__sun)
-#  define _tcsetattr(fd, ttmode) tcsetattr(fd, TCSANOW, ttmode)
-# else
-#  define _tcsetattr(fd, ttmode) ioctl(fd, TCSETS, (char *)ttmode)
-# endif
+# error
 #endif
 
 #include <kdebug.h>
Index: kde4libs/cmake/modules/FindKDE4Internal.cmake
===================================================================
--- kde4libs.orig/cmake/modules/FindKDE4Internal.cmake	2014-08-19 22:34:36.773683562 +0200
+++ kde4libs/cmake/modules/FindKDE4Internal.cmake	2014-08-19 22:34:36.769683728 +0200
@@ -1098,7 +1098,7 @@
 endif (APPLE)
 
 
-if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU OR CMAKE_SYSTEM_NAME MATCHES kFreeBSD)
    if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
       set ( _KDE4_PLATFORM_DEFINITIONS -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_GNU_SOURCE)
       set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
@@ -1119,7 +1119,7 @@
       set ( CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
       set ( CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_MODULE_LINKER_FLAGS}")
    endif (CMAKE_C_COMPILER MATCHES "icc")
-endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU OR CMAKE_SYSTEM_NAME MATCHES kFreeBSD)
 
 if (UNIX)
    set ( _KDE4_PLATFORM_DEFINITIONS "${_KDE4_PLATFORM_DEFINITIONS} -D_LARGEFILE64_SOURCE")
@@ -1216,13 +1216,13 @@
    # As of Qt 4.6.x we need to override the new exception macros if we want compile with -fno-exceptions
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common")
 
-   if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+   if (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU OR CMAKE_SYSTEM_NAME MATCHES kFreeBSD)
      # This should not be needed, as it is also part of _KDE4_PLATFORM_DEFINITIONS below.
      # It is kept here nonetheless both for backwards compatibility in case one does not use add_definitions(${KDE4_DEFINITIONS})
      # and also because it is/was needed by glibc for snprintf to be available when building C files.
      # See commit 4a44862b2d178c1d2e1eb4da90010d19a1e4a42c.
      add_definitions (-D_BSD_SOURCE)
-   endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU)
+   endif (CMAKE_SYSTEM_NAME MATCHES Linux OR CMAKE_SYSTEM_NAME STREQUAL GNU OR CMAKE_SYSTEM_NAME MATCHES kFreeBSD)
 
    if (CMAKE_SYSTEM_NAME STREQUAL GNU)
       set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")