[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-buildsystem
Subject:    Re: Please review: cmake check for Cagibi
From:       Maciej Mrozowski <reavertm () gmail ! com>
Date:       2010-08-24 20:21:51
Message-ID: 201008242221.51996.reavertm () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]

[Attachment #4 (multipart/mixed)]


On Tuesday 24 of August 2010 21:21:08 Friedrich W. H. Kossebau wrote:
> Mardi, le 24 août 2010, à 20:02, Maciej Mrozowski a écrit:
> > On Tuesday 24 of August 2010 02:34:05 Friedrich W. H. Kossebau wrote:
> > > Mardi, le 24 août 2010, à 01:24, Yury G. Kudryashov a écrit:
> > > > BTW, what about adding one more parameter to m_l_f that tells whether
> > > > dependency is a runtime dep (default to FALSE)? Or even add another
> > > > macro because "required" flag MUST be FALSE for runtime dependencies?
> > > > Then we'll be able to say:
> > > > == THE FOLLOWING RUNTIME DEPENDENCIES ARE MISSING ON YOUR SYSTEM ==
> > > 
> > > That might be indeed most useful and nice to have, I agree
> > > (non-packager, but self-compiler :) ).
> > 
> > Otherwise listing runtime-only dependencies in README file is just as
> > good (what said kajonggh does for instance).
> > 
> > It's even better than CMake checks in case all runtime-only dependencies
> > are met (so no missing deps are reported) - as packager is not aware of
> > them.
> 
> True, good hint. So if packagers do read README file, than I will add one,
> too. Hm, should then be kdebase/runtime/README, or can I ever expect some
> packager to read kdebase/runtime/kioslave/network/README?

Indeed, hunting down all those files may be difficult.

> Might be good if this could be standardized.
> I still like Yury's proposal for that, as it integrates into the log
> creation, so all dependencies can be seen at one place, no need to search
> somewhere else. I guess Yury also had the second listing in mind,
> == THE FOLLOWING RUNTIME DEPENDENCIES ARE AVAILABLE ON YOUR SYSTEM ==

Definitely some macro would be handy. If it was up to me, I wouldn't provide 
separate lists for missing and met runtime dependencies.

As a packager I'm only concerned what runtime dependencies are needed, and not 
what's actually installed in my build box.

With that mind, runtime-only dependency handling could be simplified to: (see 
attachment):

macro_log_runtime_dependency("FOO" "File Ownership Obstuctor" "http://foo.org" 
TRUE "" "Sophisticated file ownership obstructor. Required by KIO.")

Will produce following output:

-----------------------------------------------------------------------------
-- The following RUNTIME-ONLY dependencies may be needed.
-- Consider installing them to enable more features from this software.
-----------------------------------------------------------------------------
   * FOO  <http://foo.org> REQUIRED
     File Ownership Obstuctor
     Sophisticated file ownership obstructor. Required by KIO.

-- 
regards
MM

["macro_log_runtime_dependency.diff" (text/x-patch)]

Index: cmake/modules/MacroLogFeature.cmake
===================================================================
--- cmake/modules/MacroLogFeature.cmake	(revision 1167465)
+++ cmake/modules/MacroLogFeature.cmake	(working copy)
@@ -45,9 +45,14 @@
    SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
    IF (EXISTS ${_file})
       FILE(REMOVE ${_file})
-  ENDIF (EXISTS ${_file})
+   ENDIF (EXISTS ${_file})
 
-  SET(_macroLogFeatureAlreadyIncluded TRUE)
+   SET(_file ${CMAKE_BINARY_DIR}/RuntimeDependencies.txt)
+   IF (EXISTS ${_file})
+      FILE(REMOVE ${_file})
+   ENDIF (EXISTS ${_file})
+
+   SET(_macroLogFeatureAlreadyIncluded TRUE)
 ENDIF (NOT _macroLogFeatureAlreadyIncluded)
 
 
@@ -56,7 +61,7 @@
    STRING(TOUPPER "${ARGV4}" _required)
    SET(_minvers "${ARGV5}")
    SET(_comments "${ARGV6}")
-   
+
    IF (${_var})
      SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
    ELSE (${_var})
@@ -88,19 +93,47 @@
    ENDIF (NOT ${_var})
 
    FILE(APPEND "${_LOGFILENAME}" "${_logtext}\n")
- 
+
 ENDMACRO(MACRO_LOG_FEATURE)
 
 
+MACRO(MACRO_LOG_RUNTIME_DEPENDENCY _package _description _url ) # _required _minvers \
_comments) +
+   STRING(TOUPPER "${ARGV3}" _required)
+   SET(_minvers "${ARGV4}")
+   SET(_comments "${ARGV5}")
+   SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/RuntimeDependencies.txt)
+
+   SET(_logtext "   * ${_package}")
+   IF (${_minvers} MATCHES ".*")
+      SET(_logtext "${_logtext} (${_minvers} or higher)")
+   ENDIF (${_minvers} MATCHES ".*")
+   SET(_logtext "${_logtext}  <${_url}>")
+   IF ("${_required}" STREQUAL "TRUE")
+      SET(_logtext "${_logtext} REQUIRED")
+   ELSE ("${_required}" STREQUAL "TRUE")
+      SET(_logtext "${_logtext} OPTIONAL")
+   ENDIF ("${_required}" STREQUAL "TRUE")
+   SET(_logtext "${_logtext}\n     ${_description}")
+   IF (${_comments} MATCHES ".*")
+      SET(_logtext "${_logtext}\n     ${_comments}")
+   ENDIF (${_comments} MATCHES ".*")
+
+   FILE(APPEND "${_LOGFILENAME}" "${_logtext}\n")
+
+ENDMACRO(MACRO_LOG_RUNTIME_DEPENDENCY)
+
+
 MACRO(MACRO_DISPLAY_FEATURE_LOG)
 
    SET(_missingFile ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
    SET(_enabledFile ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
    SET(_disabledFile ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
+   SET(_runtimeFile ${CMAKE_BINARY_DIR}/RuntimeDependencies.txt)
 
-   IF (EXISTS ${_missingFile} OR EXISTS ${_enabledFile} OR EXISTS ${_disabledFile})
+   IF (EXISTS ${_missingFile} OR EXISTS ${_enabledFile} OR EXISTS ${_disabledFile} \
OR EXISTS ${_runtimeFile})  SET(_printSummary TRUE)
-   ENDIF (EXISTS ${_missingFile} OR EXISTS ${_enabledFile} OR EXISTS \
${_disabledFile}) +   ENDIF (EXISTS ${_missingFile} OR EXISTS ${_enabledFile} OR \
EXISTS ${_disabledFile} OR EXISTS ${_runtimeFile})  
    IF(_printSummary)
      SET(_missingDeps 0)
@@ -133,6 +166,13 @@
      ENDIF (NOT ${_missingDeps})
 
 
+     IF (EXISTS ${_runtimeFile})
+       FILE(READ ${_runtimeFile} _runtime)
+       SET(_summary \
"${_summary}\n-----------------------------------------------------------------------------\n-- \
The following RUNTIME-ONLY dependencies may be needed.\n-- Consider installing them \
to enable more features from this \
software.\n-----------------------------------------------------------------------------\n${_runtime}")
 +       FILE(REMOVE ${_runtimeFile})
+     ENDIF (EXISTS ${_runtimeFile})
+
+
      MESSAGE(${_summary})
      MESSAGE("-----------------------------------------------------------------------------\n")
  


["signature.asc" (application/pgp-signature)]

_______________________________________________
Kde-buildsystem mailing list
Kde-buildsystem@kde.org
https://mail.kde.org/mailman/listinfo/kde-buildsystem


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic