From 02c616cbb08915fe2804c75259ddf449ab8c1792 Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Sat, 5 Aug 2017 23:10:57 -0400 Subject: [PATCH] Reduce importance of qtdir option, default to ''. The qtdir setting took on much less importance with Qt 5. We've never officially supported building Qt 5 with kdesrc-build, and qmake and cmake both use qmake or similar Qt-provided config information to find Qt, rather than using the unsupported QTDIR environment variable. As a result, default the value to an empty string (interpreted as use of system Qt) and stop adding it automatically to the environment variables defined during the build. If set, it will continue to be used for now. This also helps the environment setup driver detect when it should look for the system Qt5 qmake. --- doc/index.docbook | 7 ++----- kdesrc-build-setup | 6 +++--- kdesrc-buildrc-kf5-sample | 3 ++- kdesrc-buildrc-sample | 6 ++---- modules/ksb/Application.pm | 2 +- modules/ksb/BuildContext.pm | 2 +- modules/ksb/BuildSystem/Qt4.pm | 6 ++++++ modules/ksb/Module.pm | 22 +++++++--------------- 8 files changed, 24 insertions(+), 30 deletions(-) diff --git a/doc/index.docbook b/doc/index.docbook index 85516c3..8ecf0cc 100644 --- a/doc/index.docbook +++ b/doc/index.docbook @@ -2450,11 +2450,8 @@ installs the module. qtdir Module setting overrides global Set this option to set the environment variable QTDIR while building. -You cannot override this setting in a module option. If you do not specify -this option, it defaults to -${source-dir}/build/qt, -which uses the qt module included in the &kde; source repository. -You may use a tilde (~) to represent your home directory. +If you do not specify this option, &kdesrc-build; will assume that &Qt; is +provided by the operating system. diff --git a/kdesrc-build-setup b/kdesrc-build-setup index 5c437a3..4797a19 100755 --- a/kdesrc-build-setup +++ b/kdesrc-build-setup @@ -324,9 +324,9 @@ print $output < # remaining whitespace and closing bracket } { - $ctx->getOption($1, 'module') || + $ctx->getOption($1, 'module') // croak_runtime("Invalid variable $1") }gxe; # Replace all matching expressions, use extended regexp w/ diff --git a/modules/ksb/BuildContext.pm b/modules/ksb/BuildContext.pm index 3e2c3aa..7634043 100644 --- a/modules/ksb/BuildContext.pm +++ b/modules/ksb/BuildContext.pm @@ -112,7 +112,7 @@ our %defaultGlobalOptions = ( "override-build-system"=> "", "override-url" => "", "persistent-data-file" => "", - "qtdir" => "$ENV{HOME}/qt4", + "qtdir" => "", "remove-after-install" => "none", # { none, builddir, all } "source-dir" => "$ENV{HOME}/kdesrc", "svn-server" => "svn://anonsvn.kde.org/home/kde", diff --git a/modules/ksb/BuildSystem/Qt4.pm b/modules/ksb/BuildSystem/Qt4.pm index 5bc5e89..fe3984a 100644 --- a/modules/ksb/BuildSystem/Qt4.pm +++ b/modules/ksb/BuildSystem/Qt4.pm @@ -49,6 +49,12 @@ sub configureInternal my $prefix = $module->getOption('qtdir'); + if (!$prefix) + { + error ("\tThe b[qtdir] option must be set to determine where to install r[b[$module]"); + return 0; + } + # Some users have added -prefix manually to their flags, they # probably shouldn't anymore. :) diff --git a/modules/ksb/Module.pm b/modules/ksb/Module.pm index ce3975b..d6aa249 100644 --- a/modules/ksb/Module.pm +++ b/modules/ksb/Module.pm @@ -647,31 +647,23 @@ sub setupEnvironment my $self = assert_isa(shift, 'ksb::Module'); my $ctx = $self->buildContext(); my $kdedir = $self->getOption('kdedir'); - my $qtdir = $self->getOption('qtdir'); my $prefix = $self->installationPath(); - # Add global set-envs + # Add global set-envs and context $self->buildContext()->applyUserEnvironment(); - # Add some standard directories for pkg-config support. Include env settings. - my @pkg_config_dirs = ("$kdedir/lib/pkgconfig", "$qtdir/lib/pkgconfig"); + my @pkg_config_dirs = ("$kdedir/lib/pkgconfig"); $ctx->prependEnvironmentValue('PKG_CONFIG_PATH', @pkg_config_dirs); - # Likewise, add standard directories that should be in LD_LIBRARY_PATH. - my @ld_dirs = ("$kdedir/lib", "$qtdir/lib", $self->getOption('libpath')); + my @ld_dirs = ("$kdedir/lib", $self->getOption('libpath')); $ctx->prependEnvironmentValue('LD_LIBRARY_PATH', @ld_dirs); - my $buildSystem = $self->buildSystem(); - $buildSystem->prepareModuleBuildEnvironment($ctx, $self, $prefix); - - my @path = ("$kdedir/bin", "$qtdir/bin", $self->getOption('binpath')); + my @path = ("$kdedir/bin", $self->getOption('binpath')); $ctx->prependEnvironmentValue('PATH', @path); - # Set up the children's environment. We use queueEnvironmentVariable since - # it won't set an environment variable to nothing. (e.g, setting QTDIR to - # a blank string might confuse Qt or KDE. - - $ctx->queueEnvironmentVariable('QTDIR', $qtdir); + # Build system's environment injection + my $buildSystem = $self->buildSystem(); + $buildSystem->prepareModuleBuildEnvironment($ctx, $self, $prefix); # Read in user environment defines $self->applyUserEnvironment() unless $self == $ctx;