Bug 199734 - boot-time unable to find ksysguarddrc warning
Summary: boot-time unable to find ksysguarddrc warning
Status: RESOLVED FIXED
Alias: None
Product: ksysguard
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-11 01:41 UTC by John Stanley
Modified: 2015-02-25 11:12 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Stanley 2009-07-11 01:41:57 UTC
Version:            (using KDE 4.2.4)
Compiler:          gcc-4.40 linux-2.6.30.1 glibc-2.10.1
OS:                Linux
Installed from:    Compiled From Sources

Even with the file /etc/kde/ksysguarddrc present, I get a boot-time warning of file '"/etc/kde/ksysguarddrc"' not found. This message appears in kde 4.2.90/95/96. To remove this warning I have made a simple one change to the file "ksysguard/ksysguardd/CMakeLists.txt", i.e.,

--- kdebase-workspace-4.2.96.old/ksysguard/ksysguardd/CMakeLists.txt    2009-06-17 16:07:40.000000000 -0400
+++ kdebase-workspace-4.2.96.new/ksysguard/ksysguardd/CMakeLists.txt    2009-07-09 20:17:01.448451888 -0400
@@ -5,7 +5,7 @@
 # Laurent: Verify that we install it into (kdeprefix)/etc/ and not into /etc
 # otherwise it's necessary to change it.
 # into kde 3.x it was installed into /etc/
-add_definitions( -DKSYSGUARDDRCFILE=\"\\"${SYSCONF_INSTALL_DIR}/ksysguarddrc\\"\" )
+add_definitions( -DKSYSGUARDDRCFILE=\"${SYSCONF_INSTALL_DIR}/ksysguarddrc\" )
Comment 1 John Tapsell 2009-07-11 10:44:02 UTC
SVN commit 994705 by johnflux:

Fix finding ksysguarddrc as suggested by John Stanley

BUG:199734


 M  +1 -1      CMakeLists.txt  


WebSVN link: http://websvn.kde.org/?view=rev&revision=994705
Comment 2 Max 2015-02-23 00:26:06 UTC
it seems this fix has been lost somwhow, can it be committed again?
Comment 3 Raphael Kubo da Costa 2015-02-24 22:33:33 UTC
+krop

The fix was reverted ages ago in http://quickgit.kde.org/?p=kde-workspace.git&a=commit&h=4c2df14400bf741f4910e3783e78860a06ec2755 but it is not clear to me why.
Christophe, do you still remember why you did that or was it just an oversight?
Comment 4 Raphael Kubo da Costa 2015-02-24 22:42:08 UTC
Actually, I should ask Max instead; if I reapply the original commit here with CMake 3.1.3 the code just doesn't build, as the code in ksysguardd.c evaluates to

  #define KSYSGUARDDRCFILE /s/kde/etc/ksysguarddrc

instead of

  #define KSYSGUARDDRCFILE "/s/kde/etc/ksysguarddrc"
Comment 5 Christophe Marin 2015-02-25 07:39:05 UTC
Back then, the extra quoting was the only way to have '${SYSCONF_INSTALL_DIR}/ksysguarddrc' passed as parameter (due to some CMake CMPxxx policies set by kdelibs).

On the other hand, ksysguard for an unknown reason was also supposed to build standalone but unconditionnaly adding 'cmake_minimum_required(VERSION 2.6.2)' was resetting the CMake policies to their default values.
Comment 6 Max 2015-02-25 10:33:12 UTC
(In reply to Raphael Kubo da Costa from comment #4)
> Actually, I should ask Max instead; if I reapply the original commit here
> with CMake 3.1.3 the code just doesn't build, as the code in ksysguardd.c
> evaluates to
> 
>   #define KSYSGUARDDRCFILE /s/kde/etc/ksysguarddrc
> 
> instead of
> 
>   #define KSYSGUARDDRCFILE "/s/kde/etc/ksysguarddrc"

With kde-workspace-4.11.14, cmake-3.1.3 I have:
ksysguardd.c:static const char *ConfigFile = KSYSGUARDDRCFILE;
ksysguardd/CMakeFiles/ksysguardd.dir/flags.make:C_DEFINES = -DKSYSGUARDDRCFILE="\"\\\"/usr/local/etc/ksysguarddrc\\\"\"" -DOSTYPE_FreeBSD

After patching:
ksysguardd/CMakeFiles/ksysguardd.dir/flags.make:C_DEFINES = -DKSYSGUARDDRCFILE=\"/usr/local/etc/ksysguarddrc\" -DOSTYPE_FreeBSD
Comment 7 Christophe Marin 2015-02-25 11:12:04 UTC
Note: a better fix for master would be to use a config file instead of relying on compilers parameters. there's already a config-ksysguardd.h.cmake that could be used for that purpose.