Skip to content

SPECS: kf6-kfilemetadata: Align optional dependency handling#502

Open
Jingwiw wants to merge 3 commits into
openRuyi-Project:mainfrom
Jingwiw:cleanup-bcond/kfilemetadata-ffmpeg-option
Open

SPECS: kf6-kfilemetadata: Align optional dependency handling#502
Jingwiw wants to merge 3 commits into
openRuyi-Project:mainfrom
Jingwiw:cleanup-bcond/kfilemetadata-ffmpeg-option

Conversation

@Jingwiw
Copy link
Copy Markdown
Member

@Jingwiw Jingwiw commented May 23, 2026

Changes

  • Make --without ffmpeg actually disable FFmpeg discovery in CMake.

    The spec already has %bcond ffmpeg 1. When the bcond is disabled, passing CMAKE_DISABLE_FIND_PACKAGE_FFmpeg=ON prevents CMake from picking FFmpeg up from the buildroot anyway.

    Source: CMakeLists.txt

    find_package(FFmpeg 57.48 COMPONENTS AVCODEC)
    if (AVCODEC_FOUND)
        find_package(FFmpeg 57.40 COMPONENTS AVFORMAT)
        if (AVFORMAT_FOUND)
            find_package(FFmpeg 55.27 COMPONENTS AVUTIL)
        endif()
    endif()
    set_package_properties(FFmpeg PROPERTIES DESCRIPTION "Video Tag reader"
                           URL "https://ffmpeg.org/" TYPE OPTIONAL
                           PURPOSE "Support for video metadata")
  • Use pkgconfig(libattr) for xattr support.

    kfilemetadata requires xattr support on Linux and looks for the libattr header/library pair.

    Source: CMakeLists.txt

    if ( CMAKE_SYSTEM_NAME MATCHES "Linux" )
        find_package(Xattr)
        set_package_properties(Xattr PROPERTIES DESCRIPTION "library libattr "
            URL "https://savannah.nongnu.org/projects/attr"
            TYPE REQUIRED
            PURPOSE "Extended attribute shared library")
    endif()

    Source: FindXattr.cmake

    find_path(XATTR_INCLUDE sys/xattr.h
        /usr/include
        /usr/local/include
        ${CMAKE_INCLUDE_PATH}
        ${CMAKE_INSTALL_PREFIX}/usr/include
    )
    
    find_library(XATTR_LIB NAMES attr libattr
        PATHS
            ${CMAKE_LIBRARY_PATH}
            ${CMAKE_INSTALL_PREFIX}/lib
    )
  • Use ebook-tools-devel for EPub support.

    The EPub finder checks for libepub and epub.h; those are development files, so the build dependency should be the devel package rather than the runtime tools package.

    Source: CMakeLists.txt

    find_package(EPub)
    set_package_properties(EPub PROPERTIES DESCRIPTION "Ebook epub reader"
                           URL "https://sourceforge.net/projects/ebook-tools/" TYPE OPTIONAL
                           PURPOSE "Support for epub metadata")

    Source: FindEPub.cmake

    find_library (EPUB_LIBRARIES
      NAMES epub libepub
    )
    
    find_path (EPUB_INCLUDE_DIR
      NAMES epub.h
    )
    
    include (FindPackageHandleStandardArgs)
    find_package_handle_standard_args (EPub DEFAULT_MSG EPUB_LIBRARIES EPUB_INCLUDE_DIR)
  • Use pkgconfig(exiv2) for Exiv2.

    The local CMake finder consumes the Exiv2 pkg-config result as hints for header and library lookup, so the pkgconfig dependency is the direct provider interface.

    Source: FindLibExiv2.cmake from the kfilemetadata build dependency stack

    find_path(LibExiv2_INCLUDE_DIRS NAMES exiv2/exif.hpp
        HINTS ${PC_EXIV2_INCLUDEDIR}
    )
    
    find_library(LibExiv2_LIBRARIES NAMES exiv2 libexiv2
        HINTS ${PC_EXIV2_LIBRARY_DIRS}
    )

AIGC Declaration: CodeX with gpt5.5 was used as coding agent.

Signed-off-by: Jingwiw wangjingwei@iscas.ac.cn

Jingwiw added 3 commits May 22, 2026 17:35
Signed-off-by: Jingwiw <wangjingwei@iscas.ac.cn>
Signed-off-by: Jingwiw <wangjingwei@iscas.ac.cn>
Signed-off-by: Jingwiw <wangjingwei@iscas.ac.cn>
@openruyi-bot openruyi-bot Bot added BuildSystem: cmake Issue/PR related to cmake BuildSystem. Target: Rolling Targeting rolling/current branch. Workflow: Ready For Review Ready for review by anyone with domain expertise. labels May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BuildSystem: cmake Issue/PR related to cmake BuildSystem. Target: Rolling Targeting rolling/current branch. Workflow: Ready For Review Ready for review by anyone with domain expertise.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant