[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/kdesvn-build-1.10
From:       Michael Pyne <mpyne () purinchu ! net>
Date:       2009-06-03 4:17:05
Message-ID: 1244002625.663947.3758.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 976928 by mpyne:

Add support for checking out the git version of Qt to kdesvn-build.


 M  +79 -76    kdesvn-build  


--- branches/work/kdesvn-build-1.10/kdesvn-build #976927:976928
@@ -298,7 +298,6 @@
 # if the option is actually set.
 our %package_opts = (
   'global' => {
-    "apply-qt-patches"    => "",
     "async"               => 1,
     "binpath"             => $ENV{'PATH'},
     "branch"              => "",
@@ -337,6 +336,7 @@
     "reconfigure"         => "",
     "refresh-build"       => "",
     "remove-after-install"=> "none", # { none, builddir, all }
+    "repository"          => '',     # qt-copy's git repo
     "revision"            => 0,
     "run-tests"           => 0,
     "set-env"             => { }, # Hash of environment vars to set
@@ -928,6 +928,9 @@
 
     return 1 if $module =~ /^l10n-kde4\/?/;
 
+    # No CMakeLists?  Expected for qt-copy
+    return 0 if $module eq 'qt-copy';
+
     # No CMakeLists.txt found, if the directory existed don't use CMake,
     # otherwise assume we are using CMake for now.
 
@@ -1659,7 +1662,9 @@
     whisper "Finding snapshot for g[$module]";
 
     # Don't bother with snapshot if the user has their own URL picked out.
-    if (get_option($module, 'override-url') or get_option($module, 'module-base-path'))
+    if (get_option($module, 'override-url') or
+        get_option($module, 'module-base-path') or
+        $module eq 'qt-copy') # Uses git.
     {
         return 0;
     }
@@ -1980,6 +1985,62 @@
     }
 }
 
+# Perform a git clone to checkout the latest branch of either the official
+# Qt Software Qt 4, or the KDE-Qt repository (essentially the old qt-copy
+# with patches applied).
+#
+# First parameter is the module to perform the checkout of.
+# Second parameter is the repository (typically URL) to use.
+# Returns boolean true if successful, false otherwise.
+sub git_clone_module
+{
+    my $module = shift;
+    my $git_repo = shift;
+    my $srcdir = get_fullpath($module, 'source');
+
+    my $result = log_command($module, 'git-clone', ['git', 'clone', '--', $git_repo, $srcdir]);
+    return ($result == 0);
+}
+
+# Updates an already existing git checkout by running git pull.
+#
+# First parameter is the module to download.
+# Returns boolean true if successful, otherwise 0.
+sub git_update_module
+{
+    my $module = shift;
+    my $srcdir = get_fullpath($module, 'source');
+
+    p_chdir($srcdir);
+    my $result = log_command($module, 'git-pull', ['git', 'pull']);
+
+    return ($result == 0);
+}
+
+# Either performs the initial checkout or updates the current git checkout for qt-copy,
+# as appropriate.
+#
+# If errors are encountered, an exception is raised using die().
+#
+# Returns the number of files updated (actually it just returns 0 now, but maybe someday)
+sub update_qt_checkout()
+{
+    my $module = 'qt-copy'; # bwahaha, not shift for once
+    my $srcdir = get_fullpath($module, 'source');
+
+    if (-e $srcdir) {
+        git_update_module($module) or die "Can't update $module: $!";
+    }
+    else {
+        my $git_repo = get_option($module, 'git-repository');
+        $git_repo = 'qt/qt.git' unless $git_repo;
+
+        git_clone_module($module, "git://qt.gitorious.org/$git_repo") or die "Can't checkout $module: $!";
+    }
+
+    return 0;
+}
+
 # Checkout a module that has not been checked out before, along with any
 # subdirectories the user desires.
 #
@@ -2628,12 +2689,10 @@
     # here will default to global{'branch'}.
     my %branched_modules_exceptions = (
         '4.0' => {
-            'qt-copy'    => '4.4',
             'kdesupport' => 'tags/kdesupport-for-4.1', # See below.
             'phonon'     => '4.2',   # Weird, I know.
         },
         '4.1' => {
-            'qt-copy'    => '4.4',
             'kdesupport' => 'tags/kdesupport-for-4.1', # tags/ is special here (i.e. no branch)
             'phonon'     => '4.2',   # Weird, I know.
         },
@@ -2646,6 +2705,9 @@
     my $branch = get_option('global', 'branch');
     my $default = 'trunk';
 
+    # Go go gadget git!
+    $default = 'master' if $module eq 'qt-copy';
+
     # If the module doesn't normally get branched there's not much we can do, so we'll just
     # return the default. (We search against regexps instead of module names here)
     if (scalar grep { $module =~ $_ } @unbranched_modules)
@@ -2775,11 +2837,10 @@
 
     # Setup default options for qt-copy
     $package_opts{'qt-copy'} = {
-        'configure-flags' => '-qt-gif -no-phonon -qdbus -nomake demos -nomake examples -no-exceptions -fast',
-        'apply-qt-patches' => 1,
+        'configure-flags' => '-qt-gif -no-phonon -qdbus -nomake demos -nomake examples -fast',
         'branch'  => default_module_branch('qt-copy'),
+        'repository' => 'qt/qt.git',
         'set-env' => { },
-        'make-options' => get_option('global', 'make-options'),
     };
 
     # kdesupport needs to be told to avoid phonon.
@@ -4395,7 +4456,10 @@
         my $count;
 
         eval {
-            if (-e "$fullpath/.svn")
+            if ($module eq 'qt-copy') {
+                $count = update_qt_checkout();
+            }
+            elsif (-e "$fullpath/.svn")
             {
                 # Warn user if the current repo URL is different than expected.
                 check_module_validity($module);
@@ -4436,23 +4500,6 @@
     return $hadError;
 }
 
-# Subroutine to run the qt-copy apply_patches script.
-# Returns 0 on success, non-zero on failure.
-sub safe_apply_patches
-{
-    my $srcdir = get_fullpath('qt-copy', 'source');
-
-    if (pretending)
-    {
-        pretend "\tWould have run g[./apply_patches]";
-        return 0;
-    }
-
-    info "\tg[Applying recommended Qt patches].";
-    p_chdir ($srcdir);
-    return (log_command('qt-copy', 'apply-patches', [ "./apply_patches" ]));
-}
-
 # Returns a hash digest of the given options in the list.  The return value is
 # base64-encoded at this time.
 #
@@ -4479,6 +4526,7 @@
     my $script = "$srcdir/configure";
 
     my @commands = split (/\s+/, get_option($module, 'configure-flags'));
+    push @commands, '-confirm-license', '-opensource';
 
     # Get the user's CXXFLAGS
     my $cxxflags = get_option ($module, 'cxxflags');
@@ -4525,7 +4573,7 @@
     my $qtdir = get_fullpath('qt-copy', 'source');
     my $builddir = get_fullpath($module, 'build');
 
-    $script = "$qtdir/configure.new" if $module eq 'qt-copy';
+    $script = "$qtdir/configure" if $module eq 'qt-copy';
     unshift @commands, $script;
 
     my $old_flags = get_persistent_option($module, 'last-configure-flags') || '';
@@ -4535,33 +4583,8 @@
        (not -e "$builddir/Makefile")
       )
     {
-        # Create specialized configure script for qt-copy.
-        debug "Creating g[$qtdir/configure.new] from g[$script]";
+        note "\tb[r[LGPL license selected for Qt].  See $srcdir/LICENSE.LGPL";
 
-        if(not pretending)
-        {
-            # Copy the configure script to accept the GPL license.
-
-            # $script should point to $srcdir/qt-copy/configure for both Qt
-            # 3 and 4.
-
-            open CONFIG, "<$qtdir/configure";
-            open NEWCONFIG, ">$qtdir/configure.new";
-
-            while(<CONFIG>)
-            {
-                s/read acceptance/acceptance=yes/;
-                print NEWCONFIG $_;
-            }
-
-            close NEWCONFIG;
-            close CONFIG;
-
-            chmod 0755, "$qtdir/configure.new";
-        }
-
-        note "\tb[r[GPL license selected for Qt].  See $srcdir/LICENSE.GPL";
-
         info "\tRunning g[configure]...";
 
         set_persistent_option($module, 'last-configure-flags', get_list_digest(@commands));
@@ -5045,7 +5068,6 @@
     my $srcdir = get_fullpath($module, 'source');
     my $builddir = get_fullpath($module, 'build');
     my $uses_cmake = module_uses_cmake($module);
-    my $do_makeconf = 0;
 
     # As a special case to the normal instances where we will rebuild a module,
     # also force a rebuild if we're using CMake but the current build directory
@@ -5061,10 +5083,6 @@
             info "\t\ty[Rebuild forced] due to switch of build system to CMake.";
         }
 
-        # Define this option to tell later functions that we tried to rebuild
-        # this module.
-        set_option($module, '#was-rebuilt', 1);
-
         # Check to see if we're actually supposed to go through the cleaning
         # process.
         if (not get_option($module, '#cancel-clean') and
@@ -5073,8 +5091,6 @@
             warning "\tUnable to clean r[$module]!";
             return 0;
         }
-
-        $do_makeconf = 1;
     }
 
     # Symlink source directory to build directory if module doesn't support
@@ -5096,13 +5112,6 @@
     # its builddir will have a CMakeLists.txt
     if ($module =~ /^l10n-kde4\/?/)
     {
-        $do_makeconf = 1;
-    }
-
-    if ($do_makeconf or (not $uses_cmake and not -e "$confpath/configure"))
-    {
-        whisper "\ty[Recreating configure script].";
-
         if (safe_create_build_system ($module))
         {
             error "\tUnable to create configure system from checkout.";
@@ -5110,15 +5119,6 @@
         }
 
         set_option($module, '#reconfigure', 1); # Force reconfigure of the module
-
-        if ($module eq "qt-copy" and get_option($module, 'apply-qt-patches'))
-        {
-            # Run apply-patches script
-            return 0 if safe_apply_patches ();
-        }
-
-        # Check to see if we're supposed to stop here
-        return 1 if get_option ($module, 'build-system-only');
     }
 
     if (not -e "$builddir" and not super_mkdir("$builddir"))
@@ -5299,10 +5299,13 @@
 # runs svn st and looks for "^C".
 #
 # First parameter is the module to check for conflicts on.
-# Returns boolean true if a conflict exists, false otherwise.
+# Returns 0 if a conflict exists, non-zero otherwise.
 sub module_has_conflict
 {
     my $module = shift;
+
+    return 1 if $module eq 'qt-copy'; # git strikes again
+
     my $srcdir = get_fullpath($module, 'source');
 
     if (get_option($module, 'no-svn'))
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic