From 7362f9a32f45817fb533ef781b7605c44e430679 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 16 Nov 2011 16:06:07 -0600 Subject: Finish rename from prior commit --- doc/scripts/kdesvn-build/CMakeLists.txt | 12 - doc/scripts/kdesvn-build/Makefile.am | 2 - doc/scripts/kdesvn-build/index.docbook | 1324 ---------- doc/scripts/tdesvn-build/CMakeLists.txt | 12 + doc/scripts/tdesvn-build/Makefile.am | 2 + doc/scripts/tdesvn-build/index.docbook | 1324 ++++++++++ kdesdk.lsm | 11 - scripts/kdesvn-build | 4286 ------------------------------- scripts/kdesvn-buildrc-sample | 246 -- scripts/kdesvn-buildrc.xml | 152 -- scripts/tdesvn-build | 4286 +++++++++++++++++++++++++++++++ scripts/tdesvn-buildrc-sample | 246 ++ scripts/tdesvn-buildrc.xml | 152 ++ tdesdk.lsm | 11 + 14 files changed, 6033 insertions(+), 6033 deletions(-) delete mode 100644 doc/scripts/kdesvn-build/CMakeLists.txt delete mode 100644 doc/scripts/kdesvn-build/Makefile.am delete mode 100644 doc/scripts/kdesvn-build/index.docbook create mode 100644 doc/scripts/tdesvn-build/CMakeLists.txt create mode 100644 doc/scripts/tdesvn-build/Makefile.am create mode 100644 doc/scripts/tdesvn-build/index.docbook delete mode 100644 kdesdk.lsm delete mode 100755 scripts/kdesvn-build delete mode 100644 scripts/kdesvn-buildrc-sample delete mode 100644 scripts/kdesvn-buildrc.xml create mode 100755 scripts/tdesvn-build create mode 100644 scripts/tdesvn-buildrc-sample create mode 100644 scripts/tdesvn-buildrc.xml create mode 100644 tdesdk.lsm diff --git a/doc/scripts/kdesvn-build/CMakeLists.txt b/doc/scripts/kdesvn-build/CMakeLists.txt deleted file mode 100644 index f063a809..00000000 --- a/doc/scripts/kdesvn-build/CMakeLists.txt +++ /dev/null @@ -1,12 +0,0 @@ -################################################# -# -# (C) 2010-2011 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -tde_create_handbook( DESTINATION tdesvn-build ) diff --git a/doc/scripts/kdesvn-build/Makefile.am b/doc/scripts/kdesvn-build/Makefile.am deleted file mode 100644 index 171f575c..00000000 --- a/doc/scripts/kdesvn-build/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -KDE_LANG = en -KDE_DOCS = AUTO diff --git a/doc/scripts/kdesvn-build/index.docbook b/doc/scripts/kdesvn-build/index.docbook deleted file mode 100644 index 4ae84648..00000000 --- a/doc/scripts/kdesvn-build/index.docbook +++ /dev/null @@ -1,1324 +0,0 @@ - - - - - - Subversion"> - tdesvn-build"> -]> - - - - -&tdesvn-build; Script Manual - - - -MichaelPyne -
michael.pyne@kdemail.net
-
- -CarlosWoelz -
carloswoelz@imap-mail.com
-
- - - - -
- - -2005 -Michael Pyne - - - -2005 -Carlos Woelz - - - -&FDLNotice; - -2005-06-18 -0.98 - - -The &tdesvn-build; is a Perl script which builds and installs &kde; directly from the sources found in the &kde; &svn; repository. - - - -KDE -tdesdk -SVN -Subversion -KDE development - - -
- - - -Introduction - - -&tdesvn-build; is a Perl script to help users install &kde; from &svn;. You may also want to -consider the kde-build script include with &kde;'s tdesdk module. - - - -Here we document the &tdesvn-build; configuration file syntax and options, its -command line options, features, and an overview of all necessary steps required -to build &kde; from source, including the steps which you should perform using -other tools, or in other words, steps that are not automatically performed -by the &tdesvn-build; script. - - - - - -Getting Started - - -In this chapter, we show how to use the &tdesvn-build; to checkout modules from the -&kde; repository and build them. We also provide a basic explanation of the &kde; -&svn; structure and the steps you have to perform before running the script. - - - -All topics present in this chapter are covered with even more detail in the - -Building &kde; from Source Step by Step Guide, at the -&kde; Quality Team Website. -If you are compiling KDE for the first time, it is a good idea to read -it, or consult it as a reference source. You will find detailed information -about packaging tools and requirements, common compilation pitfalls and -strategies and information about running your new &kde; installation. - - - -Preparing the System to Build &kde; - - -It is recommended that you download and build &kde; using a user -account. If you already have &kde; packages installed, the best choice -would be to create a different (dedicated) user to build and run the new &kde;. -The advantage of building &kde; with a dedicated user is you can not break -the base system, and you will always have a way to comfortably work when -things go wrong. - - - -Later, you can do a root installation if you wish. This document -does not cover a root installation. If you are performing a system -wide install, you probably already know what you are doing anyway. - - -Before using the &tdesvn-build; script (or any other building -strategy) you must install the development tools and libraries needed for &kde;. -You need the Qt library, version 3.3.0 or greater, Automake 1.8, -Autoconf 2.5X (better if >=2.57 as a bug was reported with lower versions), -the subversion (svn) client, the gcc compiler with C++ support, libxml2, -openssl, libbz2, and many more (for a complete list, visit the -KDE Compilation -Requirements). You can usually get those tools packaged for your system -from your distribution or vendor. - - - -Some of these packages are divided into libs, programs or utilities and -development packages. You will need at least the program or library and -its development package. If in doubt, install all. The libraries you need -will change depending on the modules you intend to build, as each module -has its own requirements. The - -Building &kde; from Source Step by Step Guide has more details -about the specific tools and techniques used to install and find the -required software. - - - -You probably already have a version of the &tdesvn-build; script installed -in your system. &tdesvn-build;requires you to create a configuration file, named -.tdesvn-buildrc. This file should be installed on -the home folder (~/), and contain all configuration data -required for the script to run, like configuration options, -compiling options, location of the sources, the destination of the installation -(prefix), the modules that should be built, &etc;. The default configuration -data is provided by the tdesvn-buildrc-sample file. -You can find more information about the syntax of the configuration file -in and in . - - - -A good way to get the latest version is to browse the tdesdk/scripts page -at the websvn.kde.org website. -You will see a list of the files available in the tdesdk/scripts directory in -the &kde; &svn; repository. Click the &tdesvn-build; link and download -the latest version of the script. Do the same for the -tdesvn-buildrc-sample file. -Make the script executable, and be sure it is in your path. - - - - - -Setting the Configuration Data - - -To use the script, you must have a file in your home directory called -.tdesvn-buildrc, which sets the general options and sets the modules -you would like to download and build. - - - -Use the tdesvn-buildrc-sample file as a -template, setting global options, and the modules you want to build. - - - -Select the server used to check out from &svn;, by setting the svn-server -global option. The default is the anonymous &svn; repository, -svn://anonsvn.kde.org/, but change it -if you have a &kde; -&svn; account, or if there is -a mirror close to you. - - - -Pay close attention to the kdedir and qtdir global variables, as the first sets -where your &kde; build is going to be installed, (by default to -~/kde), and the second where (and if) your qt library is -going to be built and installed, (by default to -~/tdesvn/build/qt-copy). You will need to know the -kdedir and qtdir location later, to set up the environment variables -that are necessary to run your new installation. -Check if the listed modules are in fact the modules you want to build. -The default options from the tdesvn-buildrc-sample file -should be enough to get a fairly complete &kde; installation. -Save the resulting as .tdesvn-buildrc in your home -folder. - - - -If you wish to fine tune your .tdesvn-buildrc, -consult for detailed information -about all configuration options. - - - - - -Using the &tdesvn-build; script - - -Now you are ready to run the script. From a terminal window, -log in to the user you are using to compile &kde; and execute -the script: - -%su devel-username -%tdesvn-build - - - - -Now, the script should start downloading the sources and compiling them. It is -unlikely that you will succeed in the first time you compile &kde;. Do not despair! -Check the log files to see if you are missing some tools or development packages -(the location of the log files is set by the log-dir variable in the configuration -file). Sometimes, the main development branch get very unstable and hard to build, -especially when a development freeze is close. Be patient. You can find more common -examples of things that can go wrong and their solutions, as well as general tips and -strategies to build &kde; in the - -Building &kde; from Source Step by Step Guide. - - - - - -Setting the Environment to Run Your Fresh &kde; - - -Assuming you are using a dedicated user to build &kde;, and you already have -an installed &kde; version, running your new &kde; may be a bit tricky, as the new &kde; -has to take precedence over the old. Change the environment variables to -make sure it does. - - - -Open or create the .bash_profile file in the home directory with your favorite editor, -and add to the end of the file: - - -KDEDIR=(path to kdedir) -KDEDIRS=$KDEDIR -PATH=$KDEDIR/bin:$QTDIR/bin:$PATH -LD_LIBRARY_PATH=$KDEDIR/lib:$LD_LIBRARY_PATH -export KDEDIRS PATH LD_LIBRARY_PATH - - -If you are building the qt-copy module, add instead: - - -QTDIR=(path to qtdir) -KDEDIR=(path to kdedir) -KDEDIRS=$KDEDIR -PATH=$KDEDIR/bin:$QTDIR/bin:$PATH -MANPATH=$QTDIR/doc/man:$MANPATH -LD_LIBRARY_PATH=$KDEDIR/lib:$QTDIR/lib:$LD_LIBRARY_PATH -export QTDIR KDEDIRS PATH MANPATH LD_LIBRARY_PATH - - - - -If you are not using a dedicated user, set a different $KDEHOME for your -new environment in your .bash_profile: - - -export KDEHOME="${HOME}/.kde-svn" - -# Create it if needed -[ ! -e ~/.kde-svn ] && mkdir ~/.kde-svn - - - - - -If later your menu is empty or too crowded with applications from your distribution, -you may have to set the xdg environment variables in your .bash_profile: - - -XDG_CONFIG_DIRS="/etc/xdg" -XDG_DATA_DIRS="${KDEDIR}/share:/usr/share" -export XDG_CONFIG_DIRS XDG_DATA_DIRS - - - - - - -Now that we are done with the you have to make sure that the right startkde -script is going to be used: - - - -Open the .xinitrc text file (or .xsession, -depending on the distribution) from the home directory, or create it if necessary. Add the -line: - - -exec ${KDEDIR}/bin/startkde - - - - -Now start your fresh &kde;: in BSD and Linux systems with virtual terminal support, -Ctrl+Alt+F1...F12 keystroke combinations are used to switch to Virtual Console 1 through 12. -This allows you to run more than one desktop environment at the same time. The fist six are -text terminals and the following six are graphical displays. - - - -If when you boot you are presented to the graphical display manager instead, you can -use the new KDE environment, even if it is not listed as an option. Press Crtl + Alt + F2, -and you will be presented to a text terminal. Log in using the dedicated user and type: - - - -startx -- :1 - - - - -You can run the KDE from sources and the old KDE at the same time! Log in using your regular user, -start the stable KDE desktop. Press Crtl + Alt + F2 (or F1, F3, etc..), and you will be presented -to a text terminal. Log in using the dedicated user and type "startx -- :1". You can go back to the -regular user by pressing Crtl + Alt + F6 (Or F7, F8, etc... Try them out! One of them is the right -one.) To return to KDE from sources, press Crtl + Alt + F7 (or F6, F8,etc..). Now you can switch -between your KDE versions, and test the new one knowing you can quickly return to the safety of -the stable KDE desktop. - - - - - - - - - -Script Features - - -&tdesvn-build; features include: - - - - - - -Automatically checks out or updates modules from &svn;, as -appropriate. - - - -Times the build process for modules. - - - -Automatically tries to rebuild modules that were using incremental -make, which is prone to failure after certain kinds of commits. - - - -Can resume a previous script, or start the build process from a particular -module. - - - -Comes built-in with a sane set of default options appropriate for building -a base &kde; single-user installation from the anonymous &svn; repository. - - - -Comes with Unsermake -support. - - - -Tilde-expansion for your configuration options. For example, you can -specify: -qtdir ~/tdesvn/build/qt-copy - - - -Configurable build, source, and logging directories - - - -Automatically sets up a build system, with the source directory not the -same as the build directory, in order to keep the source directory -pristine. The exception is qt-copy, which is not designed to be built like -that (unless you would like to test the -qt with a separate build directory hack). - - - -You can specify global options to apply to every module to check out, and -you can specify options to apply to individual modules as well. - - - -Since the autotools sometimes get out of sync with changes to the -source tree, you can force a rebuild of a module by creating a file called -.refresh-me in the build directory of the module in question, or by running -&tdesvn-build; with the option. - - - -You can specify various environment values to be used during the build, -including KDEDIR, QTDIR, DO_NOT_COMPILE, -and CXXFLAGS. - - - -Command logging. Logs are dated and numbered so that you always have a -log of a script run. Also, a special symlink called latest is created to -always point to the most recent log entry in the log directory. - - - -If you are using a user build of &kde; instead of a system build (for which -you must be root to install), you can use the script to install for you. I -haven not audited this code, and it makes ample use of the system() -call, so I would not recommend running it as root at this point. - - - -You can use make-install-prefix to -prefix the make install command line with a separate command, which is useful -for sudo. - - - -You can use the apidox option to automatically -build and install the API documentation for some modules. - - - -You can check out only a portion of a &kde; &svn; module. For example, -you could check out only the taglib from -tdesupport, or only K3B from -extragear/multimedia. The script will automatically pull in -kde-common if necessary to make the build work. - - - -You can pretend to do the operations. If you pass - or on the -command line, the script will give a very verbose description of the commands -it is about to execute, without actually executing it. - - - -Support for checking out specific branches of &svn; -modules. This work still needs to be completed, but you already select the branch you -want to build using the module-base-path -configuration option. - - - - - -Things that &tdesvn-build; does NOT do: - - - - - -Find the fastest &kde; &svn; mirror. There is not even a list shipped -with the script at this point, although the default server should work -fine. - - - -Brush your teeth. You should remember to do that yourself. - - - -The script probably is not bug-free. Sorry. - - - - - - - -The Format of .tdesvn-buildrc - - -To use the script, you must have a file in your home directory called -.tdesvn-buildrc, which describes the modules you would -like to download and build. - - - - - -It starts with the global options, specified like the following: - - - -global -option-name option-value -[...] -end global - - - -It is then followed by one or more module sections, specified like the -following: - - - -module module-name -option-name option-value -[...] -end module - - - -module-name must be a module from the &kde; &svn; repository (for -example, tdelibs or tdebase). Some options override global options, some -add to global options, and some global options simply can't be overridden. - - - -The following is an alphabetized list of options you can use. Click on the -option to find out more about it. If one is not documented, please e-mail the -authors using the address you can find above. - - - -apidox, to build API Documentation -apply-qt-patches, to enhance qt-copy -binpath, to set the PATH variable. -branch, to checkout from a branch instead of /trunk. -build-dir, to set the directory to build in. -checkout-only, to checkout only parts of a module. -colorful-output to add color to the script output. -configure-flags to define what flags to configure a module with. -cxxflags to define the CXXFLAGS variable. -dest-dir to change the directory name for a module. -disable-agent-check, to keep tdesvn-build from checking on ssh-agent's status. -do-not-compile, to mark directories to skip building. -inst-apps, to only build and install some directories. -install-after-build, to avoid installing after the build process. -kdedir, to set the directory to install KDE to. -libpath, to set the LD_LIBRARY_PATH variable. -make-install-prefix, to run a helper program (like sudo) during make install. -make-options, to pass options to the make program. -manual-build, to avoid building the module automatically. -manual-update, to avoid doing anything to the module automatically. -module-base-path, to change where to download the module from (useful for branches and tags). -niceness, to change the CPU priority. -no-rebuild-on-fail, to avoid running make again if it fails. -qtdir, to set the path to Qt. -set-env, to set an environment variable. -source-dir, to change where to download the source code to. -stop-on-failure, to make tdesvn-build stop as soon as a failure is encountered. -svn-server, to change the server the sources are downloaded from. -use-qt-builddir-hack, to give Qt a separate build directory from its source like KDE. -use-unsermake, to use the advanced unsermake build system. - - - - -Here is a table of the various options, and some comments on them. Any -option which overrides the global option will override a command line setting -as well. - - - -Table of Options - - - - -Option-name -Module -> Global Behavior -Notes - - - - - - -apidox -Overrides global -Set this option to true in order to have &tdesvn-build; automatically -build and install the API documentation for the module after the normal build/install -process. This only works for modules where make apidox does something, -including tdelibs, tdebase, and koffice, among others. - - - - -apply-qt-patches -Overrides global -This option is only useful for qt-copy. If it is set to a non-zero value, -then the apply-patches script in qt-copy will be run prior to building, in -order to apply the non-official patches to the qt-copy. Since these patches -are normally the reason for using qt-copy instead of a stock Qt, it shouldn't -do any harm to enable it. The default is to enable the patches. - - - -binpath -Can't be overridden -Set this option to set the environment variable PATH while building. -You can't override this setting in a module option. The default value is -/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin. This environment -variable should include the colon-separated paths of your development -toolchain. The paths $KDEDIR/bin and -$QTDIR/bin are automatically added. You -may use the tilde (~) for any paths you add using this option. - - - - -branch -Overrides global -Set this option to checkout from a branch of KDE instead of the -default of "trunk", where KDE development occurs. For instance, to checkout -KDE 3.4 branch, you would set this option to "3.4". -Note that some modules use a different branch name. Notably, the -required arts module doesn't go by KDE version numbers. The arts that -accompanied KDE 3.4 was version 1.4. -If tdesvn-build fails to properly download a branch with this option, you -may have to manually specify the URL to download from using the override-url option. - - - - -build-dir -Overrides global -Use this option to change the directory to contain the built sources. There -are three different ways to use it: - - -Relative to the &kde; &svn; source directory (see the source-dir option). This is the default, and -the way the script worked up to version v0.61. This mode is selected if you -type a directory name that doesn't start with a tilde (~) or a slash (/). -The default value is build. - -Absolute path. If you specify a path that begins with a /, then that path -is used directly. For example, /tmp/kde-obj-dir/. - -Relative to your home directory. If you specify a path that begins with a -~, then the path is used relative to your home directory, analogous to the -shell's tilde-expansion. For example, ~/builddir would set the build -directory to /home/user-name/builddir. - - - -Perhaps surprisingly, this option can be changed per module. - - - - - -checkout-only -Overrides global -Set this option to checkout &svn; sources piece by piece. The value -for this option should be a space separated list of directories to checkout. -If you don't include the admin directory, it will automatically be included (if -necessary). When checking out piece by piece, the admin directory will be -pulled in from kde-common, which is where it exists on the &svn; server. -Although this option overrides the global option, be aware that setting this as -a global option makes no sense. - - - - -configure-flags -Appends to global option(except for qt-copy) -Use this option to specify what flags to pass to ./configure when creating -the build system for the module. When this is used as a global-option, it is -applied to all modules that this script builds. qt-copy uses a much different -set of configure options than the rest of &kde;, so this option -overrides the global settings when applied to qt-copy. - - - -colorful-output -Can't be overridden -Set this option to false to disable the colorful output of &tdesvn-build;. -This option defaults to true. Note that &tdesvn-build; won't output the -color codes to anything but a terminal (such as xterm, &konsole;, or the normal -Linux console). - - - - -cxxflags -Appends to global option -Use this option to specify what flags to pass to ./configure as the -CXXFLAGS when creating the build system for the module. This option is -specified here instead of with configure-flags because this option will also -set the environment variable CXXFLAGS during the build process. - - - - -dest-dir -Overrides global -Use this option to change the name a module is given on disk. For -example, if your module was extragear/network, you could rename it to -extragear-network using this option. - - - - -disable-agent-check -Can't be overridden -Normally if you're using SSH to download the Subversion sources (such as -if you're using the svn+ssh protocol), tdesvn-build will try and make sure that -if you're using ssh-agent, it is actually managing some SSH identities. This is -to try and prevent SSH from asking for your passphrase for every module. You can -disable this check by setting disable-agent-check to true. - - - - -do-not-compile -Overrides global -Use this option to set the DO_NOT_COMPILE environment variable prior to -running the configure script. According to the &kde; -Developer FAQ, this should cause any toplevel directory you pass to not be -built. The directories should be space-separated. - -Note that the sources to the programs will still be downloaded. You can use -the checkout-only -directive to choose directories that you want to check out. - - - - -email-address -Can't be overridden - -Set this option to the e-mail address tdesvn-build should send from should -it ever need to send e-mail. You do not need to worry about this if you don't -use any feature which send e-mail. (They are all disabled by default). - - -Currently only email-on-compile-error -needs this option. - - - - - -email-on-compile-error -Can't be overridden - -You can set this option to the email address to send a report to when a -module fails to build. tdesvn-build will wait until all the modules are done -and collate all of the results in the report. The report is only sent if a -module fails to build. - - -Please see the email-address -option to set the address tdesvn-build should send from, since the default -is usually not what you want. - - - - - -inst-apps -Overrides global -This is the opposite of the do-not-compile option. This option makes it -so that only the given toplevel directories are built. The directories should -be space-separated. - -Any changes don't take effect until the next time -make Makefile.cvs is -run, either automatically by the script, or manually by the or options. - - -Note that the sources to the programs will still be downloaded. You can use -the checkout-only -directive to choose directories that you want to check out. - - - - -install-after-build -Overrides global -This option is used to install the package after it successfully builds. -This option is enabled by default. If you want to disable this, you need to -set this option to 0 in the configuration file. You can also use the - command line flag. - - - - -kdedir -Can't be overridden -This option sets the directory that &kde; will be installed to after it is -built. It defaults to ~/kde. If you change this to a directory -needing root access, you may want to read about the make-install-prefix option as well. - - - -libpath -Can't be overridden -Set this option to set the environment variable LD_LIBRARY_PATH while -building. You can't override this setting in a module option. The default -value is blank, but the paths $KDEDIR/lib and -$QTDIR/lib are automatically -added. You may use the tilde (~) for any paths you add using this option. - - - - -log-dir -Overrides global -Use this option to change the directory used to hold the log files -generated by the script. This setting can be set on a per-module basis as of -version 0.64 or later. - - - - -make-install-prefix -Overrides global -Set this variable to a space-separated list, which is interpreted as a -command and its options to precede the make install command used to install -modules. This is useful for installing packages with sudo for example, but -please be careful while dealing with root privileges. - - - -make-options -Overrides global -Set this variable in order to pass command line options to the make -command. This is useful for programs such as distcc. -distcc allows you to share your -compilation work among more than one computer. To use it, you must use the - option to make. Now you can. According to the docs, 2 * -number_of_network_cpus is recommended. I have 1 CPU total, so it would be - in my case. - - - -manual-build -Overrides global -Set the option value to true to keep the build process from attempting to -build this module. It will still be kept up-to-date when updating from &svn;. -This option is exactly equivalent to the command line option. - - - - -manual-update -Overrides global -Set the option value to true to keep the build process from attempting to -update (and by extension, build or install) this module. If you set this -option for a module, then you have pretty much commented it out. - - - - -module-base-path -Overrides global -Set this option to override &tdesvn-build;'s default directory path to the -module in question. This can be used, for example, to pull specific branches -or tagged versions of libraries. The &kde; -Source Viewer is invaluable in helping to pick the right path. -Note that &tdesvn-build; constructs the final path according to the -following template: -$svn-server/home/kde/$module-base-path/$module-name. - -The default value is either trunk or -trunk/KDE, depending on the modulename. - - - - -niceness -Can't be overridden -Set this option to a number between 20 and 0. The higher the number, the -lower a priority &tdesvn-build; will set for itself. The default is 10. - - - - -no-rebuild-on-fail -Overrides global -Set this option value to true to always prevent &tdesvn-build; from trying -to rebuild this module if it should fail an incremental build. Normally -&tdesvn-build; will try to rebuild the module from scratch to counteract the -effect of a stray &svn; update messing up the build system. - - - -override-url -Overrides global -If you set this option, tdesvn-build will use its value as the URL -to pass to Subversion completely unchanged. You should -generally use this if you want to download a specific release but tdesvn-build -can't figure out what you mean using branch. - - - - -qtdir -Can't be overridden -Set this option to set the environment variable QTDIR while building. -You can't override this setting in a module option. If you don't specify -this option, it defaults to -$(source-dir)/build/qt-copy, -which uses the qt-copy module included in the &kde; source repository. -You may use a tilde (~) to represent your home directory. - - - - -remove-after-install -Overrides global -If you are low on hard disk space, you may want to use this option -in order to automatically delete the build directory (or both the source and -build directories for one-time installs) after the module is successfully -installed. - -Possible values for this option are: - -none - Do not delete anything (This is the default). -builddir - Delete the build directory, but not the source. -all - Delete both the source code and build directory. - - - -Note that using this option can have a significant detrimental impact on -both your bandwidth usage (if you use 'all') and the time taken to compile KDE, -since tdesvn-build will be unable to perform incremental builds. - - - - -set-env -Overrides global -This option accepts a space-separated set of values, where the first value -is the environment variable to set, and the rest of the values is what you -want the variable set to. For example, to set the variable RONALD to -McDonald, you would put in the appropriate section this command: -set-env RONALD McDonald -This option is special in that it can be repeated without overriding -earlier set-env settings in the same section of the configuration file. This -way you can set more than one environment variable per module (or -globally). - - - - -source-dir -Can't be overridden -This option is used to set the directory on your computer to store the &kde; -&svn; sources at. If you don't specify this value, the default is -~/tdesvn. If -you do specify this value, use an absolute path name. - - - - -svn-server -Can't be overridden -This option is used to set the server used to check out from &svn;. -The default is the anonymous &svn; repository, svn://anonsvn.kde.org/ - - - -stop-on-failure -Overrides global -Set this option value to true to cause the script to stop execution -after an error occurs during the build or install process. This option is off -by default. - - - - -tag -Overrides global -Use this option to download a specific release of a module. -NOTE: The odds are very good that you DO NOT WANT -to use this option. KDE releases are available in tarball form from The KDE FTP site or one of its mirrors. -If you are using tdesvn-build because you have having trouble getting -a KDE release to build on your distribution, consider using the Konstruct build tool -instead, which works from the release tarballs. - - - - -use-qt-builddir-hack -Overrides global -Although this option overrides the global option, it only makes sense for -qt-copy. Set this option to true to enable the script's -experimental srcdir != builddir mode. When enabled, -&tdesvn-build; will copy the qt-copy source module to the build directory, -and perform builds from there. That means your QTDIR environment variable -should be set to -$(qt-copy-build-dir)/qt-copy/lib -instead. You should also change your qtdir -option accordingly. Incremental make should still work in this mode, as the -timestamps will be preserved after the copy. If you use the -apply-qt-patches option, the patches -will be applied in the build directory, not the source directory. -This option defaults to true. - - - - -use-unsermake -Overrides global -Set this option to true in order to use the -experimental unsermake program instead of automake when running the configure -script. This can lead to some serious decreases in build time, especially for -distributed building -systems. This option defaults to true (for most modules). - - -Normally if you use this option tdesvn-build will automatically keep -unsermake up-to-date. This may start to get annoying, especially if you are -managing unsermake yourself. If this is the case, you can set this option to -self, and tdesvn-build will still use unsermake, but will not -do anything special to keep it updated. - - - - - - - -
- -
- - -Command Line Options and Environment Variables - - -This script doesn't use environment variables. If you need to set environment -variables for the build or install process, please see the set-env option. - - - -The script accepts the following command-line options: - - - - - - - -only display simple help on this script. - - - - - - -display the program version. - - - - - - -display contact information for the -author. - - - - - - -enable colorful output. - - - - - - -disable colorful output. - - - - - (or ) - -don't actually DO anything, but act like you did. - - - - - (or ) - -Don't be as noisy with the output. With this switch only the basics are -output. - - - - - - -Only output warnings and errors. - - - - - - -Be very descriptive about what's going on, and what tdesvn-build is doing. - - - - - - -only perform the source update. - - - - - - -only perform the build process. - - - - - - -don't include the modules passed on the rest of the command line in the update/build -process. - - - - - - -skip contacting the &svn; server. - - - - - - -skip the build process. - - - - - - -don't automatically install packages after they're built. - - - - - - -enables debug mode for the script. Currently -this means that all output will be dumped to STDOUT in addition to being -logged in the log directory like normal. Also, many functions are much more -verbose about what they're doing in debugging mode. - - - - - - -don't try and -rebuild modules that have failed building from scratch. &tdesvn-build; will -never try to do this to a module that already was tried to be built from -scratch. - - - - - - -recreate the build system and make from scratch. - - - - - - -run the configure script again -without cleaning the build directory. - - - - - - -run make -Makefile.cvs again to create the configure script, and continue -building as normal. This option implies . - - - - - - -which tries to continue building from where -the script stopped last time. The script starts building the module after the -last module to be compiled last time the script was run, whether or not it -succeeded. This option implies . You -should not specify other module names on the command line. - - - - - - -which is like , except that you supply -the module to start building from as the next parameter on the command line. This option -implies . You should not specify -other module names on the command line. - - - - - - -which interprets the next command line -parameter as the file to read the configuration options from. The default -value for this parameter is ~/.tdesvn-buildrc. - - - - - - -which allows you to change the directory that &kde; will be installed to from the command line. -This option implies . - - - - - - -stop after running make Makefile.cvs. The configure -script will still need to be run, which &tdesvn-build; will do next time. This lets you -prepare all the configure scripts at once so you can view the ./configure - for each module, and edit your configure-flags accordingly. - - - - - -If this is the only command-line option, it tries to install all of the modules contained in -successfully-built, except for qt-copy, which doesn't need installation. If command-line -options are specified after , they are all assumed to be modules to install. - - - - - - -You can use this option to override an option in your configuration file for -every module. For instance, to override the log-dir option, you would do: -. - - - - - - -You can use this option to override an option in your configuration file for -a specific module. For instance, to override the use-unsermake option for tdemultimedia, you -would do: . - - - - - - -Any other command-line options are assumed to be modules to update and build. -Please, don't mix building with installing. - - - - - -Credits And Licenses - -&underFDL; - - - -
diff --git a/doc/scripts/tdesvn-build/CMakeLists.txt b/doc/scripts/tdesvn-build/CMakeLists.txt new file mode 100644 index 00000000..f063a809 --- /dev/null +++ b/doc/scripts/tdesvn-build/CMakeLists.txt @@ -0,0 +1,12 @@ +################################################# +# +# (C) 2010-2011 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +tde_create_handbook( DESTINATION tdesvn-build ) diff --git a/doc/scripts/tdesvn-build/Makefile.am b/doc/scripts/tdesvn-build/Makefile.am new file mode 100644 index 00000000..171f575c --- /dev/null +++ b/doc/scripts/tdesvn-build/Makefile.am @@ -0,0 +1,2 @@ +KDE_LANG = en +KDE_DOCS = AUTO diff --git a/doc/scripts/tdesvn-build/index.docbook b/doc/scripts/tdesvn-build/index.docbook new file mode 100644 index 00000000..4ae84648 --- /dev/null +++ b/doc/scripts/tdesvn-build/index.docbook @@ -0,0 +1,1324 @@ + + + + + + Subversion"> + tdesvn-build"> +]> + + + + +&tdesvn-build; Script Manual + + + +MichaelPyne +
michael.pyne@kdemail.net
+
+ +CarlosWoelz +
carloswoelz@imap-mail.com
+
+ + + + +
+ + +2005 +Michael Pyne + + + +2005 +Carlos Woelz + + + +&FDLNotice; + +2005-06-18 +0.98 + + +The &tdesvn-build; is a Perl script which builds and installs &kde; directly from the sources found in the &kde; &svn; repository. + + + +KDE +tdesdk +SVN +Subversion +KDE development + + +
+ + + +Introduction + + +&tdesvn-build; is a Perl script to help users install &kde; from &svn;. You may also want to +consider the kde-build script include with &kde;'s tdesdk module. + + + +Here we document the &tdesvn-build; configuration file syntax and options, its +command line options, features, and an overview of all necessary steps required +to build &kde; from source, including the steps which you should perform using +other tools, or in other words, steps that are not automatically performed +by the &tdesvn-build; script. + + + + + +Getting Started + + +In this chapter, we show how to use the &tdesvn-build; to checkout modules from the +&kde; repository and build them. We also provide a basic explanation of the &kde; +&svn; structure and the steps you have to perform before running the script. + + + +All topics present in this chapter are covered with even more detail in the + +Building &kde; from Source Step by Step Guide, at the +&kde; Quality Team Website. +If you are compiling KDE for the first time, it is a good idea to read +it, or consult it as a reference source. You will find detailed information +about packaging tools and requirements, common compilation pitfalls and +strategies and information about running your new &kde; installation. + + + +Preparing the System to Build &kde; + + +It is recommended that you download and build &kde; using a user +account. If you already have &kde; packages installed, the best choice +would be to create a different (dedicated) user to build and run the new &kde;. +The advantage of building &kde; with a dedicated user is you can not break +the base system, and you will always have a way to comfortably work when +things go wrong. + + + +Later, you can do a root installation if you wish. This document +does not cover a root installation. If you are performing a system +wide install, you probably already know what you are doing anyway. + + +Before using the &tdesvn-build; script (or any other building +strategy) you must install the development tools and libraries needed for &kde;. +You need the Qt library, version 3.3.0 or greater, Automake 1.8, +Autoconf 2.5X (better if >=2.57 as a bug was reported with lower versions), +the subversion (svn) client, the gcc compiler with C++ support, libxml2, +openssl, libbz2, and many more (for a complete list, visit the +KDE Compilation +Requirements). You can usually get those tools packaged for your system +from your distribution or vendor. + + + +Some of these packages are divided into libs, programs or utilities and +development packages. You will need at least the program or library and +its development package. If in doubt, install all. The libraries you need +will change depending on the modules you intend to build, as each module +has its own requirements. The + +Building &kde; from Source Step by Step Guide has more details +about the specific tools and techniques used to install and find the +required software. + + + +You probably already have a version of the &tdesvn-build; script installed +in your system. &tdesvn-build;requires you to create a configuration file, named +.tdesvn-buildrc. This file should be installed on +the home folder (~/), and contain all configuration data +required for the script to run, like configuration options, +compiling options, location of the sources, the destination of the installation +(prefix), the modules that should be built, &etc;. The default configuration +data is provided by the tdesvn-buildrc-sample file. +You can find more information about the syntax of the configuration file +in and in . + + + +A good way to get the latest version is to browse the tdesdk/scripts page +at the websvn.kde.org website. +You will see a list of the files available in the tdesdk/scripts directory in +the &kde; &svn; repository. Click the &tdesvn-build; link and download +the latest version of the script. Do the same for the +tdesvn-buildrc-sample file. +Make the script executable, and be sure it is in your path. + + + + + +Setting the Configuration Data + + +To use the script, you must have a file in your home directory called +.tdesvn-buildrc, which sets the general options and sets the modules +you would like to download and build. + + + +Use the tdesvn-buildrc-sample file as a +template, setting global options, and the modules you want to build. + + + +Select the server used to check out from &svn;, by setting the svn-server +global option. The default is the anonymous &svn; repository, +svn://anonsvn.kde.org/, but change it +if you have a &kde; +&svn; account, or if there is +a mirror close to you. + + + +Pay close attention to the kdedir and qtdir global variables, as the first sets +where your &kde; build is going to be installed, (by default to +~/kde), and the second where (and if) your qt library is +going to be built and installed, (by default to +~/tdesvn/build/qt-copy). You will need to know the +kdedir and qtdir location later, to set up the environment variables +that are necessary to run your new installation. +Check if the listed modules are in fact the modules you want to build. +The default options from the tdesvn-buildrc-sample file +should be enough to get a fairly complete &kde; installation. +Save the resulting as .tdesvn-buildrc in your home +folder. + + + +If you wish to fine tune your .tdesvn-buildrc, +consult for detailed information +about all configuration options. + + + + + +Using the &tdesvn-build; script + + +Now you are ready to run the script. From a terminal window, +log in to the user you are using to compile &kde; and execute +the script: + +%su devel-username +%tdesvn-build + + + + +Now, the script should start downloading the sources and compiling them. It is +unlikely that you will succeed in the first time you compile &kde;. Do not despair! +Check the log files to see if you are missing some tools or development packages +(the location of the log files is set by the log-dir variable in the configuration +file). Sometimes, the main development branch get very unstable and hard to build, +especially when a development freeze is close. Be patient. You can find more common +examples of things that can go wrong and their solutions, as well as general tips and +strategies to build &kde; in the + +Building &kde; from Source Step by Step Guide. + + + + + +Setting the Environment to Run Your Fresh &kde; + + +Assuming you are using a dedicated user to build &kde;, and you already have +an installed &kde; version, running your new &kde; may be a bit tricky, as the new &kde; +has to take precedence over the old. Change the environment variables to +make sure it does. + + + +Open or create the .bash_profile file in the home directory with your favorite editor, +and add to the end of the file: + + +KDEDIR=(path to kdedir) +KDEDIRS=$KDEDIR +PATH=$KDEDIR/bin:$QTDIR/bin:$PATH +LD_LIBRARY_PATH=$KDEDIR/lib:$LD_LIBRARY_PATH +export KDEDIRS PATH LD_LIBRARY_PATH + + +If you are building the qt-copy module, add instead: + + +QTDIR=(path to qtdir) +KDEDIR=(path to kdedir) +KDEDIRS=$KDEDIR +PATH=$KDEDIR/bin:$QTDIR/bin:$PATH +MANPATH=$QTDIR/doc/man:$MANPATH +LD_LIBRARY_PATH=$KDEDIR/lib:$QTDIR/lib:$LD_LIBRARY_PATH +export QTDIR KDEDIRS PATH MANPATH LD_LIBRARY_PATH + + + + +If you are not using a dedicated user, set a different $KDEHOME for your +new environment in your .bash_profile: + + +export KDEHOME="${HOME}/.kde-svn" + +# Create it if needed +[ ! -e ~/.kde-svn ] && mkdir ~/.kde-svn + + + + + +If later your menu is empty or too crowded with applications from your distribution, +you may have to set the xdg environment variables in your .bash_profile: + + +XDG_CONFIG_DIRS="/etc/xdg" +XDG_DATA_DIRS="${KDEDIR}/share:/usr/share" +export XDG_CONFIG_DIRS XDG_DATA_DIRS + + + + + + +Now that we are done with the you have to make sure that the right startkde +script is going to be used: + + + +Open the .xinitrc text file (or .xsession, +depending on the distribution) from the home directory, or create it if necessary. Add the +line: + + +exec ${KDEDIR}/bin/startkde + + + + +Now start your fresh &kde;: in BSD and Linux systems with virtual terminal support, +Ctrl+Alt+F1...F12 keystroke combinations are used to switch to Virtual Console 1 through 12. +This allows you to run more than one desktop environment at the same time. The fist six are +text terminals and the following six are graphical displays. + + + +If when you boot you are presented to the graphical display manager instead, you can +use the new KDE environment, even if it is not listed as an option. Press Crtl + Alt + F2, +and you will be presented to a text terminal. Log in using the dedicated user and type: + + + +startx -- :1 + + + + +You can run the KDE from sources and the old KDE at the same time! Log in using your regular user, +start the stable KDE desktop. Press Crtl + Alt + F2 (or F1, F3, etc..), and you will be presented +to a text terminal. Log in using the dedicated user and type "startx -- :1". You can go back to the +regular user by pressing Crtl + Alt + F6 (Or F7, F8, etc... Try them out! One of them is the right +one.) To return to KDE from sources, press Crtl + Alt + F7 (or F6, F8,etc..). Now you can switch +between your KDE versions, and test the new one knowing you can quickly return to the safety of +the stable KDE desktop. + + + + + + + + + +Script Features + + +&tdesvn-build; features include: + + + + + + +Automatically checks out or updates modules from &svn;, as +appropriate. + + + +Times the build process for modules. + + + +Automatically tries to rebuild modules that were using incremental +make, which is prone to failure after certain kinds of commits. + + + +Can resume a previous script, or start the build process from a particular +module. + + + +Comes built-in with a sane set of default options appropriate for building +a base &kde; single-user installation from the anonymous &svn; repository. + + + +Comes with Unsermake +support. + + + +Tilde-expansion for your configuration options. For example, you can +specify: +qtdir ~/tdesvn/build/qt-copy + + + +Configurable build, source, and logging directories + + + +Automatically sets up a build system, with the source directory not the +same as the build directory, in order to keep the source directory +pristine. The exception is qt-copy, which is not designed to be built like +that (unless you would like to test the +qt with a separate build directory hack). + + + +You can specify global options to apply to every module to check out, and +you can specify options to apply to individual modules as well. + + + +Since the autotools sometimes get out of sync with changes to the +source tree, you can force a rebuild of a module by creating a file called +.refresh-me in the build directory of the module in question, or by running +&tdesvn-build; with the option. + + + +You can specify various environment values to be used during the build, +including KDEDIR, QTDIR, DO_NOT_COMPILE, +and CXXFLAGS. + + + +Command logging. Logs are dated and numbered so that you always have a +log of a script run. Also, a special symlink called latest is created to +always point to the most recent log entry in the log directory. + + + +If you are using a user build of &kde; instead of a system build (for which +you must be root to install), you can use the script to install for you. I +haven not audited this code, and it makes ample use of the system() +call, so I would not recommend running it as root at this point. + + + +You can use make-install-prefix to +prefix the make install command line with a separate command, which is useful +for sudo. + + + +You can use the apidox option to automatically +build and install the API documentation for some modules. + + + +You can check out only a portion of a &kde; &svn; module. For example, +you could check out only the taglib from +tdesupport, or only K3B from +extragear/multimedia. The script will automatically pull in +kde-common if necessary to make the build work. + + + +You can pretend to do the operations. If you pass + or on the +command line, the script will give a very verbose description of the commands +it is about to execute, without actually executing it. + + + +Support for checking out specific branches of &svn; +modules. This work still needs to be completed, but you already select the branch you +want to build using the module-base-path +configuration option. + + + + + +Things that &tdesvn-build; does NOT do: + + + + + +Find the fastest &kde; &svn; mirror. There is not even a list shipped +with the script at this point, although the default server should work +fine. + + + +Brush your teeth. You should remember to do that yourself. + + + +The script probably is not bug-free. Sorry. + + + + + + + +The Format of .tdesvn-buildrc + + +To use the script, you must have a file in your home directory called +.tdesvn-buildrc, which describes the modules you would +like to download and build. + + + + + +It starts with the global options, specified like the following: + + + +global +option-name option-value +[...] +end global + + + +It is then followed by one or more module sections, specified like the +following: + + + +module module-name +option-name option-value +[...] +end module + + + +module-name must be a module from the &kde; &svn; repository (for +example, tdelibs or tdebase). Some options override global options, some +add to global options, and some global options simply can't be overridden. + + + +The following is an alphabetized list of options you can use. Click on the +option to find out more about it. If one is not documented, please e-mail the +authors using the address you can find above. + + + +apidox, to build API Documentation +apply-qt-patches, to enhance qt-copy +binpath, to set the PATH variable. +branch, to checkout from a branch instead of /trunk. +build-dir, to set the directory to build in. +checkout-only, to checkout only parts of a module. +colorful-output to add color to the script output. +configure-flags to define what flags to configure a module with. +cxxflags to define the CXXFLAGS variable. +dest-dir to change the directory name for a module. +disable-agent-check, to keep tdesvn-build from checking on ssh-agent's status. +do-not-compile, to mark directories to skip building. +inst-apps, to only build and install some directories. +install-after-build, to avoid installing after the build process. +kdedir, to set the directory to install KDE to. +libpath, to set the LD_LIBRARY_PATH variable. +make-install-prefix, to run a helper program (like sudo) during make install. +make-options, to pass options to the make program. +manual-build, to avoid building the module automatically. +manual-update, to avoid doing anything to the module automatically. +module-base-path, to change where to download the module from (useful for branches and tags). +niceness, to change the CPU priority. +no-rebuild-on-fail, to avoid running make again if it fails. +qtdir, to set the path to Qt. +set-env, to set an environment variable. +source-dir, to change where to download the source code to. +stop-on-failure, to make tdesvn-build stop as soon as a failure is encountered. +svn-server, to change the server the sources are downloaded from. +use-qt-builddir-hack, to give Qt a separate build directory from its source like KDE. +use-unsermake, to use the advanced unsermake build system. + + + + +Here is a table of the various options, and some comments on them. Any +option which overrides the global option will override a command line setting +as well. + + + +Table of Options + + + + +Option-name +Module -> Global Behavior +Notes + + + + + + +apidox +Overrides global +Set this option to true in order to have &tdesvn-build; automatically +build and install the API documentation for the module after the normal build/install +process. This only works for modules where make apidox does something, +including tdelibs, tdebase, and koffice, among others. + + + + +apply-qt-patches +Overrides global +This option is only useful for qt-copy. If it is set to a non-zero value, +then the apply-patches script in qt-copy will be run prior to building, in +order to apply the non-official patches to the qt-copy. Since these patches +are normally the reason for using qt-copy instead of a stock Qt, it shouldn't +do any harm to enable it. The default is to enable the patches. + + + +binpath +Can't be overridden +Set this option to set the environment variable PATH while building. +You can't override this setting in a module option. The default value is +/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin. This environment +variable should include the colon-separated paths of your development +toolchain. The paths $KDEDIR/bin and +$QTDIR/bin are automatically added. You +may use the tilde (~) for any paths you add using this option. + + + + +branch +Overrides global +Set this option to checkout from a branch of KDE instead of the +default of "trunk", where KDE development occurs. For instance, to checkout +KDE 3.4 branch, you would set this option to "3.4". +Note that some modules use a different branch name. Notably, the +required arts module doesn't go by KDE version numbers. The arts that +accompanied KDE 3.4 was version 1.4. +If tdesvn-build fails to properly download a branch with this option, you +may have to manually specify the URL to download from using the override-url option. + + + + +build-dir +Overrides global +Use this option to change the directory to contain the built sources. There +are three different ways to use it: + + +Relative to the &kde; &svn; source directory (see the source-dir option). This is the default, and +the way the script worked up to version v0.61. This mode is selected if you +type a directory name that doesn't start with a tilde (~) or a slash (/). +The default value is build. + +Absolute path. If you specify a path that begins with a /, then that path +is used directly. For example, /tmp/kde-obj-dir/. + +Relative to your home directory. If you specify a path that begins with a +~, then the path is used relative to your home directory, analogous to the +shell's tilde-expansion. For example, ~/builddir would set the build +directory to /home/user-name/builddir. + + + +Perhaps surprisingly, this option can be changed per module. + + + + + +checkout-only +Overrides global +Set this option to checkout &svn; sources piece by piece. The value +for this option should be a space separated list of directories to checkout. +If you don't include the admin directory, it will automatically be included (if +necessary). When checking out piece by piece, the admin directory will be +pulled in from kde-common, which is where it exists on the &svn; server. +Although this option overrides the global option, be aware that setting this as +a global option makes no sense. + + + + +configure-flags +Appends to global option(except for qt-copy) +Use this option to specify what flags to pass to ./configure when creating +the build system for the module. When this is used as a global-option, it is +applied to all modules that this script builds. qt-copy uses a much different +set of configure options than the rest of &kde;, so this option +overrides the global settings when applied to qt-copy. + + + +colorful-output +Can't be overridden +Set this option to false to disable the colorful output of &tdesvn-build;. +This option defaults to true. Note that &tdesvn-build; won't output the +color codes to anything but a terminal (such as xterm, &konsole;, or the normal +Linux console). + + + + +cxxflags +Appends to global option +Use this option to specify what flags to pass to ./configure as the +CXXFLAGS when creating the build system for the module. This option is +specified here instead of with configure-flags because this option will also +set the environment variable CXXFLAGS during the build process. + + + + +dest-dir +Overrides global +Use this option to change the name a module is given on disk. For +example, if your module was extragear/network, you could rename it to +extragear-network using this option. + + + + +disable-agent-check +Can't be overridden +Normally if you're using SSH to download the Subversion sources (such as +if you're using the svn+ssh protocol), tdesvn-build will try and make sure that +if you're using ssh-agent, it is actually managing some SSH identities. This is +to try and prevent SSH from asking for your passphrase for every module. You can +disable this check by setting disable-agent-check to true. + + + + +do-not-compile +Overrides global +Use this option to set the DO_NOT_COMPILE environment variable prior to +running the configure script. According to the &kde; +Developer FAQ, this should cause any toplevel directory you pass to not be +built. The directories should be space-separated. + +Note that the sources to the programs will still be downloaded. You can use +the checkout-only +directive to choose directories that you want to check out. + + + + +email-address +Can't be overridden + +Set this option to the e-mail address tdesvn-build should send from should +it ever need to send e-mail. You do not need to worry about this if you don't +use any feature which send e-mail. (They are all disabled by default). + + +Currently only email-on-compile-error +needs this option. + + + + + +email-on-compile-error +Can't be overridden + +You can set this option to the email address to send a report to when a +module fails to build. tdesvn-build will wait until all the modules are done +and collate all of the results in the report. The report is only sent if a +module fails to build. + + +Please see the email-address +option to set the address tdesvn-build should send from, since the default +is usually not what you want. + + + + + +inst-apps +Overrides global +This is the opposite of the do-not-compile option. This option makes it +so that only the given toplevel directories are built. The directories should +be space-separated. + +Any changes don't take effect until the next time +make Makefile.cvs is +run, either automatically by the script, or manually by the or options. + + +Note that the sources to the programs will still be downloaded. You can use +the checkout-only +directive to choose directories that you want to check out. + + + + +install-after-build +Overrides global +This option is used to install the package after it successfully builds. +This option is enabled by default. If you want to disable this, you need to +set this option to 0 in the configuration file. You can also use the + command line flag. + + + + +kdedir +Can't be overridden +This option sets the directory that &kde; will be installed to after it is +built. It defaults to ~/kde. If you change this to a directory +needing root access, you may want to read about the make-install-prefix option as well. + + + +libpath +Can't be overridden +Set this option to set the environment variable LD_LIBRARY_PATH while +building. You can't override this setting in a module option. The default +value is blank, but the paths $KDEDIR/lib and +$QTDIR/lib are automatically +added. You may use the tilde (~) for any paths you add using this option. + + + + +log-dir +Overrides global +Use this option to change the directory used to hold the log files +generated by the script. This setting can be set on a per-module basis as of +version 0.64 or later. + + + + +make-install-prefix +Overrides global +Set this variable to a space-separated list, which is interpreted as a +command and its options to precede the make install command used to install +modules. This is useful for installing packages with sudo for example, but +please be careful while dealing with root privileges. + + + +make-options +Overrides global +Set this variable in order to pass command line options to the make +command. This is useful for programs such as distcc. +distcc allows you to share your +compilation work among more than one computer. To use it, you must use the + option to make. Now you can. According to the docs, 2 * +number_of_network_cpus is recommended. I have 1 CPU total, so it would be + in my case. + + + +manual-build +Overrides global +Set the option value to true to keep the build process from attempting to +build this module. It will still be kept up-to-date when updating from &svn;. +This option is exactly equivalent to the command line option. + + + + +manual-update +Overrides global +Set the option value to true to keep the build process from attempting to +update (and by extension, build or install) this module. If you set this +option for a module, then you have pretty much commented it out. + + + + +module-base-path +Overrides global +Set this option to override &tdesvn-build;'s default directory path to the +module in question. This can be used, for example, to pull specific branches +or tagged versions of libraries. The &kde; +Source Viewer is invaluable in helping to pick the right path. +Note that &tdesvn-build; constructs the final path according to the +following template: +$svn-server/home/kde/$module-base-path/$module-name. + +The default value is either trunk or +trunk/KDE, depending on the modulename. + + + + +niceness +Can't be overridden +Set this option to a number between 20 and 0. The higher the number, the +lower a priority &tdesvn-build; will set for itself. The default is 10. + + + + +no-rebuild-on-fail +Overrides global +Set this option value to true to always prevent &tdesvn-build; from trying +to rebuild this module if it should fail an incremental build. Normally +&tdesvn-build; will try to rebuild the module from scratch to counteract the +effect of a stray &svn; update messing up the build system. + + + +override-url +Overrides global +If you set this option, tdesvn-build will use its value as the URL +to pass to Subversion completely unchanged. You should +generally use this if you want to download a specific release but tdesvn-build +can't figure out what you mean using branch. + + + + +qtdir +Can't be overridden +Set this option to set the environment variable QTDIR while building. +You can't override this setting in a module option. If you don't specify +this option, it defaults to +$(source-dir)/build/qt-copy, +which uses the qt-copy module included in the &kde; source repository. +You may use a tilde (~) to represent your home directory. + + + + +remove-after-install +Overrides global +If you are low on hard disk space, you may want to use this option +in order to automatically delete the build directory (or both the source and +build directories for one-time installs) after the module is successfully +installed. + +Possible values for this option are: + +none - Do not delete anything (This is the default). +builddir - Delete the build directory, but not the source. +all - Delete both the source code and build directory. + + + +Note that using this option can have a significant detrimental impact on +both your bandwidth usage (if you use 'all') and the time taken to compile KDE, +since tdesvn-build will be unable to perform incremental builds. + + + + +set-env +Overrides global +This option accepts a space-separated set of values, where the first value +is the environment variable to set, and the rest of the values is what you +want the variable set to. For example, to set the variable RONALD to +McDonald, you would put in the appropriate section this command: +set-env RONALD McDonald +This option is special in that it can be repeated without overriding +earlier set-env settings in the same section of the configuration file. This +way you can set more than one environment variable per module (or +globally). + + + + +source-dir +Can't be overridden +This option is used to set the directory on your computer to store the &kde; +&svn; sources at. If you don't specify this value, the default is +~/tdesvn. If +you do specify this value, use an absolute path name. + + + + +svn-server +Can't be overridden +This option is used to set the server used to check out from &svn;. +The default is the anonymous &svn; repository, svn://anonsvn.kde.org/ + + + +stop-on-failure +Overrides global +Set this option value to true to cause the script to stop execution +after an error occurs during the build or install process. This option is off +by default. + + + + +tag +Overrides global +Use this option to download a specific release of a module. +NOTE: The odds are very good that you DO NOT WANT +to use this option. KDE releases are available in tarball form from The KDE FTP site or one of its mirrors. +If you are using tdesvn-build because you have having trouble getting +a KDE release to build on your distribution, consider using the Konstruct build tool +instead, which works from the release tarballs. + + + + +use-qt-builddir-hack +Overrides global +Although this option overrides the global option, it only makes sense for +qt-copy. Set this option to true to enable the script's +experimental srcdir != builddir mode. When enabled, +&tdesvn-build; will copy the qt-copy source module to the build directory, +and perform builds from there. That means your QTDIR environment variable +should be set to +$(qt-copy-build-dir)/qt-copy/lib +instead. You should also change your qtdir +option accordingly. Incremental make should still work in this mode, as the +timestamps will be preserved after the copy. If you use the +apply-qt-patches option, the patches +will be applied in the build directory, not the source directory. +This option defaults to true. + + + + +use-unsermake +Overrides global +Set this option to true in order to use the +experimental unsermake program instead of automake when running the configure +script. This can lead to some serious decreases in build time, especially for +distributed building +systems. This option defaults to true (for most modules). + + +Normally if you use this option tdesvn-build will automatically keep +unsermake up-to-date. This may start to get annoying, especially if you are +managing unsermake yourself. If this is the case, you can set this option to +self, and tdesvn-build will still use unsermake, but will not +do anything special to keep it updated. + + + + + + + +
+ +
+ + +Command Line Options and Environment Variables + + +This script doesn't use environment variables. If you need to set environment +variables for the build or install process, please see the set-env option. + + + +The script accepts the following command-line options: + + + + + + + +only display simple help on this script. + + + + + + +display the program version. + + + + + + +display contact information for the +author. + + + + + + +enable colorful output. + + + + + + +disable colorful output. + + + + + (or ) + +don't actually DO anything, but act like you did. + + + + + (or ) + +Don't be as noisy with the output. With this switch only the basics are +output. + + + + + + +Only output warnings and errors. + + + + + + +Be very descriptive about what's going on, and what tdesvn-build is doing. + + + + + + +only perform the source update. + + + + + + +only perform the build process. + + + + + + +don't include the modules passed on the rest of the command line in the update/build +process. + + + + + + +skip contacting the &svn; server. + + + + + + +skip the build process. + + + + + + +don't automatically install packages after they're built. + + + + + + +enables debug mode for the script. Currently +this means that all output will be dumped to STDOUT in addition to being +logged in the log directory like normal. Also, many functions are much more +verbose about what they're doing in debugging mode. + + + + + + +don't try and +rebuild modules that have failed building from scratch. &tdesvn-build; will +never try to do this to a module that already was tried to be built from +scratch. + + + + + + +recreate the build system and make from scratch. + + + + + + +run the configure script again +without cleaning the build directory. + + + + + + +run make +Makefile.cvs again to create the configure script, and continue +building as normal. This option implies . + + + + + + +which tries to continue building from where +the script stopped last time. The script starts building the module after the +last module to be compiled last time the script was run, whether or not it +succeeded. This option implies . You +should not specify other module names on the command line. + + + + + + +which is like , except that you supply +the module to start building from as the next parameter on the command line. This option +implies . You should not specify +other module names on the command line. + + + + + + +which interprets the next command line +parameter as the file to read the configuration options from. The default +value for this parameter is ~/.tdesvn-buildrc. + + + + + + +which allows you to change the directory that &kde; will be installed to from the command line. +This option implies . + + + + + + +stop after running make Makefile.cvs. The configure +script will still need to be run, which &tdesvn-build; will do next time. This lets you +prepare all the configure scripts at once so you can view the ./configure + for each module, and edit your configure-flags accordingly. + + + + + +If this is the only command-line option, it tries to install all of the modules contained in +successfully-built, except for qt-copy, which doesn't need installation. If command-line +options are specified after , they are all assumed to be modules to install. + + + + + + +You can use this option to override an option in your configuration file for +every module. For instance, to override the log-dir option, you would do: +. + + + + + + +You can use this option to override an option in your configuration file for +a specific module. For instance, to override the use-unsermake option for tdemultimedia, you +would do: . + + + + + + +Any other command-line options are assumed to be modules to update and build. +Please, don't mix building with installing. + + + + + +Credits And Licenses + +&underFDL; + + + +
diff --git a/kdesdk.lsm b/kdesdk.lsm deleted file mode 100644 index 85641fef..00000000 --- a/kdesdk.lsm +++ /dev/null @@ -1,11 +0,0 @@ -Begin4 -Title: tdesdk -Version: 3.5.10 -Entered-date: 2008-08-26 -Description: K Desktop Environment (KDE) SDK -Keywords: KDE X11 desktop Qt -Author: http://bugs.kde.org/ (KDE Bugtracking System) -Primary-site: http://www.kde.org/download/ -Platforms: Unix, Qt -Copying-policy: GPL, Artistic -End diff --git a/scripts/kdesvn-build b/scripts/kdesvn-build deleted file mode 100755 index fb81ac67..00000000 --- a/scripts/kdesvn-build +++ /dev/null @@ -1,4286 +0,0 @@ -#!/usr/bin/perl -w - -#Pod documentation: - -=head1 NAME - -=over - -=item B - automate the kde svn build process - -=back - -=head1 SYNOPSIS - -=over - -=item B I<[options]...> I<[modules]...> - -=back - -=head1 DESCRIPTION - -The B script is used to automate the download, build, -and install process for KDE (using Subversion). - -It is recommended that you first setup a F<.tdesvn-buildrc> file -in your home directory. Please refer to B help file -in KDE help for information on how to write F<.tdesvn-buildrc>, -or consult the sample file which should have been included -with this program. If you don't setup a F<.tdesvn-buildrc>, a -default set of options will be used, and a few modules will be -built by default. - -After setting up F<.tdesvn-buildrc>, you can run this program from -either the command-line or from cron. It will automatically -download the modules from Subversion, create the build -system, and configure and make the modules you tell it to. -You can use this program to install KDE as well, -if you are building KDE for a single user. Note that B -will try to install the modules by default. - -If you DO specify a package name, then your settings will still be -read, but the script will try to build / install the package -regardless of F<.tdesvn-buildrc> - -tdesvn-build reads options in the following order: - -=over - -=item 1. From the command line. - -=item 2. From the file F in the current directory. Note that - the file is not a hidden file. - -=item 3. From the file F<~/.tdesvn-buildrc>. - -=item 4. From a set of internal options. - -=back - -This utility is part of the KDE Software Development Kit. - -=head1 OPTIONS - -=over - -=item B<--quiet>, B<-q> - -With this switch tdesvn-build will only output a general overview of the build -process. Progress output is still displayed if available. - -=item B<--really-quiet> - -With this switch only warnings and errors will be output. - -=item B<--verbose>, B<-v> - -Be very detailed in what is going on, and what actions tdesvn-build is taking. -Only B<--debug> is more detailed. - -=item B<--no-svn> - -Skip contacting the Subversion server. - -=item B<--no-build> - -Skip the build process. - -=item B<--no-install> - -Don't automatically install after build. - -=item B<--svn-only> - -Update from Subversion only (Identical to B<--no-build> at this point). - -=item B<--build-only> - -Build only, do not perform updates or install. - -=item B<--rc-file=EfilenameE> - -Read configuration from filename instead of default. - -=item B<--debug> - -Activates debug mode. - -=item B<--pretend>, B<-p> - -Do not contact the Subversion server, run make, or create / delete files -and directories. Instead, output what the script would have done. - -=item B<--nice=EvalueE> - -Allow you to run the script with a lower priority. The default value is -10 (lower priority by 10 steps). - -=item B<--prefix=/kde/path> - -This option is a shortcut to change the setting for kdedir from the -command line. It implies B<--reconfigure>. - -=item B<--color> - -Add color to the output. - -=item B<--no-color> - -Remove color from the output. - -=item B<--resume> - -Tries to resume the make process from the last time the script was run, -without performing the Subversion update. - -=item B<--resume-from=EpkgE> - -Starts building from the given package, without performing the Subversion -update. - -=item B<--revision=ErevE>, B<-r=ErevE> - -Forces update to revision from Subversion. - -=item B<--refresh-build> - -Start the build from scratch. This means that the build directory for the -module B before make -f Makefile.cvs is run again. You can -use B<--recreate-configure> to do the same thing without deleting the module -build directory. - -=item B<--reconfigure> - -Run configure again, but don't clean the build directory or re-run -make -f Makefile.cvs. - -=item B<--recreate-configure> - -Run make -f Makefile.cvs again to redo the configure script. The build -directory is not deleted. - -=item B<--no-rebuild-on-fail> - -Do not try to rebuild a module from scratch if it failed building. Normally -tdesvn-build will try progressively harder to build the module before giving -up. - -=item B<--build-system-only> - -Create the build infrastructure, but don't actually perform the build. - -=item B<--install> - -Try to install the packages passed on the command line, or all packages in -F<~/.tdesvn-buildrc> that don't have manual-build set. Building and -Subversion updates are not performed. - -=item B<--EoptionE=> - -Any unrecognized options are added to the global configuration, overriding -any value that may exist. - -For example, B<--svn-server=http://path.to.svn.server/> would change the -setting of the global B option for this instance of tdesvn-build. - -=item B<--EmoduleE,EoptionE=> - -Likewise, allow you to override any module specific option from the -command line. - -Example: B<--tdelibs,use-unsermake=false> would disable unsermake for the -tdelibs module. - -=item B<--help> - -Display the help and exit. - -=item B<--author> - -Output the author(s)'s name. - -=item B<--version> - -Output the program version. - -=back - -=head1 EXAMPLES - -=over - -=item B - -=item B I<--no-svn tdelibs> - -=item B I<--refresh-build> I - -=back - -=head1 BUGS - -Since tdesvn-build doesn't generally save information related to the build and -prior settings, you may need to manually re-run tdesvn-build with a flag like -B<--recreate-configure> if you change some options, including B. - -Please use KDE bugzilla at http://bugs.kde.org for information and -reporting bugs. - -=head1 SEE ALSO - -You can find additional information at B home page, -F, or using tdesvn-build -docbook documentation, using the help kioslave, F. - -=head1 AUTHOR - -Michael Pyne - -Man page written by: -Carlos Leonhard Woelz - -=cut - -# Script to handle building KDE from Subversion. All of the configuration is -# stored in the file ~/.tdesvn-buildrc. -# -# Please also see the documentation that should be included with this program, -# in doc.html -# -# Copyright (c) 2003, 2004, 2005 Michael Pyne. -# Home page: http://tdesvn-build.kde.org/ -# -# You may use, alter, and redistribute this software under the terms -# of the GNU General Public License, v2 (or any later version). -# -# TODO: It would be better to have lockfiles in each directory as it's -# being updated, instead of having one big lock for the script. - -use strict; -use warnings; -use Fcntl; # For sysopen constants -use POSIX 'strftime'; -use File::Find; # For our lndir reimplementation. -use Errno qw(:POSIX); - -# Debugging level constants. -use constant { - DEBUG => 0, - WHISPER => 1, - INFO => 2, - NOTE => 3, - WARNING => 4, - ERROR => 5, -}; - -# Some global variables -# Remember kids, global variables are evil! I only get to do this -# because I'm an adult and you're not! :-P -# Options that start with a # will replace values with the same name, -# if the option is actually set. -my %package_opts = ( - 'global' => { - "apidox" => "", - "apply-qt-patches" => "", - "binpath" => "/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin", - "branch" => "", - "build-dir" => "build", - "build-system-only" => "", - "checkout-only" => "", - "configure-flags" => "--enable-debug", - "colorful-output" => 1, # Use color by default. - "cxxflags" => "-pipe", - "debug" => "", - "debug-level" => INFO, - "dest-dir" => '${MODULE}', # single quotes used on purpose! - "disable-agent-check" => 0, # If true we don't check on ssh-agent - "do-not-compile" => "", - "email-address" => "", - "email-on-compile-error" => "", - "install-after-build" => "1", # Default to true - "inst-apps" => "", - "kdedir" => "$ENV{HOME}/kde", - "libpath" => "", - "log-dir" => "log", - "make-install-prefix" => "", # Some people need sudo - "make-options" => "-j2", - "manual-build" => "", - "manual-update" => "", - "module-base-path" => "", # Used for tags and branches - "niceness" => "10", - "no-svn" => "", - "no-rebuild-on-fail" => "", - "override-url" => "", - "prefix" => "", # Override installation prefix. - "pretend" => "", - "qtdir" => "$ENV{HOME}/tdesvn/build/qt-copy", - "reconfigure" => "", - "recreate-configure" => "", - "refresh-build" => "", - "remove-after-install"=> "none", # { none, builddir, all } - "revision" => 0, - "set-env" => { }, # Hash of environment vars to set - "source-dir" => "$ENV{HOME}/tdesvn", - "stop-on-failure" => "", - "svn-server" => "svn://anonsvn.kde.org/home/kde", - "tag" => "", - "unsermake-options" => "--compile-jobs=2 -p", - "unsermake-path" => "unsermake", - "use-unsermake" => "1", # Default to true now, we may need a blacklist - } -); - -# This is a hash since Perl doesn't have a "in" keyword. -my %ignore_list; # List of packages to refuse to include in the build list. - -# update and build are lists since they support an ordering, which can't be -# guaranteed using a hash unless I want a custom sort function (which isn't -# necessarily a horrible way to go, I just chose to do it this way. -my @update_list; # List of modules to update/checkout. -my @build_list; # List of modules to build. - -# Dictionary of lists of failed modules, keyed by the name of the operation -# that caused the failure (e.g. build). Note that output_failed_module_lists -# uses the key name to display text to the user so it should describe the -# actual category of failure. You should also add the key name to -# output_failed_module_lists since it uses its own sorted list. -my @fail_display_order = qw/build update install/; -my %fail_lists = ( - 'build' => [ ], - 'install' => [ ], - 'update' => [ ], -); - -my $install_flag; # True if we're in install mode. -my $BUILD_ID; # Used by logging subsystem to create a unique log dir. -my $LOG_DATE; # Used by logging subsystem to create logs in same dir. -my @rcfiles = ("./tdesvn-buildrc", "$ENV{HOME}/.tdesvn-buildrc"); -my $rcfile; # the file that was used; set by read_options - -# Colors -my ($RED, $GREEN, $YELLOW, $NORMAL, $BOLD) = ("") x 5; - -# Subroutine definitions - -# I swear Perl must be the only language where the docs tell you to use a -# constant that you'll never find exported without some module from CPAN. -use constant PRIO_PROCESS => 0; - -# I'm lazy and would rather write in shorthand for the colors. This sub -# allows me to do so. Put it right up top to stifle Perl warnings. -sub clr($) -{ - my $str = shift; - - $str =~ s/g\[/$GREEN/g; - $str =~ s/]/$NORMAL/g; - $str =~ s/y\[/$YELLOW/g; - $str =~ s/r\[/$RED/g; - $str =~ s/b\[/$BOLD/g; - - return $str; -} - -# Subroutine which returns true if pretend mode is on. Uses the prototype -# feature so you don't need the parentheses to use it. -sub pretending() -{ - return get_option('global', 'pretend'); -} - -# Subroutine which returns true if debug mode is on. Uses the prototype -# feature so you don't need the parentheses to use it. -sub debugging() -{ - return get_option('global', 'debug-level') <= DEBUG; -} - -# The next few subroutines are used to print output at different importance -# levels to allow for e.g. quiet switches, or verbose switches. The levels are, -# from least to most important: -# debug, whisper, info (default), note (quiet), warning (very-quiet), and error. -# -# You can also use the pretend output subroutine, which is emitted if, and only -# if pretend mode is enabled. -# -# clr is automatically run on the input for all of those functions. -# Also, the terminal color is automatically reset to normal as well so you don't -# need to manually add the ] to reset. - -# Subroutine used to actually display the data, calls clr on each entry first. -sub print_clr(@) -{ - print clr $_ foreach (@_); - print clr "]\n"; -} - -sub debug(@) -{ - print_clr @_ if debugging; -} - -sub whisper(@) -{ - print_clr @_ if get_option('global', 'debug-level') <= WHISPER; -} - -sub info(@) -{ - print_clr @_ if get_option('global', 'debug-level') <= INFO; -} - -sub note(@) -{ - print_clr @_ if get_option('global', 'debug-level') <= NOTE; -} - -sub warning(@) -{ - print_clr @_ if get_option('global', 'debug-level') <= WARNING; -} - -# This sub has the additional side effect of printing the errno value if it -# is set. -sub error(@) -{ - print STDERR (clr $_) foreach (@_); - print " $!\n" if $!; -} - -sub pretend(@) -{ - print_clr @_ if pretending; -} - -# Subroutine to handle removing the lock file upon receiving a signal -sub quit_handler -{ - note "Signal received, terminating."; - finish(5); -} - -# Subroutine that returns the path of a file used to output the results of the -# build process. It accepts one parameter, which changes the kind of file -# returned. If the parameter is set to 'existing', then the file returned is -# the latest file that exists, or undef if no log has been created yet. This -# is useful for the --resume mode. All other values will return the name if a -# file that does not yet exist. -# -# All files will be stored in the log directory. -sub get_output_file -{ - my $logdir; - my $mode; - $mode = shift or $mode = ''; - my $fname; - - debug "get_output_file in mode $mode"; - - if ($mode eq 'existing') - { - # There's two ways of finding the old file. Searching backwards with - # valid combinations of the date and build id, or just reading in the - # name from a known file or location. Since the latter option is much - # easier, that's what I'm going with. Note that this depends on the - # latest symlink being in place. - $logdir = get_subdir_path ('global', 'log-dir'); - $fname = "$logdir/latest/build-status"; - - debug "Old build status file is $fname"; - - # The _ at the end returns the cached file stats to avoid multiple - # stat() calls. - return "" if not -e $fname or not -r _; - - return $fname; - } - - # This call must follow the test above, because it changes the 'latest' - # symlink leading to failures later. - $logdir = get_log_dir('global'); - - $fname = "$logdir/build-status"; - debug "Build status file is $fname"; - - return $fname; -} - -# Subroutine to retrieve a subdirecty path for the given module. -# First parameter is the name of the module, and the second -# parameter is the option key (e.g. build-dir or log-dir). -sub get_subdir_path -{ - my $module = shift; - my $option = shift; - my $dir = get_option($module, $option); - - # If build-dir starts with a slash, it is an absolute path. - return $dir if $dir =~ /^\//; - - # If it starts with a tilde, expand it out. - if ($dir =~ /^~/) - { - $dir =~ s/^~/$ENV{'HOME'}/; - } - else - { - # Relative directory, tack it on to the end of $tdesvn. - my $tdesvndir = get_tdesvn_dir(); - $dir = "$tdesvndir/$dir"; - } - - return $dir; -} - -# Subroutine to return the name of the destination directory for the checkout -# and build routines. Based on the dest-dir option. The return value will be -# relative to the src/build dir. The user may use the '$MODULE' or '${MODULE}' -# sequences, which will be replaced by the name of the module in question. -# -# The first parameter should be the module name. -sub get_dest_dir -{ - my $module = shift; - my $dest_dir = get_option($module, 'dest-dir'); - - $dest_dir =~ s/(\${MODULE})|(\$MODULE\b)/$module/g; - - return $dest_dir; -} - -# Convienience subroutine to get the source root dir. -sub get_tdesvn_dir -{ - return get_option ('global', 'source-dir'); -} - -# Function to work around a Perl language limitation. -# First parameter is the list to search. -# Second parameter is the value to search for. -# Returns true if the value is in the list -sub list_has(\@$) -{ - my ($list_ref, $value) = @_; - return scalar grep ($_ eq $value, @{$list_ref}); -} - -# Subroutine to return the branch prefix. i.e. the part before the branch name -# and module name. -# -# The first parameter is the module in question. -# The second parameter should be 'branches' if we're dealing with a branch or -# 'tags' if we're dealing with a tag. -# -# Ex: 'tdelibs' => 'branches/KDE' -# 'tdevelop' => 'branches/tdevelop' -sub branch_prefix -{ - my $module = shift; - my $type = shift; - - # These modules seem to have their own subdir in /tags. - my @tag_components = qw/arts koffice amarok kst qt taglib/; - - # The map call adds the kde prefix to the module names because I don't feel - # like typing them all in. tdevelop and konstruct are special cases. - my @kde_module_list = ((map {'kde' . $_} qw/-i18n -common accessibility - addons admin artwork base bindings edu games graphics libs - multimedia network nonbeta pim sdk toys utils webdev/), 'tdevelop', - 'konstruct'); - - # KDE proper modules seem to use this pattern. - return "$type/KDE" if list_has(@kde_module_list, $module); - - # If we doing a tag just return 'tags' because the next part is the actual - # tag name, which is added by the caller, unless the module has its own - # subdirectory in /tags. - return "$type" if $type eq 'tags' and not list_has(@tag_components, $module); - - # Everything else. - return "$type/$module"; -} - -# Subroutine to return a module URL for a module using the 'branch' option. -# First parameter is the module in question. -# Second parameter is the type ('tags' or 'branches') -sub handle_branch_tag_option -{ - my ($module, $type) = @_; - my $svn_server = get_option($module, 'svn-server'); - my $branch = branch_prefix($module, $type); - my $branchname = get_option($module, 'tag'); - - if($type eq 'branches') - { - $branchname = get_option($module, 'branch'); - } - - # Remove trailing slashes. - $svn_server =~ s/\/*$//; - - return "$svn_server/$branch/$branchname/$module"; -} - -# Subroutine to return the appropriate SVN URL for a given module, based on -# the user settings. For example, 'tdelibs' -> https://svn.kde.org/home/kde/trunk/KDE/tdelibs -sub svn_module_url -{ - my $module = shift; - my $svn_server = get_option($module, 'svn-server'); - my $branch = get_option($module, 'module-base-path'); - - # Allow user to override normal processing of the module in a few ways, - # to make it easier to still be able to use tdesvn-build even when I - # can't be there to manually update every little special case. - if(get_option($module, 'override-url')) - { - return get_option($module, 'override-url'); - } - - if(get_option($module, 'tag')) - { - return handle_branch_tag_option($module, 'tags'); - } - - if(get_option($module, 'branch')) - { - return handle_branch_tag_option($module, 'branches'); - } - - # The following modules are in /trunk, not /trunk/KDE. There are others, - # but there are the important ones. The hash is associated with the value - # 1 so that we can do a boolean test by looking up the module name. - my @non_trunk_modules = qw(extragear kdenonbeta tdesupport koffice - playground qt-copy valgrind KDE kdereview www l10n); - - my $module_root = $module; - $module_root =~ s/\/.*//; # Remove everything after the first slash - - if (not $branch) - { - $branch = 'trunk/KDE'; - $branch = 'trunk' if list_has(@non_trunk_modules, $module_root); - } - - $branch =~ s/^\/*//; # Eliminate / at beginning of string. - $branch =~ s/\/*$//; # Likewise at the end. - - # Remove trailing slashes. - $svn_server =~ s/\/*$//; - - return "$svn_server/$branch/$module"; -} - -# Convienience subroutine to return the build directory for a module. Use -# this instead of get_subdir_path because this special-cases modules for you, -# such as qt-copy. -# TODO: From what I hear this hack is no longer necessary. Investigate this. -sub get_build_dir -{ - my $module = shift; - - # It is the responsibility of the caller to append $module! - return get_tdesvn_dir() if ($module eq 'qt-copy') and not get_option('qt-copy', 'use-qt-builddir-hack'); - return get_subdir_path($module, 'build-dir'); -} - -# Subroutine to return a list of the different log directories that are used -# by the different modules in the script. -sub get_all_log_directories -{ - my @module_list = keys %package_opts; - my %log_dict; - - # A hash is used to track directories to avoid duplicate entries. - unshift @module_list, "global"; - $log_dict{get_subdir_path($_, 'log-dir')} = 1 foreach @module_list; - - debug "Log directories are ", join (", ", keys %log_dict); - return keys %log_dict; -} - -# Subroutine to determine the build id for this invocation of the script. The -# idea of a build id is that we want to be able to run the script more than -# once in a day and still retain each set of logs. So if we run the script -# more than once in a day, we need to increment the build id so we have a -# unique value. This subroutine sets the global variable $BUILD_ID and -# $LOG_DATE for use by the logging subroutines. -sub setup_logging_subsystem -{ - my $min_build_id = "00"; - my $date = strftime "%F", localtime; # ISO 8601 date - my @log_dirs = get_all_log_directories(); - - for (@log_dirs) - { - my $id = "01"; - $id++ while -e "$_/$date-$id"; - - # We need to use a string comparison operator to keep - # the magic in the ++ operator. - $min_build_id = $id if $id gt $min_build_id; - } - - $LOG_DATE = $date; - $BUILD_ID = $min_build_id; -} - -# Convienience subroutine to return the log directory for a module. -# It also creates the directory and manages the 'latest' symlink. -# -# Returns undef on an error, or the name of the directory otherwise. -sub get_log_dir -{ - my $module = shift; - my $logbase = get_subdir_path($module, 'log-dir'); - my $logpath = "$logbase/$LOG_DATE-$BUILD_ID/$module"; - - $logpath = "$logbase/$LOG_DATE-$BUILD_ID" if $module eq 'global'; - - debug "Log directory for $module is $logpath"; - - if (not -e $logpath and not pretending and not super_mkdir($logpath)) - { - error "Unable to create log directory r[$logpath]"; - return undef; - } - - # Add symlink to the directory. - # TODO: This probably can result in a few dozen unnecessary calls to - # unlink and symlink, fix this. - if (not pretending) - { - unlink("$logbase/latest") if -l "$logbase/latest"; - symlink("$logbase/$LOG_DATE-$BUILD_ID", "$logbase/latest"); - } - - return $logpath; -} - -# This function returns true if the given option doesn't make sense with the -# given module. -# blacklisted($module, $option) -sub blacklisted -{ - my ($module, $option) = @_; - - # Known to not work. - my @unsermake_ban_list = qw/valgrind kde-common qt-copy tdebindings/; - - return list_has(@unsermake_ban_list, $module) if ($option eq 'use-unsermake'); - return 0; -} - -# This subroutine returns an option value for a given module. Some -# globals can't be overridden by a module's choice. If so, the -# module's choice will be ignored, and a warning will be issued. -# -# Option names are case-sensitive! -# -# First parameter: Name of module -# Second paramenter: Name of option -sub get_option -{ - my $module = shift; - my $option = shift; - my $global_opts = $package_opts{'global'}; - my $defaultQtCopyArgs = '-qt-gif -plugin-imgfmt-mng -thread -no-exceptions -debug -dlopen-opengl -plugin-sql-sqlite'; - my @lockedOpts = qw(source-dir svn-server qtdir libpath binpath kdedir - pretend disable-agent-check); - - # These options can't override globals - if (list_has(@lockedOpts, $option) or $module eq 'global') - { - return ${$global_opts}{"#$option"} if exists ${$global_opts}{"#$option"}; - return ${$global_opts}{$option}; - } - - # Don't even try this - return 0 if blacklisted($module, $option); - - my $ref = $package_opts{$module}; - - # Check for a sticky option - return $$ref{"#$option"} if exists $$ref{"#$option"}; - - # Next in order of precedence - if (defined ${$global_opts}{"#$option"} and not - ($module eq 'qt-copy' and $option eq 'configure-flags')) - { - return ${$global_opts}{"#$option"}; - } - - # No sticky options left. - # Configure flags and CXXFLAGS are appended to the global option - if (($module ne 'qt-copy' && $option eq 'configure-flags') - || $option eq 'cxxflags') - { - my $value = ${$global_opts}{$option}; - - if(defined $$ref{$option}) - { - my $modvalue = $$ref{$option}; - $value .= " $modvalue"; - } - - return $value; - } - - # As always qt-copy has to be difficult - if ($module eq 'qt-copy' and $option eq 'configure-flags') - { - return $defaultQtCopyArgs if not defined $$ref{$option}; - return $$ref{$option}; - } - - # Everything else overrides the global, unless of course it's not set. - # If we're reading for global options, we're pretty much done. - return $$ref{$option} if defined $$ref{$option}; - return ${$global_opts}{$option}; -} - -# Subroutine used to handle the checkout-only option. It handles -# updating subdirectories of an already-checked-out module. -# First parameter is the module, all remaining parameters are subdirectories -# to check out. -# -# Returns 0 on success, non-zero on failure. -sub update_module_subdirectories -{ - my $module = shift; - my $result; - - # If we have elements in @path, download them now - for my $dir (@_) - { - info "\tUpdating g[$dir]"; - $result = run_svn($module, "svn-up-$dir", [ 'svn', 'up', $dir ]); - return $result if $result; - } - - return 0; -} - -# Returns true if a module has a base component to their name (e.g. KDE/, -# extragear/, or playground). Note that modules that aren't in trunk/KDE -# don't necessary meet this criteria (e.g. kdereview is a module itself). -sub has_base_module -{ - my $module = shift; - - return $module =~ /^(extragear|playground|KDE)(\/[^\/]+)?$/; -} - -# Subroutine to return the directory that a module will be stored in. -# NOTE: The return value is a hash. The key 'module' will return the final -# module name, the key 'path' will return the full path to the module. The -# key 'fullpath' will return their concatenation. -# For example, with $module == 'KDE/tdelibs', and no change in the dest-dir -# option, you'd get something like: -# { -# 'path' => '/home/user/tdesvn/KDE', -# 'module' => 'tdelibs', -# 'fullpath' => '/home/user/tdesvn/KDE/tdelibs' -# } -# If dest-dir were changed to e.g. extragear-multimedia, you'd get: -# { -# 'path' => '/home/user/tdesvn', -# 'module' => 'extragear-multimedia', -# 'fullpath' => '/home/user/tdesvn/extragear-multimedia' -# } -# First parameter is the module. -# Second parameter is either source or build. -sub get_module_path_dir -{ - my $module = shift; - my $type = shift; - my $destdir = get_dest_dir($module); - my $srcbase = get_tdesvn_dir(); - $srcbase = get_build_dir($module) if $type eq 'build'; - - my $combined = "$srcbase/$destdir"; - - # Remove dup // - $combined =~ s/\/+/\//; - - my @parts = split(/\//, $combined); - my %result = (); - $result{'module'} = pop @parts; - $result{'path'} = join('/', @parts); - $result{'fullpath'} = "$result{path}/$result{module}"; - - return %result; -} - -sub get_fullpath -{ - my ($module, $type) = @_; - my %pathinfo = get_module_path_dir($module, $type); - - return $pathinfo{'fullpath'}; -} - -# Checkout a module that has not been checked out before, along with any -# subdirectories the user desires. -# The first parameter is the module to checkout (including extragear and -# playground modules), all remaining parameters are subdirectories of the -# module to checkout. -# Returns 0 on success, non-zero on failure. -sub checkout_module_path -{ - my ($module, @path) = @_; - my %pathinfo = get_module_path_dir($module, 'source'); - my $result; - my @args; - - if (not -e $pathinfo{'path'} and not super_mkdir($pathinfo{'path'})) - { - error "Unable to create path r[$pathinfo{path}]!"; - return 1; - } - - chdir($pathinfo{'path'}); - - push @args, ('svn', 'co'); - push @args, '-N' if scalar @path; - push @args, svn_module_url($module); - push @args, $pathinfo{'module'}; - - note "Checking out g[$module]"; - $result = run_svn($module, 'svn-co', \@args); - return $result if $result; - - chdir($pathinfo{'module'}) if scalar @path; - - return update_module_subdirectories($module, @path); -} - -# Update a module that has already been checked out, along with any -# subdirectories the user desires. -# The first parameter is the module to checkout (including extragear and -# playground modules), all remaining parameters are subdirectories of the -# module to checkout. -# Returns 0 on success, non-zero on failure. -sub update_module_path -{ - my ($module, @path) = @_; - my $fullpath = get_fullpath($module, 'source'); - my $result; - my @args; - - chdir $fullpath; - - push @args, ('svn', 'up'); - push @args, '-N' if scalar @path; - - note "Updating g[$module]"; - - $result = run_svn($module, 'svn-up', \@args); - - if($result) # Update failed, try svn cleanup. - { - info "\tUpdate failed, trying a cleanup."; - $result = safe_system('svn', 'cleanup'); - - return $result if $result; - - info "\tCleanup complete."; - # Now try again. - - $result = run_svn($module, 'svn-up-2', \@args); - } - - return $result if $result; - - # 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 ("$fullpath/admin") if -l "$fullpath/admin"; - - return update_module_subdirectories($module, @path); -} - -# Subroutine to run a command with redirected STDOUT and STDERR. First parameter -# is name of the log file (relative to the log directory), and the -# second parameter is a reference to an array with the command and -# its arguments -sub log_command -{ - my $pid; - my $module = shift; - my $filename = shift; - my @command = @{(shift)}; - my $logdir = get_log_dir($module); - - debug "log_command(): Module $module, Command: ", join(' ', @command); - - if (pretending) - { - pretend "\tWould have run g[", join (' ', @command); - return 0; - } - - if ($pid = fork) - { - # Parent - waitpid $pid, 0; - - # If the module fails building, set an internal flag in the module - # options with the name of the log file containing the error message. - my $result = $?; - set_error_logfile($module, "$filename.log") if $result; - - # If we are using the alias to a tdesvn-build function, it should have - # already printed the error message, so clear out errno (but still - # return failure status). - if ($command[0] eq 'tdesvn-build') - { - $! = 0; - } - - return $result; - } - else - { - # Child - if (not defined $logdir or not -e $logdir) - { - # Error creating directory for some reason. - error "\tLogging to std out due to failure creating log dir."; - } - - # Redirect stdout and stderr to the given file. - if (not debugging) - { -# Comment this out because it conflicts with make-install-prefix -# open (STDIN, "$logdir/$filename.log") or do { - error "Error opening $logdir/$filename.log for logfile."; - # Don't abort, hopefully STDOUT still works. - }; - } - else - { - open (STDOUT, "|tee $logdir/$filename.log") or do { - error "Error opening pipe to tee command."; - # Don't abort, hopefully STDOUT still works. - }; - } - - # Make sure we log everything. If the command is svn, it is possible - # that the client will produce output trying to get a password, so - # don't redirect stderr in that case. - open (STDERR, ">&STDOUT") unless $command[0] eq 'svn'; - - # Call internal function, name given by $command[1] - if($command[0] eq 'tdesvn-build') - { - debug "Calling $command[1]"; - - my $cmd = $command[1]; - splice (@command, 0, 2); # Remove first two elements. - - no strict 'refs'; # Disable restriction on symbolic subroutines. - if (not &{$cmd}(@command)) # Call sub - { - exit EINVAL; - } - - exit 0; - } - - # External command. - exec (@command) or do { - my $cmd_string = join(' ', @command); - error <) - { - chomp; - - # Update terminal (\e[K clears the line) if the percentage - # changed. - if (/([0-9]+)% (creating|compiling|linking)/) - { - print STDERR "\r$1% \e[K" unless ($1 == $last); - $last = $1; - } - } - - close(CHILD); - print STDERR "\r\e[K"; - - # If the module fails building, set an internal flag in the module - # options with the name of the log file containing the error message. - my $result = $?; - set_error_logfile($module, "$filename.log") if $result; - - return $result; - } - else - { - # Child - if (not defined $logdir or not -e $logdir) - { - # Error creating directory for some reason. - error "\tLogging to standard output due to failure creating log dir."; - } - - open (STDOUT, "|tee $logdir/$filename.log") or do { - error "Error opening pipe to tee command." - }; - - # Make sure we log everything. - open (STDERR, ">&STDOUT"); - - exec (@command) or do { - my $cmd_string = join(' ', @command); - error < q(-system-zlib -qt-gif -system-libjpeg -system-libpng - -plugin-imgfmt-mng -thread -no-exceptions -debug - -dlopen-opengl), - 'apply-qt-patches' => 'true', - -# See setup_trinity5_hack() for why this option is here. - 'module-base-path' => 'branches/qt/3.3', - - 'use-qt-builddir-hack' => 'true', - 'use-unsermake' => 0, - 'set-env' => { }, - }; - - # That handy q() construct above kept the newlines, I don't want them. - $package_opts{'qt-copy'}{'conf-flags'} =~ s/\s+/ /gm; -} - -# Reads in the options from the config file and adds them to the option store. -# The first parameter is a reference to the file handle to read from. -# The second parameter is 'global' if we're reading the global section, or -# 'module' if we should expect an end module statement. -sub parse_module -{ - my ($fh, $module) = @_; - $module = 'global' unless $module; - - # Make sure we acknowledge that we read the module name in from the - # file. - if (not defined $package_opts{$module}) - { - $package_opts{$module} = { - 'set-env' => { } - }; - } - - # Read in each option - while (<$fh>) - { - # Handle line continuation - chomp; - - if(s/\\\s*$//) # Replace \ followed by optional space at EOL and try again. - { - $_ .= <$fh>; - redo unless eof($fh); - } - - s/#.*$//; # Remove comments - next if /^\s*$/; # Skip blank lines - - if($module eq 'global') - { - last if /^end\s+global/; # Stop - } - else - { - last if /^end\s+module/; # Stop - } - - # The option is the first word, followed by the - # flags on the rest of the line. The interpretation - # of the flags is dependant on the option. - my ($option, $value) = /^\s* # Find all spaces - ([-\w]+) # First match, alphanumeric, -, and _ - # (?: ) means non-capturing group, so (.*) is $value - # So, skip spaces and pick up the rest of the line. - (?:\s+(.*))?$/x; - - $value = "" unless defined $value; - - # Simplify this. - $value =~ s/\s+$//; - $value =~ s/^\s+//; - $value =~ s/\s+/ /; - - # Check for false keyword and convert it to Perl false. - $value = 0 if lc($value) =~ /^false$/; - - # Replace tildes with home directory. - 1 while ($value =~ s"(^|:|=)~/"$1$ENV{'HOME'}/"); - - set_option($module, $option, $value); - } -} - -# This subroutine reads in the settings from the user's configuration -# file. -sub read_options -{ - # The options are stored in the file $rcfile - my $success = 0; - my $global_opts = $package_opts{'global'}; - for my $file (@rcfiles) - { - if (open CONFIG, "<$file") - { - $success = 1; - $rcfile = $file; - last; - } - } - - if (not $success) - { - if(scalar @rcfiles == 1) - { - # This can only happen if the user uses --rc-file, if we fail to - # load the file, we need to fail to load. - error <) - { - s/#.*$//; # Remove comments - next if (/^\s*$/); # Skip blank lines - - # First command in .tdesvn-buildrc should be a global - # options declaration, even if none are defined. - if (not /^global\s*$/) - { - error "Invalid configuration file: $rcfile."; - error "Expecting global settings section!"; - exit 1; - } - - # Now read in each global option - parse_module(\*CONFIG, 'global'); - last; - } - - my $using_default = 1; - - # Now read in module settings - while () - { - s/#.*$//; # Remove comments - next if (/^\s*$/); # Skip blank lines - - # Get modulename (has dash, dots, slashes, or letters/numbers) - ($modulename) = /^module\s+([-\/\.\w]+)\s*$/; - - if (not $modulename) - { - warning "Invalid configuration file $rcfile!"; - warning "Expecting a start of module section."; - warning "Global settings will be retained."; - - $modulename = 'null'; # Keep reading the module section though. - } - - # Don't build default modules if user has their own wishes. - if ($using_default) - { - $using_default = 0; - @update_list = @build_list = ( ); - } - - parse_module(\*CONFIG, $modulename); - - next if ($modulename eq 'null'); - - # Done reading options, add this module to the update list - push (@update_list, $modulename) unless exists $ignore_list{$modulename}; - - # Add it to the build list, unless the build is only - # supposed to be done manually. - if (not get_option ($modulename, 'manual-build') and not exists $ignore_list{$modulename}) - { - push (@build_list, $modulename); - } - } - - close CONFIG; - - delete $package_opts{'null'}; # Just in case. - - # For the 3.5 edition we want to set the qt-copy option module-base-path - # to branches/qt/3.3 unless the user already has it set. - unless (exists $package_opts{'qt-copy'}{'module-base-path'}) - { - set_option ('qt-copy', 'module-base-path', 'branches/qt/3.3'); - } - - # If the user doesn't ask to build any modules, build a default set. - # The good question is what exactly should be built, but oh well. - setup_default_modules() if $using_default; -} - -# Subroutine to check if the given module needs special treatment to support -# srcdir != builddir. If this function returns true tdesvn-build will use a -# few hacks to simulate it, and will update e.g. configure paths appropriately -# as well. -sub module_needs_builddir_help -{ - my $module = shift; - my @module_help_list = qw/qt-copy tdebindings valgrind/; - - # qt-copy special case to support use-qt-builddir-hack. - if ($module eq 'qt-copy' and not get_option('qt-copy', 'use-qt-builddir-hack')) - { - return 0; - } - - return list_has(@module_help_list, $module); -} - -# This subroutine reads the set-env option for a given module and initializes -# the environment based on that setting. -sub setup_module_environment -{ - my $module = shift; - my ($key, $value); - - # Let's see if the user has set env vars to be set. - my $env_hash_ref = get_option($module, 'set-env'); - while (($key, $value) = each %{$env_hash_ref}) - { - setenv($key, $value); - } -} - -# Subroutine to initialize some environment variable for building -# KDE from Subversion. Change this section if a dependency changes later. -sub initialize_environment -{ - $ENV{"WANT_AUTOMAKE"} = "1.7"; - $ENV{"WANT_AUTOCONF_2_5"} = "1"; - $ENV{"PATH"} = get_option ('global', 'binpath'); - - my $svnserver = get_option ('global', 'svn-server'); - - my $pc_path = get_option('global', 'kdedir') . "/lib/pkgconfig"; - $pc_path .= ":" . $ENV{'PKG_CONFIG_PATH'} if ( exists $ENV{'PKG_CONFIG_PATH'} ); - $ENV{'PKG_CONFIG_PATH'} = $pc_path; - - if(-t STDOUT and get_option('global', 'colorful-output')) - { - $RED = "\e[31m"; - $GREEN = "\e[32m"; - $YELLOW = "\e[33m"; - $NORMAL = "\e[0m"; - $BOLD = "\e[1m"; - } - - # Set the process priority - setpriority PRIO_PROCESS, 0, get_option('global', 'niceness'); - - setup_module_environment ('global'); -} - -# Subroutine to get a list of modules to install, either from the command line -# if it's not empty, or based on the list of modules successfully built. -sub get_install_list -{ - my @install_list; - - if ($#ARGV > -1) - { - @install_list = @ARGV; - @ARGV = (); - } - else - { - # Get list of built items from $logdir/latest/build-status - my $logdir = get_subdir_path('global', 'log-dir'); - - if (not open BUILTLIST, "<$logdir/latest/build-status") - { - error "Can't determine what modules have built. You must"; - error "specify explicitly on the command line what modules to build."; - exit (1); # Don't finish, no lock has been taken. - } - - while () - { - chomp; - if (/Succeeded/) - { - # Clip to everything before the first colon. - my $module = (split(/:/))[0]; - push @install_list, $module; - } - } - - close BUILTLIST; - } - - return @install_list; -} - -# Print out an error message, and a list of modules that match that error -# message. It will also display the log file name if one can be determined. -# The message will be displayed all in uppercase, with PACKAGES prepended, so -# all you have to do is give a descriptive message of what this list of -# packages failed at doing. -sub output_failed_module_list($@) -{ - my ($message, @fail_list) = @_; - $message = uc $message; # Be annoying - - debug "Message is $message"; - debug "\tfor ", join(', ', @fail_list); - - if (scalar @fail_list > 0) - { - my $homedir = $ENV{'HOME'}; - my $logfile; - - warning "\nr[b[<<< PACKAGES $message >>>]"; - - for (@fail_list) - { - $logfile = get_option($_, '#error-log-file'); - $logfile = "No log file" unless $logfile; - $logfile =~ s|$homedir|~|; - - warning "r[$_] - g[$logfile]"; - } - } -} - -# This subroutine reads the fail_lists dictionary to automatically call -# output_failed_module_list for all the module failures in one function -# call. -sub output_failed_module_lists() -{ - for my $type (@fail_display_order) - { - my @failures = @{$fail_lists{$type}}; - output_failed_module_list("failed to $type", @failures); - } -} - -# This subroutine extract the value from options of the form --option=value, -# which can also be expressed as --option value. The first parameter is the -# option that the user passed to the cmd line (e.g. --prefix=/opt/foo), and -# the second parameter is a reference to the list of command line options. -# The return value is the value of the option (the list might be shorter by -# 1, copy it if you don't want it to change), or undef if no value was -# provided. -sub extract_option_value($\@) -{ - my ($option, $options_ref) = @_; - - if ($option =~ /=/) - { - my @value = split(/=/, $option); - shift @value; # We don't need the first one, that the --option part. - - return undef if (scalar @value == 0); - - # If we have more than one element left in @value it's because the - # option itself has an = in it, make sure it goes back in the answer. - return join('=', @value); - } - - return undef if scalar @{$options_ref} == 0; - return shift @{$options_ref}; -} - -# Utility subroutine to handle setting the environment variable type of value. -# Returns true (non-zero) if this subroutine handled everything, 0 otherwise. -# The first parameter should by the reference to the hash with the 'set-env' -# hash ref, second parameter is the exact option to check, and the third -# option is the value to set that option to. -sub handle_set_env -{ - my ($href, $option, $value) = @_; - - return 0 if $option !~ /^#?set-env$/; - - my ($var, @values) = split(' ', $value); - - $$href{$option} = ( ) unless exists $$href{$option}; - $$href{$option}{$var} = join(' ', @values); - - return 1; -} - -# Sets the option for the given module to the given value. If the data for the -# module doesn't exist yet, it will be defined starting with a default value. -# First parameter: module to set option for (or 'global') -# Second parameter: option name (Preceded by # for a sticky option) -# Third parameter: option value -# Return value is void -sub set_option -{ - my ($module, $option, $value) = @_; - - # Set module options - if (not exists $package_opts{$module}) - { - $package_opts{$module} = { - 'set-env' => { } - }; - } - - return if handle_set_env($package_opts{$module}, $option, $value); - $package_opts{$module}{$option} = $value; -} - -# Subroutine to process the command line arguments. Any arguments so -# processed will be removed from @ARGV. -# The arguments are generally documented in doc.html now. -# NOTE: Don't call finish() from this routine, the lock hasn't been obtained. -# NOTE: The options have not been loaded yet either. Any option which -# requires more than rudimentary processing should set a flag for later work. -sub process_arguments -{ - my $arg; - my $version = "tdesvn-build 0.97.6 (KDE 3.5 Edition)"; - my $author = < - -Many people have contributed code, bugfixes, and documentation. - -Please report bugs using the KDE Bugzilla, at http://bugs.kde.org/ -DONE - - my @argv; - - while ($_ = shift @ARGV) - { - SWITCH: { - /^(--version)$/ && do { print "$version\n"; exit; }; - /^--author$/ && do { print $author; exit; }; - /^(-h)|(--?help)$/ && do { - print < Read configuration from filename instead of default. - --nice= Allows you to run the script with a lower priority - The default value is 10 (lower priority by 10 steps). - --prefix=/kde/path This option is a shortcut to change the setting for - kdedir from the command line. It implies - --reconfigure. - - --resume Tries to resume the make process from the last time - the script was run, without performing the Subversion - update. - --resume-from= Starts building from the given package, without - performing the Subversion update. - --revision (or -r)= Forces update to revision from Subversion. - - --refresh-build Start the build from scratch. - --reconfigure Run configure again, but don't clean the build - directory or re-run make -f Makefile.cvs. - --recreate-configure Run make -f Makefile.cvs again to redo the configure - script. - --no-rebuild-on-fail Don't try to rebuild a module from scratch if it - failed building and we didn't already try to build it - from scratch. - --build-system-only Create the build infrastructure, but don't actually - perform the build. - --install Try to install the packages passed on the command - line, or all packages in ~/.tdesvn-buildrc that don't - have manual-build set. Building and Subversion - updates are not performed. - - --