From 524f966a1695741536652f5f264e98ffb4917b9d Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Thu, 7 Aug 2014 22:32:51 -0400 Subject: [PATCH] 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. ;) --- kdesrc-buildrc-kf5-sample | 36 ++++++++++++++++++++++++++++++ modules/ksb/BuildContext.pm | 44 +++++++++++++++++++++++++------------ 2 files changed, 66 insertions(+), 14 deletions(-) create mode 100644 kdesrc-buildrc-kf5-sample diff --git a/kdesrc-buildrc-kf5-sample b/kdesrc-buildrc-kf5-sample new file mode 100644 index 0000000..0a240c9 --- /dev/null +++ b/kdesrc-buildrc-kf5-sample @@ -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 \ No newline at end of file diff --git a/modules/ksb/BuildContext.pm b/modules/ksb/BuildContext.pm index b35c1a4..3235cbf 100644 --- a/modules/ksb/BuildContext.pm +++ b/modules/ksb/BuildContext.pm @@ -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 (<{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