From 52c914ff1e83bd3a36f4549655ab9fcd1f0a89e7 Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Fri, 6 May 2005 01:46:58 +0000 Subject: [PATCH] Some more colorizing, the extragear/ and playground/ modules should work now, hopefully without breaking what was working before. I've updated the sample config appropriately. svn path=/trunk/kdenonbeta/kdecvs-build/; revision=409917 --- kdesvn-build | 61 +++++++++++++++++++++++++++----------- kdesvn-buildrc-sample | 69 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 106 insertions(+), 24 deletions(-) diff --git a/kdesvn-build b/kdesvn-build index ea3be8a..426c9a8 100755 --- a/kdesvn-build +++ b/kdesvn-build @@ -1340,26 +1340,43 @@ sub checkout_svn_partial_dir my @args; my $kdesvn = get_option ("global", "source-dir"); my $svnroot = get_option ("global", "svn-server"); - my $update_dir; chdir ("$kdesvn/$module"); - $update_dir = "$dir"; - - my $verb = (not -e $update_dir) ? 'Checking out' : 'Updating' ; + my $verb = (not -e $dir) ? 'Checking out' : 'Updating' ; print ("$verb ${GREEN}$module/$dir${NORMAL}.\n"); @args = ('svn'); - push @args, 'up'; + push @args, 'up'; # The base dir is already checked out, so up should always + # work. push @args, '-N' unless $recurse; push @args, $dir; -# push @args, svn_module_url($update_dir); my $fname = $dir; # $dir may itself contain slashes $fname =~ s/\//-/g; return run_svn ($module, $fname, \@args); } +# Subroutine to check if we are building a module from extragear or playground, +# if so, make sure the src directory exists, and cd into it that way the rest +# of the extraction can happen as normal. +# The first parameter is the module to check. +sub check_for_extragear +{ + my $module = shift; + + return if $module !~ /^(extragear|playground)\//; + + my $base = $module; + $base =~ s/\/.*//; # Remove the slash and everything after + + # Fully specify path + $base = get_kdesvn_dir() . "/$base"; + + super_mkdir($base); + chdir($base); # Go to src dir +} + # Subroutine to check out a specific set of directories from a module, # instead of recursively checking out the entire module. # The first parameter is the module to check out. The subroutine will @@ -1381,20 +1398,19 @@ sub checkout_svn_partial chdir ($kdesvn); - # Check if the user explicitly asked for the given subdir on the command line. - # If so, don't automatically add /admin, as that would simply be annoying. - my $suppress_auto_admin = get_option($module, '#suppress-auto-admin'); - - # Check if the user specified the admin subdirectory. If not, - # add it. - push (@dirlist, 'admin') if not $suppress_auto_admin and scalar grep (/^admin$/, @dirlist) == 0; + # Module names that begin with extragear/ and playground/ need some extra + # attention. + check_for_extragear($module); # Check out the module base. @args = ('svn'); if(-e "$kdesvn/$module") { print "Updating ${GREEN}$module${NORMAL} base\n"; push @args, 'up', '-N'; - push @args, $module; + + my $modulename = $module; + $modulename =~ s/^([^\/]*\/)//; + push @args, $modulename; } else { @@ -1412,6 +1428,11 @@ sub checkout_svn_partial return 1; } + # If the admin dir exists and is a soft link, remove it so that svn can + # update it if need be. The link will automatically be re-created later + # in the process if necessary by the build functions. + unlink ("$kdesvn/$module/admin") if -l "$kdesvn/$module/admin"; + ITEM_LOOP: for $item (@dirlist) { # We need to split each item in this list into its respective directories. @@ -1692,6 +1713,12 @@ sub safe_create_build_system chdir ("$kdesvn/$module"); chdir ("$builddir/$module") if $module eq 'qt-copy' and get_option('qt-copy', 'use-qt-builddir-hack'); + # Check for admin dir, if it doesn't exist, create a softlink + if ($module ne 'qt-copy' and not -e "$kdesvn/$module/admin") + { + system("ln -s $kdesvn/kde-common/admin"); + } + if ($module eq 'kdebindings' || $module eq 'valgrind') { # Use a slightly less method of builddir != srcdir for the module, @@ -2151,7 +2178,7 @@ EOF my $start_time = time; while (not defined $package_opts{$module}->{'#was-rebuilt'}) { - print "Building $module ($cur_module_num/$total_module_num)\n"; + print "Building $GREEN$module$NORMAL ($cur_module_num/$total_module_num)\n"; return 0 if not setup_build_directory($module); return 0 if not setup_build_system($module); return 1 if (get_option ($module, 'build-system-only')); @@ -2174,7 +2201,7 @@ EOF if ($trynumber > 3 or $was_rebuilt or get_option ($module, 'no-rebuild-on-fail')) { # Well we tried, but it isn't going to happen. - print "\n\tUnable to build $module!\n"; + print "\n\tUnable to build $YELLOW$module$NORMAL!\n"; print "\tTook $elapsed of time.\n"; return 0; } @@ -2203,7 +2230,7 @@ EOF my $elapsed = prettify_seconds (time - $start_time); my $do_install = get_option($module, 'install-after-build'); - print "\tBuild done after $elapsed.\n"; + print "\tBuild done after $GREEN$elapsed$NORMAL.\n"; $do_install ? handle_install($module) : print "\tSkipping install for $module\n"; diff --git a/kdesvn-buildrc-sample b/kdesvn-buildrc-sample index cca0358..b3b27ba 100644 --- a/kdesvn-buildrc-sample +++ b/kdesvn-buildrc-sample @@ -1,16 +1,62 @@ # Sample configuration file for kdesvn-build. global - binpath /usr/lib/ccache/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin - configure-flags --enable-debug=full --disable-as-needed --cache-file=/home/kde-cvs/kdecvs/config.cache +# binpath controls the value of the PATH environment variable during +# compilation. If you have unusual tools that need to be in the path to build +# KDE, add them here. KDE's and Qt's programs are automatically added. + binpath /bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin +# binpath /usr/lib/ccache/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin + +# This is the Qt installation to use to build KDE. The default is qt-copy +# from Subversion. +# qtdir ~/kdesvn/build/qt-copy + +# You might want to use your system's built-in Qt already (3.3 or greater). If +# so, assign the qtdir option appropriately. +# qtdir /path/to/system/qt + +# This controls the configure flags passed to every module (except qt-copy) by +# default. If you have module-specific configure flags, they will be placed +# after these flags to allow the module setting to override them. + configure-flags --enable-debug=full + +# These are the compilation flags to use by default when compiling KDE. + cxxflags -g -pipe -march=i686 + +# These are the default options passed to the make command used (either make +# or unsermake). The default tries to build with 2 parallel compiles. If you +# are using distcc or have SMP, you should experiment with setting this value +# higher for best performance. +# make-options -j2 + +# This option is used to decide whether to use the unsermake build system, which +# is usually faster and more efficient than the standard automake-based build +# system. It is generally stable enough to use, so it defaults to on. You +# can disable this on a module-by-module basis if it gives you problems. +# use-unsermake true + +# This is the directory that your KDE sources are downloaded too. This directory +# also holds the build directory by default. # source-dir ~/kdesvn + +# This directory is where everything gets built before it is installed. By +# default it is relative to the value for source-dir. You can specify an +# absolute path if you'd like. +# build-dir build + +# This is the Subversion server to download the KDE sources from. Developers: +# Don't forget to add your username to the URL if necessary! # svn-server https://anonsvn.kde.org/home/kde - cxxflags -Os -pipe + +# This is the directory that KDE will end up installed at. The default is +# appropriate for a single-user installation of KDE, which requires no root +# permissions. If you'd like, you can install and use the sudo program to +# install KDE anywhere on your system, in conjunction with the +# make-install-prefix option. # kdedir ~/kde -# make-options -j2 -# qtdir ~/kdesvn/build/qt-copy -# use-unsermake true - set-env LDFLAGS -Wl,-O1 + +# You can also use the set-env option to add values to the build environment. + set-env LDFLAGS -Wl,-O1 # Optimize the linker end global module qt-copy @@ -87,4 +133,13 @@ end module module kdewebdev end module +# Modules in extragear and playground can also be added. +# module extragear/network +# # Options like checkout-only should work as before. +# checkout-only konversation +# end module + +# module playground/games +# end module + # Add more modules as needed, they support the same options as before.