GithubHelp home page GithubHelp logo

winterz / kdesrc-build Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kde/kdesrc-build

0.0 0.0 0.0 2.85 MB

A script to build KDE software from KDE's source repositories.

License: Other

CMake 0.89% Perl 96.58% Shell 1.16% Vim Script 1.37%

kdesrc-build's Introduction

kdesrc-build

This script streamlines the process of setting up and maintaining a development environment for KDE software.

It does this by automating the process of downloading source code from the KDE source code repositories, building that source code, and installing it to your local system.

Note the Alternatives

NOTICE!

If you are a power user just trying to test the latest KDE releases like KDE Plasma 5 or the KDE Applications then there are potentially easier options you may wish to consider first. KDE provides a quick-starter distribution, KDE neon Developer Edition, and your favorite distribution may also have bleeding edge packages that may be easier to try out.

However if you're testing out the latest KDE Frameworks or are involved in development yourself, you'll probably find it easiest to use kdesrc-build. Continue on, to learn how to set it up.

QUICK HOWTO

  1. Set up minimum dependencies
  • You must have at least Perl version 5.14 installed. Most distributions include at least a minimal Perl set up, and Perl is also required for some portions of Qt and KDE software builds so it is good to have regardless.

  • You must have Git installed to download KDE sources and kdesrc-build itself. We recommend at least version 2.10.

  1. Install kdesrc-build:
  • Clone kdesrc-build from git, by running from a terminal:
$ mkdir -p ~/kde/src
$ cd ~/kde/src
$ git clone https://anongit.kde.org/kdesrc-build
$ cd kdesrc-build # kdesrc-build is in this directory
  • Make sure it works by running:
$ cd ~/kde/src/kdesrc-build
$ ./kdesrc-build --version

You should see output similar to kdesrc-build 18.10 (v18.10-20-g1c39943). Later we will set up kdesrc-build to keep itself updated automatically.

  1. Set up kdesrc-build:
  • Now that kdesrc-build is installed and works, you need to set up kdesrc-build to work appropriately on your particular system. Do this by running the provided set up script to generate the configuration file (~/.kdesrc-buildrc):
$ cd ~/kde/src/kdesrc-build
$ ./kdesrc-build-setup
  • Answer the questions given, but do not fret if you don't know what exactly you want to build, it is easy to edit the configuration later or just to re-run kdesrc-build-setup again.

  • This script will reference a standard configuration provided as part of the kdesrc-build repository that you downloaded earlier. As kdesrc-build self-updates, these changes will reflect for your configuration as well.

  1. Download the KDE project and dependency data:
$ cd ~/kde/src/kdesrc-build
$ ./kdesrc-build --metadata-only

This will download information describing the KDE source repositories and their dependencies, which will help kdesrc-build figure out what to build.

kdesrc-build will maintain this automatically, but running this step separately helps to verify that kdesrc-build can properly reach the KDE source repository and allows the --pretend option in the next step to provide more accurate output.

  1. Verify kdesrc-build has a good build plan:
$ cd ~/kde/src/kdesrc-build
$ ./kdesrc-build --pretend

This will have kdesrc-build go through the steps that it would perform, but without actually doing them. kdesrc-build will do some basic pre-checks in this stage to ensure that required command-line commands are available, including cmake, git, qmake, and others.

This is the last good chance to make sure that kdesrc-build is set the way you want it. If this command gives you a message that all modules were successfully built, you can move onto the next step.

  1. Perform your first build:
$ cd ~/kde/src/kdesrc-build
$ ./kdesrc-build --stop-on-failure dolphin

This will build Dolphin, the Plasma 5 file manager and its KDE-based dependencies. We choose Dolphin since it is a good test case to exercise the whole build process.

For each module built, kdesrc-build will complete these steps:

  • Update source code (initial download or later update)
  • Set up the build system and configure source code with your options, if needed
  • Perform the build, if needed
  • Install the module

The --stop-on-failure flag causes kdesrc-build to stop the first time a module fails to build, in case there are missing dependencies. If not set, kdesrc-build would otherwise try to build all the modules even if some fail.

Hopefully everything will go well the first time, and kdesrc-build will be able to download and build all of the modules that you ask for. :)

UPGRADING KDESRC-BUILD

Upgrading is simple.

You can delete your old kdesrc-build directory (make sure you don't have any local changes in there first, or your kdesrc-buildrc file!) and then install the new version where the old kdesrc-build directory used to be.

In fact, it is recommended to use git to update kdesrc-build itself, so that kdesrc-build updates itself automatically when run. This is set up already in the sample configuration for KF5, where kdesrc-build is configured to update itself.

One thing to keep in mind when using kdesrc-build to manage keeping itself up to date is that updates won't take effect until the next time you run kdesrc-build.

You may want to edit your ~/.kdesrc-buildrc to make sure any new options are included. You should always read the changes for the new version however, as sometimes there are slight changes in behavior necessary to adapt to updates in the source repository. If you are running kdesrc-build from its git repository, you can use the "git log" command from inside the kdesrc-build source directory to see the latest changes.

You can use the ./kdesrc-build --version command to ensure that you have successfully upgraded kdesrc-build.

SAMPLE CONFIGURATION

A sample configuration file is included for demonstration purposes. You could copy it to your ~/.kdesrc-buildrc and edit, but you should use the provided kdesrc-build-setup script instead.

HELP!!!

This is only a very cursory guide. For more information please see the KDE Community Get Involved for Development page.

REFERENCE

kdesrc-build includes a limited command-line description with the --help option.

You can read the kdesrc-build handbook online.

Once you've set up a KDE development environment, kdesrc-build itself can generate and build documentation (a handbook and a man page).

The handbook would be available in KHelpCenter (help:/kdesrc-build), while the man page would be available in the KDE man pages or in the kdesrc-build build directory:

$ cd ~/kde/build/kdesrc-build/doc
$ man ./kdesrc-build.1

You can also ask for help online on the #kde-devel channel of IRC (irc.kde.org).

Additionally you can ask for help on the KDE support mailing lists, such as [email protected]

Finally you can drop me an email at [email protected] (although I have a job/family and therefore don't always have time to respond)

Behind the Curtain

For each build, kdesrc-build does several things:

  • Finds the configuration file (based on the --rc-file option or by looking for kdesrc-buildrc in the current directory and falling back to ~/.kdesrc-buildrc)
  • Reads the configuration file to generate:
    • Default options to apply for each module
    • A list of modules to build. Modules can be grouped in "module-sets", but kdesrc-build converts each set to a list of modules.
  • Reduces the module list to modules chosen on the command line (either by name or through options like --resume-from).
  • For modules known to be KDE repositories (derived from a module-set using the special kde-projects repository):
    • If --include-dependencies is enabled, adds needed KDE modules into the build, then
    • Reorders KDE modules with respect to each other to ensure they are built in dependency order.
  • Builds each module in the resulting list of modules. This is broken into "phases", and each phase's output is logged to a specific directory for inspection later (by default, ~/kde/src/log).

kdesrc-build takes some pains to do perform source code updates and builds in the way that a developer really would at the command line, using the same git, cmake, make commands a user would. This means that users are free to explore the source directory and build directory for a module without trampling on additional data maintained by kdesrc-build: kdesrc-build does nothing special in either the source or build directories.

Important Command Line Options

These options are the most useful. Others are documented at the kdesrc-build online handbook.

option Description
--include-dependencies Adds any missing modules that are needed for the modules being built. Only works for KDE modules.
--pretend Lists the actions kdesrc-build would take but doesn't actually do them. Useful for a double-check before a long build.
--resume-from Starts the build from the given module instead of building all modules. Can combine with --stop-after or --stop-before.
--resume-after Starts the build from after the given module, otherwise same as --resume-from.
--stop-before Stops the build just before the given module instead of building all modules. Can combine with --resume-from or --resume-after.
--stop-after Stops the build just after the given module, otherwise the same as --stop-before.
--no-src Perform module builds as normal but don't try to update source directories. Use this when you've updated source codes yourself.
--refresh-build Completely cleans under the module build directories before building. Takes more time but can help recover from a broken build directory set up.

Cleaning the build and install directories

kdesrc-build will if possible avoid regenerating the build system and avoid complete rebuilds of existing modules. This avoids wasting significant amounts of time rebuilding source codes that have not changed, as all supported build systems are smart enough to rebuild when necessary.

However it can sometimes happen that a rebuild is needed but wasn't detected. If this happens you can force a build directory to be fully rebuilt using the --refresh-build option to kdesrc-build.

If all else fails and your development environment which was working fine now can't seem to upgrade modules anymore, another option is to consider deleting the install directory (~/kde/usr by default) completely and rebuilding everything (using --refresh-build), but this can take a significant amount of time!

CONTACT INFO

If you find a bug, please report it at the KDE Bugzilla

If you have any questions, please let me know: Michael Pyne [email protected]

kdesrc-build's People

Contributors

afiestas avatar bhush9 avatar cmacq2 avatar coolo avatar cordlandwehr avatar danvratil avatar davidedmundson avatar dfaure avatar eikehein avatar ivan-cukic avatar jpwhiting avatar jriddell avatar kossebau avatar lueck-b avatar mck182 avatar mgraesslin avatar milianw avatar montel avatar nowrep avatar purinchu avatar rakuco avatar randomguy3 avatar spstarr avatar tcanabrava avatar tchollingsworth avatar tosky avatar vhanda avatar winterz avatar woebbeking avatar yurchor avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.