From b4c4c46639fd5008d9f0fa9632ded82ac96985d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sat, 18 Oct 2014 13:47:41 +0200 Subject: [PATCH 01/16] Fix detection of some headers on openbsd Many headers requires additional include stdlib.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot " --- tdeioslave/ConfigureChecks.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tdeioslave/ConfigureChecks.cmake b/tdeioslave/ConfigureChecks.cmake index 8f0783133..eed370833 100644 --- a/tdeioslave/ConfigureChecks.cmake +++ b/tdeioslave/ConfigureChecks.cmake @@ -11,6 +11,12 @@ if( WITH_SASL ) check_include_file( "sasl/sasl.h" HAVE_SASL_SASL_H ) + if( NOT HAVE_SASL_SASL_H ) + find_path( SASL_H_PATH "sasl/sasl.h" ) + if( SASL_H_PATH ) + set( HAVE_SASL_SASL_H "1" ) + endif( ) + endif( ) check_library_exists( sasl2 sasl_client_init "" HAVE_LIBSASL2 ) if( HAVE_SASL_SASL_H AND HAVE_LIBSASL2 ) set( SASL_LIBRARIES sasl2 ) From 46a0c294dfa00a6f31872e9adad44b5c4f819ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sat, 18 Oct 2014 13:53:48 +0200 Subject: [PATCH 02/16] Fix FTBFS on openbsd beacuse of invalid headers in tdeioslave_media MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot " --- tdeioslave/media/medianotifier/medianotifier.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tdeioslave/media/medianotifier/medianotifier.cpp b/tdeioslave/media/medianotifier/medianotifier.cpp index 2db917b25..4de36cad8 100644 --- a/tdeioslave/media/medianotifier/medianotifier.cpp +++ b/tdeioslave/media/medianotifier/medianotifier.cpp @@ -19,7 +19,13 @@ #include "medianotifier.h" +#ifdef __OpenBSD__ +#include +#include +#include +#else #include +#endif #include #include From 0f2ad67259c94671dd9b3b1960ccf7aebe31f292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sat, 18 Oct 2014 13:54:30 +0200 Subject: [PATCH 03/16] Fix FTBFS on openbsd because of missing header in tdeioslave_media MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot " --- tdeioslave/media/tdefile-plugin/tdefilemediaplugin.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tdeioslave/media/tdefile-plugin/tdefilemediaplugin.cpp b/tdeioslave/media/tdefile-plugin/tdefilemediaplugin.cpp index dc46e8287..61c5ccbbd 100644 --- a/tdeioslave/media/tdefile-plugin/tdefilemediaplugin.cpp +++ b/tdeioslave/media/tdefile-plugin/tdefilemediaplugin.cpp @@ -33,6 +33,9 @@ #ifdef HAVE_STATVFS # include #else +# ifdef __OpenBSD__ +# include +# endif # include # define statvfs statfs # define f_frsize f_bsize From 7d4e25814c489c3e2acd92f5a58384f12adb6e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sat, 18 Oct 2014 13:55:49 +0200 Subject: [PATCH 04/16] Fix FTBFS on openbsd because of missing header in tdesu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot " --- tdesu/tdesud/tdesud.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tdesu/tdesud/tdesud.cpp b/tdesu/tdesud/tdesud.cpp index 5e4f5122a..3d64bc840 100644 --- a/tdesu/tdesud/tdesud.cpp +++ b/tdesu/tdesud/tdesud.cpp @@ -45,7 +45,9 @@ #include #include +#ifndef __OpenBSD__ #include +#endif #include #include #include @@ -249,7 +251,9 @@ int create_socket() int main(int argc, char *argv[]) { +#ifndef __OpenBSD__ prctl(PR_SET_DUMPABLE, 0); +#endif TDEAboutData aboutData("tdesud", I18N_NOOP("TDE su daemon"), Version, I18N_NOOP("Daemon used by tdesu"), From 18b81de37b433e00f5b51323ee6569eb8068cf70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sat, 18 Oct 2014 13:56:58 +0200 Subject: [PATCH 05/16] Fix tdm auth backend for openbsd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot " --- tdm/backend/auth.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tdm/backend/auth.c b/tdm/backend/auth.c index bd183142c..b92881789 100644 --- a/tdm/backend/auth.c +++ b/tdm/backend/auth.c @@ -41,6 +41,9 @@ from the copyright holder. #include #include #include +#ifdef __OpenBSD__ +#include +#endif #include @@ -290,6 +293,26 @@ SaveServerAuthorizations( struct display *d, Xauth **auths, int count ) return FALSE; } } +#ifdef __OpenBSD__ + { + struct passwd *x11; + uid_t uid; + gid_t gid; + /* Give read capability to group _x11 */ + x11 = getpwnam("_x11"); + if (x11 == NULL) { + LogError("Can't find _x11 user\n"); + uid = getuid(); + gid = getgid(); + } else { + uid = x11->pw_uid; + gid = x11->pw_gid; + } + + fchown(fileno(auth_file), uid, gid); + } +#endif + Debug( "file: %s auth: %p\n", d->authFile, auths ); for (i = 0; i < count; i++) { /* From a679541fd738df5118cdddca997bf9b9531fdfcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sat, 18 Oct 2014 13:59:20 +0200 Subject: [PATCH 06/16] Fix tdm backend fd support on openbsd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot " --- tdm/backend/getfd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tdm/backend/getfd.c b/tdm/backend/getfd.c index 6bf8c8783..307b2501c 100644 --- a/tdm/backend/getfd.c +++ b/tdm/backend/getfd.c @@ -22,8 +22,12 @@ is_a_console(int fd) { char arg; arg = 0; +#ifdef __OpenBSD__ + return arg; +#else return (ioctl(fd, KDGKBTYPE, &arg) == 0 && ((arg == KB_101) || (arg == KB_84))); +#endif } static int From 71fb8e0e115daa047a514df546d13d294f376840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 18 Oct 2014 14:01:26 +0200 Subject: [PATCH 07/16] Fix crypt library detection in CMake MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- ConfigureChecks.cmake | 12 ++++++++++++ kcheckpass/ConfigureChecks.cmake | 2 -- tdm/ConfigureChecks.cmake | 10 ---------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 21ec42001..6a3c001da 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -54,6 +54,18 @@ if( WITH_PAM AND (BUILD_KCHECKPASS OR BUILD_TDM) ) endif( ) +# crypt +set( CRYPT_LIBRARY crypt ) +check_library_exists( ${CRYPT_LIBRARY} crypt "" HAVE_CRYPT ) +if( NOT HAVE_CRYPT ) + unset( CRYPT_LIBRARY ) + check_function_exists( crypt LIBC_HAVE_CRYPT ) + if( LIBC_HAVE_CRYPT ) + set( HAVE_CRYPT 1 CACHE INTERNAL "" FORCE ) + endif( LIBC_HAVE_CRYPT ) +endif( NOT HAVE_CRYPT ) + + # hal (ksmserver, tdeioslaves) if( WITH_HAL ) pkg_search_module( HAL hal ) diff --git a/kcheckpass/ConfigureChecks.cmake b/kcheckpass/ConfigureChecks.cmake index 120869dac..d6d62f55b 100644 --- a/kcheckpass/ConfigureChecks.cmake +++ b/kcheckpass/ConfigureChecks.cmake @@ -9,8 +9,6 @@ # ################################################# -find_library( CRYPT_LIBRARY crypt ) - if( WITH_PAM AND (NOT DEFINED KCHECKPASS_PAM_SERVICE) ) set( KCHECKPASS_PAM_SERVICE "kde" CACHE INTERNAL "" ) endif( ) diff --git a/tdm/ConfigureChecks.cmake b/tdm/ConfigureChecks.cmake index ae7ea8b6c..162a8a6ba 100644 --- a/tdm/ConfigureChecks.cmake +++ b/tdm/ConfigureChecks.cmake @@ -27,16 +27,6 @@ check_function_exists( login_getclass HAVE_LOGIN_GETCLASS ) check_function_exists( auth_timeok HAVE_AUTH_TIMEOK ) tde_restore( CMAKE_REQUIRED_LIBRARIES ) -check_function_exists( crypt LIBC_HAVE_CRYPT ) -if( LIBC_HAVE_CRYPT ) - set( HAVE_CRYPT 1 CACHE INTERNAL "" FORCE ) -else( ) - check_library_exists( crypt crypt "" HAVE_CRYPT ) - if( HAVE_CRYPT ) - set( CRYPT_LIBRARY crypt ) - endif( ) -endif( ) - check_include_file( lastlog.h HAVE_LASTLOG_H ) check_include_file( termio.h HAVE_TERMIO_H ) From 1651fcb54a3690cb973fdadbda8e8130da1e351c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sat, 18 Oct 2014 14:07:17 +0200 Subject: [PATCH 08/16] Fix conditionnal utmpx support in tdm MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot " --- tdm/ConfigureChecks.cmake | 2 +- tdm/kfrontend/kgreeter.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tdm/ConfigureChecks.cmake b/tdm/ConfigureChecks.cmake index 162a8a6ba..cb333aa61 100644 --- a/tdm/ConfigureChecks.cmake +++ b/tdm/ConfigureChecks.cmake @@ -85,7 +85,7 @@ unset( BSD_UTMP ) if( NOT HAVE_UTMPX ) check_function_exists( getutent have_getutent ) if( NOT have_getutent ) - set( BSD_UTMP 1 ) + set( BSD_UTMP 1 CACHE INTERNAL "" FORCE ) endif( ) endif( ) diff --git a/tdm/kfrontend/kgreeter.cpp b/tdm/kfrontend/kgreeter.cpp index 5ff8d5516..cb38599c1 100644 --- a/tdm/kfrontend/kgreeter.cpp +++ b/tdm/kfrontend/kgreeter.cpp @@ -71,7 +71,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include #include #include +#ifdef HAVE_UTMPX #include +#endif #include #include From d246c7d9388e0ca16db9f6c17f438761022f4515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 18 Oct 2014 14:10:43 +0200 Subject: [PATCH 09/16] Fix tdm_greet crash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- tdm/kfrontend/kgreeter.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tdm/kfrontend/kgreeter.cpp b/tdm/kfrontend/kgreeter.cpp index cb38599c1..e6073da50 100644 --- a/tdm/kfrontend/kgreeter.cpp +++ b/tdm/kfrontend/kgreeter.cpp @@ -1296,13 +1296,14 @@ void ControlPipeHandlerObject::run(void) { umask(0); struct stat buffer; int status; - char *fifo_parent_dir = strdup(FIFO_DIR); - dirname(fifo_parent_dir); + char *fifo_parent_dir; + char *fifo_dir = strdup(FIFO_DIR); + fifo_parent_dir = dirname(fifo_dir); status = stat(fifo_parent_dir, &buffer); if (status != 0) { - mkdir(fifo_parent_dir, 0644); + mkdir(fifo_parent_dir, 0755); } - free(fifo_parent_dir); + free(fifo_dir); status = stat(FIFO_DIR, &buffer); if (status == 0) { int file_mode = ((buffer.st_mode & S_IRWXU) >> 6) * 100; @@ -1315,7 +1316,7 @@ void ControlPipeHandlerObject::run(void) { return; } } - mkdir(FIFO_DIR,0600); + mkdir(FIFO_DIR,0700); mknod(mPipeFilename.ascii(), S_IFIFO|0600, 0); chmod(mPipeFilename.ascii(), 0600); From 6382ec3fed78026bae46456d10970dd1e4e7c159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sat, 18 Oct 2014 14:12:48 +0200 Subject: [PATCH 10/16] Fix FTBFS on openbsd because invalid include in kickoff menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot " --- kicker/kicker/ui/k_new_mnu.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kicker/kicker/ui/k_new_mnu.cpp b/kicker/kicker/ui/k_new_mnu.cpp index 3e705ba31..70efdea79 100644 --- a/kicker/kicker/ui/k_new_mnu.cpp +++ b/kicker/kicker/ui/k_new_mnu.cpp @@ -93,7 +93,13 @@ #include "flipscrollview.h" #include "itemview.h" #include +#ifdef __OpenBSD__ +#include +#include +#include +#else #include +#endif #include #include "media_watcher.h" From a6d7fd775b71e25fdfde012d867c5af8a6135436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sat, 18 Oct 2014 14:13:53 +0200 Subject: [PATCH 11/16] Fix FTBFS on openbsd because conflicting declaration in twin compton MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot " --- twin/compton-tde/common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/twin/compton-tde/common.h b/twin/compton-tde/common.h index 8a7bae6d5..fbdf49a89 100644 --- a/twin/compton-tde/common.h +++ b/twin/compton-tde/common.h @@ -389,9 +389,11 @@ typedef void (*f_CopySubBuffer) (Display *dpy, GLXDrawable drawable, int x, int #ifdef CONFIG_GLX_SYNC // Looks like duplicate typedef of the same type is safe? +#ifndef __OpenBSD__ typedef int64_t GLint64; typedef uint64_t GLuint64; typedef struct __GLsync *GLsync; +#endif #ifndef GL_SYNC_FLUSH_COMMANDS_BIT #define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 From e22eb72fdd5085bce12a47b3707347c60d1e3268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sat, 18 Oct 2014 14:15:06 +0200 Subject: [PATCH 12/16] Add perl function support in tdeioslave_man [taken from OpenBSD KDE3 patches] --- tdeioslave/man/man2html.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tdeioslave/man/man2html.cpp b/tdeioslave/man/man2html.cpp index 67354e1b1..eee3ac803 100644 --- a/tdeioslave/man/man2html.cpp +++ b/tdeioslave/man/man2html.cpp @@ -2707,6 +2707,7 @@ static const char *section_list[] = { "3L", "Lightweight Processes Library", "3M", "Mathematical Library", "3N", "Network Functions", + "3p", "Perl Functions", "3R", "RPC Services Library", "3S", "Standard I/O Functions", "3V", "C Library Functions", @@ -5482,16 +5483,17 @@ static char *scan_troff_mandoc(char *c, bool san, char **result) end++; } - if (end > c + 2 + if (end >= c + 2 && ispunct(*(end - 1)) && isspace(*(end - 2)) && *(end - 2) != '\n') { /* Don't format lonely punctuation E.g. in "xyz ," format * the xyz and then append the comma removing the space. */ - *(end - 2) = '\n'; - ret = scan_troff(c, san, result); - *(end - 2) = *(end - 1); - *(end - 1) = ' '; + *(end - 2) = 0; + (void)scan_troff(c, 0, result); + ret = end-2; + *(end-2)=*(end-1); + *(end-1)=' '; } else { ret = scan_troff(c, san, result); From 69da674b30d246f4df152501b9312518cd900372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 18 Oct 2014 14:17:52 +0200 Subject: [PATCH 13/16] Fix gcc visibility detection This resolves Bug 1832 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- ConfigureChecks.cmake | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 6a3c001da..1980d3ce0 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -12,7 +12,10 @@ # ################################################# +# required stuff tde_setup_architecture_flags( ) +find_package( TQt ) +find_package( TDE ) ##### check for libdl ########################### @@ -90,8 +93,21 @@ endif( ) if( WITH_GCC_VISIBILITY ) if( NOT UNIX ) - tde_message_fatal(FATAL_ERROR "\ngcc visibility support was requested, but your system is not *NIX" ) + tde_message_fatal( "gcc visibility support was requested, but your system is not *NIX" ) endif( NOT UNIX ) + tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${TDE_INCLUDE_DIR}" ) + check_cxx_source_compiles( " + #include + #ifndef __KDE_HAVE_GCC_VISIBILITY + #error gcc visibility is not enabled in tdelibs + #endif + int main() { return 0; } " + HAVE_GCC_VISIBILITY + ) + tde_restore( CMAKE_REQUIRED_INCLUDES ) + if( NOT HAVE_GCC_VISIBILITY ) + tde_message_fatal( "gcc visibility support was requested, but not supported in tdelibs" ) + endif( NOT HAVE_GCC_VISIBILITY ) set( __KDE_HAVE_GCC_VISIBILITY 1 ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden") @@ -334,8 +350,8 @@ else( ) set( WITHOUT_ARTS 1 ) endif( ) -# libart +# libart if( WITH_LIBART ) pkg_search_module( LIBART libart-2.0 ) if( NOT LIBART_FOUND ) @@ -345,12 +361,6 @@ if( WITH_LIBART ) endif( WITH_LIBART ) -# required stuff -find_package( TQt ) -find_package( TDE ) - - - # dbus (tdm, kdesktop, twin/compton-tde.c) if( BUILD_TDM OR BUILD_KDESKTOP OR (BUILD_TWIN AND WITH_XCOMPOSITE) ) From 107220694fe3387df4051dcd94ae6c9995cb45f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 18 Oct 2014 14:19:37 +0200 Subject: [PATCH 14/16] Allow contitional build with tdehwlib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- ConfigureChecks.cmake | 18 +++++++++ drkonqi/backtrace.cpp | 4 ++ kcontrol/CMakeLists.txt | 2 +- kcontrol/displayconfig/displayconfig.cpp | 4 ++ kcontrol/displayconfig/displayconfig.h | 4 ++ kcontrol/randr/tderandrtray.cpp | 4 ++ kcontrol/randr/tderandrtray.h | 4 ++ kicker/kicker/ui/k_new_mnu.cpp | 20 ++++++---- ksmserver/server.cpp | 4 ++ ksmserver/server.h | 4 ++ ksmserver/shutdown.cpp | 4 ++ ksmserver/shutdowndlg.cpp | 6 ++- tdeioslave/media/mediamanager/CMakeLists.txt | 37 +++++++------------ .../medianotifier/notificationdialog.cpp | 2 + .../mounthelper/tdeio_media_mounthelper.cpp | 4 ++ tdm/kfrontend/kgapp.cpp | 4 ++ tdm/kfrontend/kgapp.h | 4 ++ 17 files changed, 95 insertions(+), 34 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 1980d3ce0..18e2b5014 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -78,6 +78,24 @@ if( WITH_HAL ) endif( ) +# tdehwlib (drkonqi, kcontrol, kicker, ksmserver, tdeioslaves, tdm) +if( WITH_TDEHWLIB ) + tde_save_and_set( CMAKE_REQUIRED_INCLUDES "${TDE_INCLUDE_DIR}" ) + check_cxx_source_compiles( " + #include + #ifndef __TDE_HAVE_TDEHWLIB + #error tdecore is not build with tdehwlib + #endif + int main() { return 0; } " + HAVE_TDEHWLIB + ) + tde_restore( CMAKE_REQUIRED_INCLUDES ) + if( NOT HAVE_TDEHWLIB ) + tde_message_fatal( "tdehwlib is required, but not built in tdecore" ) + endif( NOT HAVE_TDEHWLIB ) +endif( ) + + # udev (tsak) if( BUILD_TSAK ) pkg_search_module( UDEV udev ) diff --git a/drkonqi/backtrace.cpp b/drkonqi/backtrace.cpp index 2acd74df5..70bb35fa7 100644 --- a/drkonqi/backtrace.cpp +++ b/drkonqi/backtrace.cpp @@ -36,7 +36,9 @@ #include #include #include +#ifdef __TDE_HAVE_TDEHWLIB #include +#endif #ifdef HAVE_ELFICON // Elven things @@ -356,6 +358,7 @@ void BackTrace::processBacktrace() } #endif // HAVE_ELFICON +#ifdef __TDE_HAVE_TDEHWLIB // Append potentially important hardware information m_strBt.append("\n==== (tdehwlib) hardware information ====\n"); TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); @@ -374,6 +377,7 @@ void BackTrace::processBacktrace() m_strBt.append("\n"); } } +#endif { // Clean up hard to read debug blocks diff --git a/kcontrol/CMakeLists.txt b/kcontrol/CMakeLists.txt index ffd8e8346..d45828d10 100644 --- a/kcontrol/CMakeLists.txt +++ b/kcontrol/CMakeLists.txt @@ -64,9 +64,9 @@ if( BUILD_KCONTROL ) add_subdirectory( kthememanager ) add_subdirectory( tdefontinst ) add_subdirectory( access ) - add_subdirectory( hwmanager ) tde_conditional_add_subdirectory( WITH_XRANDR displayconfig ) + tde_conditional_add_subdirectory( WITH_TDEHWLIB hwmanager ) tde_conditional_add_subdirectory( WITH_SAMBA samba ) tde_conditional_add_subdirectory( WITH_XRANDR randr ) tde_conditional_add_subdirectory( WITH_LIBRAW1394 view1394 ) diff --git a/kcontrol/displayconfig/displayconfig.cpp b/kcontrol/displayconfig/displayconfig.cpp index db371fc42..d326740b7 100644 --- a/kcontrol/displayconfig/displayconfig.cpp +++ b/kcontrol/displayconfig/displayconfig.cpp @@ -742,8 +742,10 @@ void KDisplayConfig::setRealResolutionSliderValue(int index) { KDisplayConfig::KDisplayConfig(TQWidget *parent, const char *name, const TQStringList &) : TDECModule(KDisplayCFactory::instance(), parent, name), iccTab(0), numberOfProfiles(0), numberOfScreens(0), m_randrsimple(0), activeProfileName(""), m_gammaApplyTimer(0) { +#ifdef __TDE_HAVE_TDEHWLIB TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*))); +#endif m_randrsimple = new KRandrSimpleAPI(); @@ -859,6 +861,7 @@ KDisplayConfig::~KDisplayConfig() } void KDisplayConfig::deviceChanged (TDEGenericDevice* device) { +#ifdef __TDE_HAVE_TDEHWLIB if (device->type() == TDEGenericDeviceType::Monitor) { if (base->rescanHardware->isEnabled()) { base->rescanHardware->setEnabled(false); @@ -866,6 +869,7 @@ void KDisplayConfig::deviceChanged (TDEGenericDevice* device) { base->rescanHardware->setEnabled(true); } } +#endif } void KDisplayConfig::updateExtendedMonitorInformation () { diff --git a/kcontrol/displayconfig/displayconfig.h b/kcontrol/displayconfig/displayconfig.h index a52ebb3fc..92fa1f421 100644 --- a/kcontrol/displayconfig/displayconfig.h +++ b/kcontrol/displayconfig/displayconfig.h @@ -35,7 +35,11 @@ #include #include +#ifdef __TDE_HAVE_TDEHWLIB #include +#else +#define TDEGenericDevice void +#endif #include "monitorworkspace.h" #include "displayconfigbase.h" diff --git a/kcontrol/randr/tderandrtray.cpp b/kcontrol/randr/tderandrtray.cpp index d6a711db7..a443c3781 100644 --- a/kcontrol/randr/tderandrtray.cpp +++ b/kcontrol/randr/tderandrtray.cpp @@ -92,8 +92,10 @@ KRandRSystemTray::KRandRSystemTray(TQWidget* parent, const char *name) applyIccConfiguration(cur_profile, NULL); } +#ifdef __TDE_HAVE_TDEHWLIB TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*))); +#endif } /*! @@ -886,6 +888,7 @@ void KRandRSystemTray::slotOutputChanged(int parameter) } void KRandRSystemTray::deviceChanged (TDEGenericDevice* device) { +#ifdef __TDE_HAVE_TDEHWLIB if (device->type() == TDEGenericDeviceType::Monitor) { KRandrPassivePopup::message( i18n("New display output options are available!"), @@ -895,6 +898,7 @@ void KRandRSystemTray::deviceChanged (TDEGenericDevice* device) { reloadDisplayConfiguration(); applyHotplugRules(locateLocal("config", "/", true)); } +#endif } void KRandRSystemTray::slotHelpContents() diff --git a/kcontrol/randr/tderandrtray.h b/kcontrol/randr/tderandrtray.h index 09a1b2671..8f382922f 100644 --- a/kcontrol/randr/tderandrtray.h +++ b/kcontrol/randr/tderandrtray.h @@ -25,7 +25,11 @@ #include #include +#ifdef __TDE_HAVE_TDEHWLIB #include +#else +#define TDEGenericDevice void +#endif class KHelpMenu; class TDEPopupMenu; diff --git a/kicker/kicker/ui/k_new_mnu.cpp b/kicker/kicker/ui/k_new_mnu.cpp index 70efdea79..a5641168f 100644 --- a/kicker/kicker/ui/k_new_mnu.cpp +++ b/kicker/kicker/ui/k_new_mnu.cpp @@ -52,7 +52,9 @@ #include #include #include +#ifdef __TDE_HAVE_TDEHWLIB #include +#endif #include #include #include @@ -1365,10 +1367,10 @@ void KMenu::insertStaticExitItems() } bool maysd = false; -#ifdef COMPILE_HALBACKEND +#if defined(COMPILE_HALBACKEND) if (ksmserver.readBoolEntry( "offerShutdown", true ) && DM().canShutdown()) maysd = true; -#else +#elif defined(__TDE_HAVE_TDEHWLIB) TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); if( rootDevice ) { maysd = rootDevice->canPowerOff(); @@ -3798,7 +3800,7 @@ void KMenu::insertSuspendOption( int &nId, int &index ) bool suspend_freeze = false; bool standby = false; bool suspend_disk = false; -#ifdef COMPILE_HALBACKEND +#if defined(COMPILE_HALBACKEND) suspend_ram = libhal_device_get_property_bool(m_halCtx, "/org/freedesktop/Hal/devices/computer", "power_management.can_suspend", @@ -3813,7 +3815,7 @@ void KMenu::insertSuspendOption( int &nId, int &index ) "/org/freedesktop/Hal/devices/computer", "power_management.can_hibernate", NULL); -#else // COMPILE_HALBACKEND +#elif defined(__TDE_HAVE_TDEHWLIB) // COMPILE_HALBACKEND TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); if (rootDevice) { suspend_ram = rootDevice->canSuspend(); @@ -3874,7 +3876,7 @@ void KMenu::slotSuspend(int id) DCOPRef("kdesktop", "KScreensaverIface").call("lock()"); } -#ifdef COMPILE_HALBACKEND +#if defined(COMPILE_HALBACKEND) DBusMessage* msg = NULL; if (m_dbusConn) { @@ -3907,7 +3909,7 @@ void KMenu::slotSuspend(int id) } dbus_message_unref(msg); } -#else // COMPILE_HALBACKEND +#elif defined(__TDE_HAVE_TDEHWLIB) // COMPILE_HALBACKEND TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); if (rootDevice) { if (id == 1) { @@ -3922,10 +3924,12 @@ void KMenu::slotSuspend(int id) return; } } +#else + error = false; #endif - if (error) + if (error) { KMessageBox::error(this, i18n("Suspend failed")); - + } } void KMenu::runUserCommand() diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp index 257d5f20c..c9a037397 100644 --- a/ksmserver/server.cpp +++ b/ksmserver/server.cpp @@ -598,7 +598,9 @@ KSMServer::KSMServer( const TQString& windowManager, const TQString& windowManag clientInteracting = 0; xonCommand = config->readEntry( "xonCommand", "xon" ); +#ifdef __TDE_HAVE_TDEHWLIB hwDevices = TDEGlobal::hardwareDevices(); +#endif connect( &knotifyTimeoutTimer, TQT_SIGNAL( timeout()), TQT_SLOT( knotifyTimeout())); connect( &startupSuspendTimeoutTimer, TQT_SIGNAL( timeout()), TQT_SLOT( startupSuspendTimeout())); @@ -720,6 +722,7 @@ void KSMServer::cleanUp() DM().shutdown( shutdownType, shutdownMode, bootOption ); } else { +#ifdef __TDE_HAVE_TDEHWLIB TDERootSystemDevice* rootDevice = hwDevices->rootSystemDevice(); if (rootDevice) { if (shutdownType == TDEApplication::ShutdownTypeHalt) { @@ -729,6 +732,7 @@ void KSMServer::cleanUp() rootDevice->setPowerState(TDESystemPowerState::Reboot); } } +#endif } } diff --git a/ksmserver/server.h b/ksmserver/server.h index f5e0d37c6..bc677752c 100644 --- a/ksmserver/server.h +++ b/ksmserver/server.h @@ -23,7 +23,9 @@ Copyright (C) 2000 Matthias Ettrich #include #include +#ifdef __TDE_HAVE_TDEHWLIB #include +#endif #include "server2.h" @@ -251,7 +253,9 @@ private: WindowMap legacyWindows; +#ifdef __TDE_HAVE_TDEHWLIB TDEHardwareDevices* hwDevices; +#endif int initialClientCount; int phase2ClientCount; int protectionTimerCounter; diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp index d7eaafb0e..a40bffc3b 100644 --- a/ksmserver/shutdown.cpp +++ b/ksmserver/shutdown.cpp @@ -152,6 +152,7 @@ bool KSMServer::checkStatus( bool &logoutConfirmed, bool &maysd, bool &mayrb, mayrb = true; } else { +#ifdef __TDE_HAVE_TDEHWLIB TDERootSystemDevice* rootDevice = hwDevices->rootSystemDevice(); if (rootDevice) { if (rootDevice->canPowerOff()) { @@ -161,6 +162,7 @@ bool KSMServer::checkStatus( bool &logoutConfirmed, bool &maysd, bool &mayrb, mayrb = true; } } +#endif } } if (!maysd) { @@ -239,6 +241,7 @@ void KSMServer::shutdownInternal( TDEApplication::ShutdownConfirm confirm, // If this is not done the desktop of the locked session will be shown after suspend/hibernate until the lock fully engages! kapp->dcopClient()->call("kdesktop", "KScreensaverIface", "lock()", TQCString(""), replyType, replyData); } +#ifdef __TDE_HAVE_TDEHWLIB TDERootSystemDevice* rootDevice = hwDevices->rootSystemDevice(); if (rootDevice) { if (selection == 1) { // Suspend @@ -251,6 +254,7 @@ void KSMServer::shutdownInternal( TDEApplication::ShutdownConfirm confirm, rootDevice->setPowerState(TDESystemPowerState::Freeze); } } +#endif } } diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp index 6b3b02428..d4881ad85 100644 --- a/ksmserver/shutdowndlg.cpp +++ b/ksmserver/shutdowndlg.cpp @@ -33,7 +33,9 @@ Copyright (C) 2000 Matthias Ettrich #include #include #include +#ifdef __TDE_HAVE_TDEHWLIB #include +#endif #include #include #include @@ -805,7 +807,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent, bool canSuspend = false; bool canHibernate = false; -#ifdef COMPILE_HALBACKEND +#if defined(COMPILE_HALBACKEND) // Query HAL for suspend/resume support m_halCtx = libhal_ctx_new(); @@ -860,7 +862,7 @@ KSMShutdownDlg::KSMShutdownDlg( TQWidget* parent, canHibernate = true; } } -#else // COMPILE_HALBACKEND +#elif defined(__TDE_HAVE_TDEHWLIB) // COMPILE_HALBACKEND TDERootSystemDevice* rootDevice = TDEGlobal::hardwareDevices()->rootSystemDevice(); if (rootDevice) { canFreeze = rootDevice->canFreeze(); diff --git a/tdeioslave/media/mediamanager/CMakeLists.txt b/tdeioslave/media/mediamanager/CMakeLists.txt index 5a73f3708..21faaeaf7 100644 --- a/tdeioslave/media/mediamanager/CMakeLists.txt +++ b/tdeioslave/media/mediamanager/CMakeLists.txt @@ -36,30 +36,21 @@ install( FILES mediamanager.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kded ) set( target kded_mediamanager ) if( WITH_HAL ) - set( ${target}_SRCS - mediamanager.cpp mediamanager.skel medialist.cpp - backendbase.cpp fstabbackend.cpp removablebackend.cpp - mediadirnotify.cpp mediadirnotify.skel - decryptdialog.ui dialog.cpp - halbackend.cpp linuxcdpolling.cpp tdehardwarebackend.cpp - ) + set( HAL_MEDIA_BACKEND halbackend.cpp linuxcdpolling.cpp ) + set( HAL_MEDIA_LIBRARIES ${HAL_LIBRARIES} -lhal-storage ${DBUS_TQT_LIBRARIES} ) +endif( ) - tde_add_kpart( ${target} AUTOMOC - SOURCES ${${target}_SRCS} - LINK mediacommon-static tdeinit_kded-shared ${HAL_LIBRARIES} -lhal-storage ${DBUS_TQT_LIBRARIES} - DESTINATION ${PLUGIN_INSTALL_DIR} - ) -else( ) - set( ${target}_SRCS +if( WITH_TDEHWLIB ) + set( TDEHWBACKEND tdehardwarebackend.cpp ) +endif( WITH_TDEHWLIB ) + +tde_add_kpart( ${target} AUTOMOC + SOURCES mediamanager.cpp mediamanager.skel medialist.cpp backendbase.cpp fstabbackend.cpp removablebackend.cpp decryptdialog.ui dialog.cpp - mediadirnotify.cpp mediadirnotify.skel tdehardwarebackend.cpp - ) - - tde_add_kpart( ${target} AUTOMOC - SOURCES ${${target}_SRCS} - LINK mediacommon-static tdeinit_kded-shared - DESTINATION ${PLUGIN_INSTALL_DIR} - ) -endif( ) + mediadirnotify.cpp mediadirnotify.skel + ${HAL_MEDIA_BACKEND} ${TDEHWBACKEND} + LINK mediacommon-static tdeinit_kded-shared ${HAL_MEDIA_LIBRARIES} + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/tdeioslave/media/medianotifier/notificationdialog.cpp b/tdeioslave/media/medianotifier/notificationdialog.cpp index c9a920f99..7e4004e8c 100644 --- a/tdeioslave/media/medianotifier/notificationdialog.cpp +++ b/tdeioslave/media/medianotifier/notificationdialog.cpp @@ -28,7 +28,9 @@ #include #include #include +#ifdef __TDE_HAVE_TDEHWLIB #include +#endif #include "actionlistboxitem.h" #include "notificationdialogview.h" diff --git a/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp b/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp index 5357bc68d..3f0319f9f 100644 --- a/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp +++ b/tdeioslave/media/mounthelper/tdeio_media_mounthelper.cpp @@ -33,7 +33,9 @@ #include #include #include +#ifdef __TDE_HAVE_TDEHWLIB #include +#endif #include "dialog.h" #include "tdeio_media_mounthelper.h" @@ -187,6 +189,7 @@ MountHelper::MountHelper() : TDEApplication() void MountHelper::invokeEject(const TQString &device, bool quiet) { +#ifdef __TDE_HAVE_TDEHWLIB // Try TDE HW library eject first... TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); TDEGenericDevice *hwdevice = hwdevices->findByDeviceNode(device); @@ -197,6 +200,7 @@ void MountHelper::invokeEject(const TQString &device, bool quiet) ::exit(0); } } +#endif // Then fall back to tdeeject if needed TDEProcess *proc = new TDEProcess(TQT_TQOBJECT(this)); diff --git a/tdm/kfrontend/kgapp.cpp b/tdm/kfrontend/kgapp.cpp index f172521bc..2d630485e 100644 --- a/tdm/kfrontend/kgapp.cpp +++ b/tdm/kfrontend/kgapp.cpp @@ -123,11 +123,14 @@ void GreeterApp::init() startTimer( pingInterval * 60000 ); } +#ifdef __TDE_HAVE_TDEHWLIB TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices(); connect(hwdevices, TQT_SIGNAL(hardwareUpdated(TDEGenericDevice*)), this, TQT_SLOT(deviceChanged(TDEGenericDevice*))); +#endif } void GreeterApp::deviceChanged(TDEGenericDevice* device) { +#ifdef __TDE_HAVE_TDEHWLIB #ifdef WITH_XRANDR if (device->type() == TDEGenericDeviceType::Monitor) { KRandrSimpleAPI *randrsimple = new KRandrSimpleAPI(); @@ -135,6 +138,7 @@ void GreeterApp::deviceChanged(TDEGenericDevice* device) { delete randrsimple; } #endif // WITH_XRANDR +#endif // __TDE_HAVE_TDEHWLIB } void diff --git a/tdm/kfrontend/kgapp.h b/tdm/kfrontend/kgapp.h index 6150b4f5d..c9e2802c1 100644 --- a/tdm/kfrontend/kgapp.h +++ b/tdm/kfrontend/kgapp.h @@ -27,7 +27,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define KGAPP_H #include +#ifdef __TDE_HAVE_TDEHWLIB #include +#else +#define TDEGenericDevice void +#endif class GreeterApp : public TDEApplication { Q_OBJECT From 44654c9af508f61aecffc5921d9f631501a069ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Andriot?= Date: Sat, 18 Oct 2014 14:20:05 +0200 Subject: [PATCH 15/16] Fix FTBFS on openbsd because 'abs' function in kcontrol/displayconfig MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: François Andriot " --- kcontrol/displayconfig/displayconfig.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kcontrol/displayconfig/displayconfig.cpp b/kcontrol/displayconfig/displayconfig.cpp index d326740b7..835b2598b 100644 --- a/kcontrol/displayconfig/displayconfig.cpp +++ b/kcontrol/displayconfig/displayconfig.cpp @@ -57,6 +57,9 @@ #include "displayconfig.h" using namespace std; +#ifdef __OpenBSD__ +#define abs __gnu_cxx::abs +#endif /**** DLL Interface ****/ typedef KGenericFactory KDisplayCFactory; From d7ccc16037550f5dc9ba2db00e47ea950c3732d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 18 Oct 2014 14:21:26 +0200 Subject: [PATCH 16/16] Update r14-xdg-update: add update of tdenewstuff sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- r14-xdg-update | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/r14-xdg-update b/r14-xdg-update index 1195240d4..8bf357fff 100644 --- a/r14-xdg-update +++ b/r14-xdg-update @@ -3,7 +3,7 @@ # A script to perform R14.0.0 XDG compliance updates. SCRIPT_NAME="`basename \`readlink -f $0\``" -SCRIPT_VERSION=201407050 +SCRIPT_VERSION=201410170 # This script should be needed to run only once, but corner cases # and file/directory permissions could cause incomplete updates. @@ -608,6 +608,14 @@ if [ "$R14_VERSION" -lt "201310050" ]; then fi fi +# Update TDENewStuff +if [ "$R14_VERSION" -lt "201410170" ]; then + Log "Updating TDENewStuff providers and status." + find "$PROFILE_DIR"/share/config -type f -print0 2>/dev/null | \ + xargs -r0 grep -ZIEl "^\[KNewStuff" | \ + xargs -r0 sed -i -e "/^\[KNewStuff/,/^\[|$/{" -e "s|^\[KNewStuff|[TDENewStuff|" -e "s|^ProvidersUrl=[^ ]*|ProvidersUrl=https://www.trinitydesktop.org/ocs/providers.xml|" -e "}" +fi + Log "Renaming some configuration files and directories." # Note: The only rebranding that occured before starting the R14 branch was krita. All other # rebranding updates belong in this script.