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.
wilder
Michael Pyne 9 years ago
parent 613b973e0e
commit 02c616cbb0
  1. 7
      doc/index.docbook
  2. 6
      kdesrc-build-setup
  3. 3
      kdesrc-buildrc-kf5-sample
  4. 6
      kdesrc-buildrc-sample
  5. 2
      modules/ksb/Application.pm
  6. 2
      modules/ksb/BuildContext.pm
  7. 6
      modules/ksb/BuildSystem/Qt4.pm
  8. 22
      modules/ksb/Module.pm

@ -2450,11 +2450,8 @@ installs the module.
<entry>qtdir</entry> <entry>qtdir</entry>
<entry>Module setting overrides global</entry> <entry>Module setting overrides global</entry>
<entry>Set this option to set the environment variable <envar>QTDIR</envar> while building. <entry>Set this option to set the environment variable <envar>QTDIR</envar> while building.
You cannot override this setting in a module option. If you do not specify If you do not specify this option, &kdesrc-build; will assume that &Qt; is
this option, it defaults to provided by the operating system.
<filename class="directory"><symbol>${source-dir}</symbol>/build/qt</filename>,
which uses the qt module included in the &kde; source repository.
You may use a tilde (~) to represent your home directory.
</entry> </entry>
</row> </row>

@ -324,9 +324,9 @@ print $output <<EOF;
# once. 'kf5-qt5' is the latest KF5 and Qt5-based software. # once. 'kf5-qt5' is the latest KF5 and Qt5-based software.
branch-group kf5-qt5 branch-group kf5-qt5
# The path to your Qt installation. # The path to your Qt installation (default is empty, assumes Qt provided
qtdir ~/qt5 # by system)
# qtdir /usr # If system Qt # qtdir ~/qt5
# Install directory for KDE software # Install directory for KDE software
kdedir $installDir kdedir $installDir

@ -7,7 +7,8 @@
global global
branch-group kf5-qt5 branch-group kf5-qt5
kdedir ~/kde-5 # Where to install KF5-based software kdedir ~/kde-5 # Where to install KF5-based software
qtdir /usr # Where to find Qt5 # Uncomment this and edit value to choose a different Qt5
# qtdir /usr # Where to find Qt5
# Where to download source code. By default the build directory and # Where to download source code. By default the build directory and
# logs will be kept under this directory as well. # logs will be kept under this directory as well.

@ -24,10 +24,8 @@ global
# #
# This is the Qt installation to use for building/using KDE. The default is # This is the Qt installation to use for building/using KDE. The default is
# to build Qt (see the qt module below). If you wish to use your system's # to build Qt (see the qt module below). If you wish to use your system's
# installed Qt (assuming it is recent enough!) then you can set this to the # installed Qt (assuming it is recent enough!) then you can leave this unset.
# path to your Qt installation. To find the path to your system's Qt, run # qtdir ~/qt4 # Default to installing Qt
# "qmake -v". Qt will be installed to the path reported (do not include /lib)
qtdir ~/qt4 # Default to installing Qt
# By default, each source code module is checked out from its latest # By default, each source code module is checked out from its latest
# development version ('master' for git, 'trunk' for subversion). # development version ('master' for git, 'trunk' for subversion).

@ -2260,7 +2260,7 @@ sub _installTemplatedFile
\s*%> # remaining whitespace and closing bracket \s*%> # remaining whitespace and closing bracket
} }
{ {
$ctx->getOption($1, 'module') || $ctx->getOption($1, 'module') //
croak_runtime("Invalid variable $1") croak_runtime("Invalid variable $1")
}gxe; }gxe;
# Replace all matching expressions, use extended regexp w/ # Replace all matching expressions, use extended regexp w/

@ -112,7 +112,7 @@ our %defaultGlobalOptions = (
"override-build-system"=> "", "override-build-system"=> "",
"override-url" => "", "override-url" => "",
"persistent-data-file" => "", "persistent-data-file" => "",
"qtdir" => "$ENV{HOME}/qt4", "qtdir" => "",
"remove-after-install" => "none", # { none, builddir, all } "remove-after-install" => "none", # { none, builddir, all }
"source-dir" => "$ENV{HOME}/kdesrc", "source-dir" => "$ENV{HOME}/kdesrc",
"svn-server" => "svn://anonsvn.kde.org/home/kde", "svn-server" => "svn://anonsvn.kde.org/home/kde",

@ -49,6 +49,12 @@ sub configureInternal
my $prefix = $module->getOption('qtdir'); 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 # Some users have added -prefix manually to their flags, they
# probably shouldn't anymore. :) # probably shouldn't anymore. :)

@ -647,31 +647,23 @@ sub setupEnvironment
my $self = assert_isa(shift, 'ksb::Module'); my $self = assert_isa(shift, 'ksb::Module');
my $ctx = $self->buildContext(); my $ctx = $self->buildContext();
my $kdedir = $self->getOption('kdedir'); my $kdedir = $self->getOption('kdedir');
my $qtdir = $self->getOption('qtdir');
my $prefix = $self->installationPath(); my $prefix = $self->installationPath();
# Add global set-envs # Add global set-envs and context
$self->buildContext()->applyUserEnvironment(); $self->buildContext()->applyUserEnvironment();
# Add some standard directories for pkg-config support. Include env settings. my @pkg_config_dirs = ("$kdedir/lib/pkgconfig");
my @pkg_config_dirs = ("$kdedir/lib/pkgconfig", "$qtdir/lib/pkgconfig");
$ctx->prependEnvironmentValue('PKG_CONFIG_PATH', @pkg_config_dirs); $ctx->prependEnvironmentValue('PKG_CONFIG_PATH', @pkg_config_dirs);
# Likewise, add standard directories that should be in LD_LIBRARY_PATH. my @ld_dirs = ("$kdedir/lib", $self->getOption('libpath'));
my @ld_dirs = ("$kdedir/lib", "$qtdir/lib", $self->getOption('libpath'));
$ctx->prependEnvironmentValue('LD_LIBRARY_PATH', @ld_dirs); $ctx->prependEnvironmentValue('LD_LIBRARY_PATH', @ld_dirs);
my $buildSystem = $self->buildSystem(); my @path = ("$kdedir/bin", $self->getOption('binpath'));
$buildSystem->prepareModuleBuildEnvironment($ctx, $self, $prefix);
my @path = ("$kdedir/bin", "$qtdir/bin", $self->getOption('binpath'));
$ctx->prependEnvironmentValue('PATH', @path); $ctx->prependEnvironmentValue('PATH', @path);
# Set up the children's environment. We use queueEnvironmentVariable since # Build system's environment injection
# it won't set an environment variable to nothing. (e.g, setting QTDIR to my $buildSystem = $self->buildSystem();
# a blank string might confuse Qt or KDE. $buildSystem->prepareModuleBuildEnvironment($ctx, $self, $prefix);
$ctx->queueEnvironmentVariable('QTDIR', $qtdir);
# Read in user environment defines # Read in user environment defines
$self->applyUserEnvironment() unless $self == $ctx; $self->applyUserEnvironment() unless $self == $ctx;

Loading…
Cancel
Save