Package: kde4libs / 4:4.14.2-5+deb8u2

make_libkdeinit4_private.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
From: Modestas Vainius <modax@debian.org>
Subject: Framework for making libkdeinit4_*.so "private"
Forwarded: no
Origin: vendor
Last-Update: 2013-09-04

The patch adds LIBKDEINIT_INSTALL_DIR cmake flag which specifies where
libkdeinit4_*.so are supposed to end up. Please note, however, that
libkdeinit4_*.so will not be automatically installed to LIBKDEINIT_INSTALL_DIR
(but rather LIB_INSTALL_DIR) after cmake_install and you will need to be move
to LIBKDEINIT_INSTALL_DIR manually in packaging (or e.g. with
dh_movelibkdeinit).

ENABLE_LIBKDEINIT_RUNPATH boolean variable controls whether to add RUNPATH to
generated kdeinit executables. ENABLE_LIBKDEINIT_RUNPATH is OFF by default
unless CMAKE_BUILD_TYPE is set to Debian. However, please note that CDBS kde.mk
and debhelper kde addon/buildsystem set CMAKE_BUILD_TYPE=Debian and call
dh_movelibkdeinit by default.

The patch also adds support for "kdeinit" resource type to KDE Platform
libraries.
Index: kde4libs/CreateKDELibsDependenciesFile.cmake
===================================================================
--- kde4libs.orig/CreateKDELibsDependenciesFile.cmake	2014-08-19 22:36:20.881357112 +0200
+++ kde4libs/CreateKDELibsDependenciesFile.cmake	2014-08-19 22:36:20.877357278 +0200
@@ -32,6 +32,7 @@
 make_install_path_absolute(KDE4_LIB_INSTALL_DIR     ${LIB_INSTALL_DIR})
 make_install_path_absolute(KDE4_IMPORTS_INSTALL_DIR     ${IMPORTS_INSTALL_DIR})
 make_install_path_absolute(KDE4_LIBEXEC_INSTALL_DIR ${LIBEXEC_INSTALL_DIR})
+make_install_path_absolute(KDE4_LIBKDEINIT_INSTALL_DIR ${LIBKDEINIT_INSTALL_DIR})
 make_install_path_absolute(KDE4_INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_DIR})
 make_install_path_absolute(KDE4_BIN_INSTALL_DIR     ${BIN_INSTALL_DIR})
 make_install_path_absolute(KDE4_SBIN_INSTALL_DIR    ${SBIN_INSTALL_DIR})
@@ -65,6 +66,7 @@
 set(KDE4_LIB_INSTALL_DIR     \"${KDE4_LIB_INSTALL_DIR}\")
 set(KDE4_IMPORTS_INSTALL_DIR     \"${KDE4_IMPORTS_INSTALL_DIR}\")
 set(KDE4_LIBEXEC_INSTALL_DIR \"${KDE4_LIBEXEC_INSTALL_DIR}\")
+set(KDE4_LIBKDEINIT_INSTALL_DIR \"${KDE4_LIBKDEINIT_INSTALL_DIR}\")
 set(KDE4_INCLUDE_INSTALL_DIR \"${KDE4_INCLUDE_INSTALL_DIR}\")
 set(KDE4_BIN_INSTALL_DIR     \"${KDE4_BIN_INSTALL_DIR}\")
 set(KDE4_SBIN_INSTALL_DIR    \"${KDE4_SBIN_INSTALL_DIR}\")
Index: kde4libs/cmake/modules/FindKDE4Internal.cmake
===================================================================
--- kde4libs.orig/cmake/modules/FindKDE4Internal.cmake	2014-08-19 22:36:20.881357112 +0200
+++ kde4libs/cmake/modules/FindKDE4Internal.cmake	2014-08-19 22:36:20.877357278 +0200
@@ -876,6 +876,7 @@
    _set_fancy(INCLUDE_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/include"         "The subdirectory to the header prefix")
 
    _set_fancy(PLUGIN_INSTALL_DIR       "${LIB_INSTALL_DIR}/kde4"                "The subdirectory relative to the install prefix where plugins will be installed (default is ${LIB_INSTALL_DIR}/kde4)")
+   _set_fancy(LIBKDEINIT_INSTALL_DIR   "${LIB_INSTALL_DIR}"                     "The subdirectory relative to the install prefix where core libraries of the kdeinit based executables may be installed (default is ${LIB_INSTALL_DIR})")
    _set_fancy(IMPORTS_INSTALL_DIR       "${PLUGIN_INSTALL_DIR}/imports"                "The subdirectory relative to the install prefix where imports will be installed")
    _set_fancy(CONFIG_INSTALL_DIR       "${SHARE_INSTALL_PREFIX}/config"         "The config file install dir")
    _set_fancy(DATA_INSTALL_DIR         "${SHARE_INSTALL_PREFIX}/apps"           "The parent directory where applications can install their data")
@@ -1411,6 +1412,10 @@
 
 endif (CMAKE_C_COMPILER MATCHES "icc")
 
+if (CMAKE_BUILD_TYPE AND CMAKE_BUILD_TYPE STREQUAL "Debian")
+   set(ENABLE_LIBKDEINIT_RUNPATH ON CACHE BOOL
+       "Add R(UN)PATH to kdeinit-based shared executables (defaults to ON if build type is Debian)")
+endif (CMAKE_BUILD_TYPE AND CMAKE_BUILD_TYPE STREQUAL "Debian")
 
 ###########    end of platform specific stuff  ##########################
 
Index: kde4libs/cmake/modules/KDE4Macros.cmake
===================================================================
--- kde4libs.orig/cmake/modules/KDE4Macros.cmake	2014-08-19 22:36:20.881357112 +0200
+++ kde4libs/cmake/modules/KDE4Macros.cmake	2014-08-19 22:36:20.877357278 +0200
@@ -834,6 +834,17 @@
 	      endif(NOT _icon_position EQUAL -1)
       endif (Q_WS_MAC)
       kde4_add_executable(${_target_NAME} "${_nogui}" ${CMAKE_CURRENT_BINARY_DIR}/${_target_NAME}_dummy.cpp ${_resourcefile})
+      if (UNIX AND ENABLE_LIBKDEINIT_RUNPATH)
+         list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${LIBKDEINIT_INSTALL_DIR}" _isSystemKdeinitDir)
+         if("${_isSystemKdeinitDir}" STREQUAL "-1")
+            if (CMAKE_SKIP_RPATH)
+               set_target_properties(${_target_NAME} PROPERTIES LINK_FLAGS "-Wl,--enable-new-dtags,-rpath,'${LIBKDEINIT_INSTALL_DIR}'")
+            else (CMAKE_SKIP_RPATH)
+               set_target_properties(${_target_NAME} PROPERTIES INSTALL_RPATH "${LIBKDEINIT_INSTALL_DIR}"
+                                                                LINK_FLAGS    "-Wl,--enable-new-dtags")
+            endif (CMAKE_SKIP_RPATH)
+         endif("${_isSystemKdeinitDir}" STREQUAL "-1")
+      endif (UNIX AND ENABLE_LIBKDEINIT_RUNPATH)
       target_link_libraries(${_target_NAME} kdeinit_${_target_NAME})
    endif(WIN32)
 
Index: kde4libs/kinit/CMakeLists.txt
===================================================================
--- kde4libs.orig/kinit/CMakeLists.txt	2014-08-19 22:36:20.881357112 +0200
+++ kde4libs/kinit/CMakeLists.txt	2014-08-19 22:36:20.877357278 +0200
@@ -58,6 +58,17 @@
 
 install(TARGETS kdeinit4 ${INSTALL_TARGETS_DEFAULT_ARGS} )
 
+if (UNIX)
+  list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${LIBKDEINIT_INSTALL_DIR}" _isSystemKdeinitDir)
+  if("${_isSystemKdeinitDir}" STREQUAL "-1")
+    if (CMAKE_SKIP_RPATH)
+        set_target_properties(kdeinit4 PROPERTIES LINK_FLAGS "-Wl,--enable-new-dtags,-rpath,'${LIBKDEINIT_INSTALL_DIR}'")
+    else (CMAKE_SKIP_RPATH)
+        set_target_properties(kdeinit4 PROPERTIES INSTALL_RPATH "${LIBKDEINIT_INSTALL_DIR}"
+                                                  LINK_FLAGS    "-Wl,--enable-new-dtags")
+    endif (CMAKE_SKIP_RPATH)
+  endif("${_isSystemKdeinitDir}" STREQUAL "-1")
+endif (UNIX)
 ########### kwrapper4 ###############
 if (WIN32)
   set(kwrapper_SRCS kwrapper_win.cpp  )
Index: kde4libs/config-prefix.h.cmake
===================================================================
--- kde4libs.orig/config-prefix.h.cmake	2014-08-19 22:36:20.881357112 +0200
+++ kde4libs/config-prefix.h.cmake	2014-08-19 22:36:20.877357278 +0200
@@ -12,6 +12,7 @@
 #define __KDE_EXECPREFIX "NONE"
 
 #define LIBEXEC_INSTALL_DIR "${LIBEXEC_INSTALL_DIR}"
+#define LIBKDEINIT_INSTALL_DIR "${LIBKDEINIT_INSTALL_DIR}"
 #define DATA_INSTALL_DIR "${DATA_INSTALL_DIR}"
 #define LIB_INSTALL_DIR "${LIB_INSTALL_DIR}"
 #define INCLUDE_INSTALL_DIR "${INCLUDE_INSTALL_DIR}"
Index: kde4libs/kdecore/kde-config.cpp
===================================================================
--- kde4libs.orig/kdecore/kde-config.cpp	2014-08-19 22:36:20.881357112 +0200
+++ kde4libs/kdecore/kde-config.cpp	2014-08-19 22:36:20.877357278 +0200
@@ -144,6 +144,7 @@
             "html", I18N_NOOP("HTML documentation"),
             "icon", I18N_NOOP("Icons"),
             "kcfg", I18N_NOOP("Configuration description files"),
+            "kdeinit", I18N_NOOP("kdeinit shared executables (resource added by Debian)"),
             "lib", I18N_NOOP("Libraries"),
             "include", I18N_NOOP("Includes/Headers"),
             "locale", I18N_NOOP("Translation files for KLocale"),
Index: kde4libs/kdecore/kernel/kstandarddirs.cpp
===================================================================
--- kde4libs.orig/kdecore/kernel/kstandarddirs.cpp	2014-08-19 22:36:20.881357112 +0200
+++ kde4libs/kdecore/kernel/kstandarddirs.cpp	2014-08-19 22:36:20.877357278 +0200
@@ -171,6 +171,8 @@
 menus
 xdgconf-autostart
 autostart
+kdeinit
+%lib
 */
 
 static const char types_string[] =
@@ -225,6 +227,8 @@
     "menus\0"
     "xdgconf-autostart\0"
     "autostart\0"
+    "kdeinit\0"
+    "%lib\0"
     "\0";
 
 static const int types_indices[] = {
@@ -234,7 +238,7 @@
     248,  258,  275,  285,  301,  305,  309,  316,
     326,  336,  354,  359,  377,  387,  403,  416,
     429,  442,  448,  463,  471,  484,  504,  217,
-    517,  530,  536,  554,  -1
+    517,  530,  536,  554,  564,  572,   -1
 };
 
 static void tokenize(QStringList& token, const QString& str,
Index: kde4libs/kdecore/kernel/kstandarddirs_unix.cpp
===================================================================
--- kde4libs.orig/kdecore/kernel/kstandarddirs_unix.cpp	2014-08-19 22:36:20.881357112 +0200
+++ kde4libs/kdecore/kernel/kstandarddirs_unix.cpp	2014-08-19 22:36:20.877357278 +0200
@@ -40,6 +40,8 @@
                 return QFile::decodeName(KCFG_INSTALL_DIR "/");
             if (strcmp("kdedir", type) == 0)
                 return QFile::decodeName(KDEDIR "/");
+            if (strcmp("kdeinit", type) == 0)
+                return QFile::decodeName(LIBKDEINIT_INSTALL_DIR "/");
             break;
         case 'd':
             if (strcmp("data", type) == 0)
Index: kde4libs/kdecore/kernel/kstandarddirs_win.cpp
===================================================================
--- kde4libs.orig/kdecore/kernel/kstandarddirs_win.cpp	2014-08-19 22:36:20.881357112 +0200
+++ kde4libs/kdecore/kernel/kstandarddirs_win.cpp	2014-08-19 22:36:20.877357278 +0200
@@ -47,6 +47,8 @@
                 return share() + QLatin1String("config.kcfg/");
             if (strcmp("kdedir", type) == 0)
                 return prefix();
+            if (strcmp("kdeinit", type) == 0)
+                return prefix() + QString::fromLatin1("lib" KDELIBSUFF "/");
             break;
         case 'd':
             if (strcmp("data", type) == 0)
Index: kde4libs/kdecore/util/kpluginloader.cpp
===================================================================
--- kde4libs.orig/kdecore/util/kpluginloader.cpp	2014-08-19 22:36:20.881357112 +0200
+++ kde4libs/kdecore/util/kpluginloader.cpp	2014-08-19 22:36:20.877357278 +0200
@@ -113,6 +113,13 @@
         libname = fileinfo.path() + QLatin1String("/lib") + fileinfo.fileName();
 #endif
 
+    if (kdeinit) {
+        libfile = cData.dirs()->findResource("kdeinit", libname);
+        if (!libfile.isEmpty()) {
+            return libfile;
+        }
+    }
+
     libfile = cData.dirs()->findResource("lib", libname);
     if (!libfile.isEmpty()) {
         if (!kdeinit) {
Index: kde4libs/kinit/kinit.cpp
===================================================================
--- kde4libs.orig/kinit/kinit.cpp	2014-08-19 22:36:20.881357112 +0200
+++ kde4libs/kinit/kinit.cpp	2014-08-19 22:36:20.877357278 +0200
@@ -498,11 +498,23 @@
             // try to match an absolute path to an executable binary (either in bin/ or in libexec/)
             // to a kdeinit module in the same prefix
             if( lib.contains( QLatin1String( "/lib" KDELIBSUFF "/kde4/libexec/" ))) {
-                libpath = QString( lib ).replace( QLatin1String( "/lib" KDELIBSUFF "/kde4/libexec/" ),
-                    QLatin1String("/lib" KDELIBSUFF "/libkdeinit4_")) + QLatin1String(".so");
+                if ( lib.contains(KStandardDirs::installPath( "libexec" ))) {
+                    libpath = QString( lib ).replace( KStandardDirs::installPath( "libexec" ),
+                        KStandardDirs::installPath( "kdeinit" )) + QLatin1String(".so");
+                }
+                if (libpath.isEmpty() || !QFile::exists( libpath )) {
+                    libpath = QString( lib ).replace( QLatin1String( "/lib" KDELIBSUFF "/kde4/libexec/" ),
+                        QLatin1String("/lib" KDELIBSUFF "/libkdeinit4_")) + QLatin1String(".so");
+                }
             } else if( lib.contains( QLatin1String( "/bin/" ))) {
-                libpath = QString( lib ).replace( QLatin1String( "/bin/" ),
-                    QLatin1String("/lib" KDELIBSUFF "/libkdeinit4_")) + QLatin1String(".so");
+                if ( lib.contains(KStandardDirs::installPath( "exe" )) ) {
+                    libpath = QString( lib ).replace( KStandardDirs::installPath( "exe" ),
+                        KStandardDirs::installPath( "kdeinit" )) + QLatin1String(".so");
+                }
+                if (libpath.isEmpty() || !QFile::exists( libpath )) {
+                    libpath = QString( lib ).replace( QLatin1String( "/bin/" ),
+                        QLatin1String("/lib" KDELIBSUFF "/libkdeinit4_")) + QLatin1String(".so");
+                }
             }
             // Don't confuse the user with "Could not load libkdeinit4_foo.so" if it doesn't exist
             if (!QFile::exists(libpath)) {