How to use the local appstream or other module while building application such as Discover by kdesrc-build?

My debian system can not access the websit of github due to network limited. when I use kdesrc-build to build Discovery ,It unable to perform git fetch appstream from GitHub - ximion/appstream: Tools and libraries to work with AppStream metadata .
as bellow:

Error updating appstream, removing from list of packages to build.
 > Unable to perform git fetch for origin (https://github.com/ximion/appstream)
Error updating packagekit-qt, removing from list of packages to build.
 > Unable to perform git fetch for origin (https://github.com/PackageKit/PackageKit-Qt.git)

So if I can use the local appstream that downloaded by other computer and transfer to mine ?

You could try to build discover without its dependencies with kdesrc-build --noinclude-dependencies discover

But it’s probably a better idea to fix your issue with github.

If you ignore building appstream with kdesrc-build --ignore-module appstream and simply install appstream from your distribution (probably libappstream-dev), Discover will use it instead.

Now downloading the source code, building it and adding it to kdesrc-build is a different process and a bit more involved and requires editing the kdesrc-buildrc configuration file.

2 Likes
kdesrc-build --noinclude-dependencies discover
Fetching remote changes to sysadmin-repo-metadata
Merging sysadmin-repo-metadata changes from branch master
Holding performance profile

Building discover from kf6-workspace-modules (1/1)
        Fetching remote changes to discover
        Merging discover changes from branch master
        Source update complete for discover: 1 file affected.
        Preparing build system for discover.
        Removing files in build directory for discover
        Old build system cleaned, starting new build system.
        Running cmake targeting Kate - Ninja...
        Unable to configure discover with KDE CMake

discover didn't build, stopping here.

<<<  PACKAGES FAILED TO BUILD  >>>
discover - file:///home/fengq/kde/src/log/2023-10-26-01/discover/cmake.log :

 # kdesrc-build running: 'cmake' '-B' '.' '-S' '/home/fengq/kde/src/discover' '-G' 'Kate - Ninja' '-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON' '-DCMAKE_BUILD_TYPE=RelWithDebInfo' '-DBUILD_WITH_QT6=ON' '-DBUILD_QT5=OFF' '-DCMAKE_CXX_FLAGS:STRING=-pipe' '-DCMAKE_INSTALL_PREFIX=/home/fengq/kde/usr'
Installing in /home/fengq/kde/usr. Run /home/fengq/KDEHOME/discover/prefix.sh to set the environment for discover.
-- Could NOT find KF6Declarative (missing: KF6Declarative_DIR)
-- Could NOT find KF6Declarative: found neither KF6DeclarativeConfig.cmake nor kf6declarative-config.cmake 
-- Could NOT find KF6IdleTime (missing: KF6IdleTime_DIR)
-- Could NOT find KF6IdleTime: found neither KF6IdleTimeConfig.cmake nor kf6idletime-config.cmake 
-- Could NOT find KF6Purpose (missing: KF6Purpose_DIR)
-- Could NOT find KF6Purpose: found neither KF6PurposeConfig.cmake nor kf6purpose-config.cmake 
-- Could NOT find KF6StatusNotifierItem (missing: KF6StatusNotifierItem_DIR)
-- Could NOT find KF6StatusNotifierItem: found neither KF6StatusNotifierItemConfig.cmake nor kf6statusnotifieritem-config.cmake 
CMake Error at /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find KF6 (missing: Declarative IdleTime Purpose
  StatusNotifierItem) (found suitable version "5.240.0", minimum required is
  "5.103.0")
Call Stack (most recent call first):
  /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /home/fengq/kde/usr/share/ECM/find-modules/FindKF6.cmake:93 (find_package_handle_standard_args)
  CMakeLists.txt:30 (find_package)

it show CMake error!

You can’t build it by itself, because it’s on KF6 and no distributions package it yet. You must include dependencies via --include-dependencies.

:rofl:,My network does not have permission to access the github and can not fetch the appstream , so i use the option of --noinclude-dependencies . So it seems that I have to apply for network access at first.
Anyway thanks for your reply.

I just realized the method I specified wouldn’t have worked in your case. I see PackageKit-Qt is one of the projects that are on Github, you’re trying to build Discover with Qt6, and Debian does not ship this library built for Qt6.

Unless you’re willing to change distros or use containers, yeah, the only practical way to proceed is to fix whatever network issue you have with Github.