Require a configuration file.

Right now kdesrc-build will default to kdesrc-buildrc-sample if no
configuration file is present, but that won't be appropriate now that
KF5 is out. Make the user make a choice instead.

The various READMEs and help texts would probably need to be updated to
match, if anyone wants to help. ;)
wilder
Michael Pyne 12 years ago
parent b52cd419ff
commit 524f966a16
  1. 36
      kdesrc-buildrc-kf5-sample
  2. 44
      modules/ksb/BuildContext.pm

@ -0,0 +1,36 @@
# This is a sample kdesrc-build configuration file appropriate for KDE
# Frameworks 5-based build environments.
#
# See the kdesrc-buildrc-sample for explanations of what the options do, or
# view the manpage or kdesrc-build documentation at
# http://kdesrc-build.kde.org/documentation/
global
branch-group kf5-qt5
kdedir ~/kde-5 # Where to install KF5-based software
qtdir /usr # Where to find Qt5
# Where to download source code. By default the build directory and
# logs will be kept under this directory as well.
source-dir ~/kdesrc
end global
# Instead of specifying modules here, the current best practice is to refer to
# KF5 module lists maintained with kdesrc-build by the KF5 developers. As new
# modules are added or modified, the kdesrc-build KF5 module list is altered to
# suit, and when you update kdesrc-build you will automatically pick up the
# needed changes.
# NOTE: You MUST change the path below to include the actual path to your
# kdesrc-build installation.
include /path/to/kdesrc-build/kf5-qt5-build-include
# If you wish to maintain the module list yourself that is possible, simply
# look at the files pointed to above and use the "module-set" declarations that
# they use, with your own changes.
# It is possible to change the options for modules loaded from the file
# included above (since it's not possible to add a module that's already been
# included), e.g.
options kcoreaddons
# make-options -j4
end options

@ -529,8 +529,6 @@ sub setRcFile
#
# If unable to find or open the rc file an exception is raised. Empty rc
# files are supported however.
#
# TODO: Support a fallback default rc file.
sub loadRcFile
{
my $self = shift;
@ -566,21 +564,39 @@ EOM
croak_runtime("Missing $failedFile");
}
# Set rcfile to something so the user knows what file to edit to
# get what they want to work.
# If no configuration but no --rc-file option was used, warn the user
# and fail, as there are too many possible modes of using kdesrc-build
# for kdesrc-buildrc-sample to be appropriate.
error (<<EOM);
b[No configuration file is present.]
kdesrc-build requires a configuration file to select which KDE software modules
to build, what options to build them with, the path to install to, etc.
kdesrc-build looks for its configuration in the file `kdesrc-buildrc' in
whatever directory kdesrc-build is run from.
# Our default is to use a kdesrc-buildrc-sample if present in the same
# directory.
my $basePath = dirname($0);
my $sampleConfigFile = "$basePath/kdesrc-buildrc-sample";
open ($fh, '<', $sampleConfigFile)
or croak_runtime("No configuration available");
If no such file exists, kdesrc-build tries to use `~/.kdesrc-buildrc' (note the
leading `.')
$self->{rcFile} = $sampleConfigFile;
$self->{rcFile} =~ s,^$ENV{HOME}/,~/,;
note (" * Using included sample configuration.");
A sample configuration suitable for KDE 4 software is included at the file
`kdesrc-buildrc-sample' which can be copied to the correct location and then
edited.
return $fh;
KDE Frameworks 5 users can use the `kdesrc-buildrc-kf5-sample' file which can
be copied to the correct location and then edited.
In either case b[once the configuration file is setup to your liking], you
should run:
b[kdesrc-build --metadata-only]
to download needed information about the KDE source repositories and then:
b[kdesrc-build --pretend]
to preview what kdesrc-build will do.
EOM
croak_runtime("No configuration available");
}
# Returns the base directory that holds the configuration file. This is

Loading…
Cancel
Save