Title: [101708] trunk/Tools
Revision
101708
Author
[email protected]
Date
2011-12-01 14:25:00 -0800 (Thu, 01 Dec 2011)

Log Message

[GTK] Add freetype to our jhbuild setup
https://bugs.webkit.org/show_bug.cgi?id=73488

Reviewed by Martin Robinson.

This adds the first library to our jhbuild setup, and makes sure
build-webkit calls autogen.sh and make with jhbuild, so that the
environment is properly set.

* Scripts/webkitdirs.pm:
(saveSum):
(hashFile):
(runAutogenForAutotoolsProject): save md5sum of jhbuild-related files, and
call autogen under jhbuild run;
(mustRunAutogen): generalized the arguments change checking to also force
running autogen when jhbuild files change;
(buildAutotoolsProject): run make under jhbuild;
* gtk/jhbuild.modules: add freetype.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (101707 => 101708)


--- trunk/Tools/ChangeLog	2011-12-01 22:22:41 UTC (rev 101707)
+++ trunk/Tools/ChangeLog	2011-12-01 22:25:00 UTC (rev 101708)
@@ -1,3 +1,24 @@
+2011-12-01  Gustavo Noronha Silva  <[email protected]>
+
+        [GTK] Add freetype to our jhbuild setup
+        https://bugs.webkit.org/show_bug.cgi?id=73488
+
+        Reviewed by Martin Robinson.
+
+        This adds the first library to our jhbuild setup, and makes sure
+        build-webkit calls autogen.sh and make with jhbuild, so that the
+        environment is properly set.
+
+        * Scripts/webkitdirs.pm:
+        (saveSum):
+        (hashFile):
+        (runAutogenForAutotoolsProject): save md5sum of jhbuild-related files, and
+        call autogen under jhbuild run;
+        (mustRunAutogen): generalized the arguments change checking to also force
+        running autogen when jhbuild files change;
+        (buildAutotoolsProject): run make under jhbuild;
+        * gtk/jhbuild.modules: add freetype.
+
 2011-12-01  Dominic Mazzoni  <[email protected]>
 
         Fix WebKitTestRunner compile warnings with XCode 3.2

Modified: trunk/Tools/Scripts/webkitdirs.pm (101707 => 101708)


--- trunk/Tools/Scripts/webkitdirs.pm	2011-12-01 22:22:41 UTC (rev 101707)
+++ trunk/Tools/Scripts/webkitdirs.pm	2011-12-01 22:25:00 UTC (rev 101708)
@@ -31,6 +31,7 @@
 use strict;
 use warnings;
 use Config;
+use Digest::MD5 qw(md5_hex);
 use FindBin;
 use File::Basename;
 use File::Path qw(mkpath rmtree);
@@ -83,6 +84,7 @@
 my $isQt;
 my $qmakebin = "qmake"; # Allow override of the qmake binary from $PATH
 my $isGtk;
+my @jhbuildArgs;
 my $isWinCE;
 my $isWinCairo;
 my $isWx;
@@ -1562,6 +1564,23 @@
     return $prefix . '-' . $feature;
 }
 
+sub getMD5HashForFile($)
+{
+    my $file = shift;
+
+    open(FILE_CONTENTS, $file);
+
+    # Read the whole file.
+    my $contents = "";
+    while (<FILE_CONTENTS>) {
+        $contents .= $_;
+    }
+
+    close(FILE_CONTENTS);
+
+    return md5_hex($contents);
+}
+
 sub runAutogenForAutotoolsProject($@)
 {
     my ($dir, $prefix, $sourceDir, $saveArguments, $argumentsFile, @buildArgs) = @_;
@@ -1569,6 +1588,14 @@
     print "Calling autogen.sh in " . $dir . "\n\n";
     print "Installation prefix directory: $prefix\n" if(defined($prefix));
 
+    # Save md5sum for jhbuild-related files.
+    foreach my $file (qw(jhbuildrc jhbuild.modules)) {
+        my $path = join('/', $sourceDir, 'Tools', 'gtk', $file);
+        open(SUM, ">$file");
+        print SUM getMD5HashForFile($path);
+        close(SUM);
+    }
+
     if ($saveArguments) {
         # Write autogen.sh arguments to a file so that we can detect
         # when they change and automatically re-run it.
@@ -1580,15 +1607,22 @@
     # Make the path relative since it will appear in all -I compiler flags.
     # Long argument lists cause bizarre slowdowns in libtool.
     my $relSourceDir = File::Spec->abs2rel($sourceDir) || ".";
-    if (system("$relSourceDir/autogen.sh", @buildArgs) ne 0) {
+
+    # Prefix the command with jhbuild run.
+    unshift(@buildArgs, "$relSourceDir/autogen.sh");
+    unshift(@buildArgs, @jhbuildArgs);
+
+    if (system(@buildArgs) ne 0) {
         die "Calling autogen.sh failed!\n";
     }
 }
 
-sub autogenArgumentsHaveChanged($@)
+sub mustReRunAutogen($@)
 {
-    my ($filename, @currentArguments) = @_;
+    my ($sourceDir, $filename, @currentArguments) = @_;
 
+    @jhbuildArgs = ("jhbuild", "-f", "$sourceDir/Tools/gtk/jhbuildrc", "run");
+
     if (! -e $filename) {
         return 1;
     }
@@ -1604,6 +1638,27 @@
         return 1;
     }
 
+    # Now check jhbuild configuration for changes.
+    foreach my $file (qw(jhbuildrc.md5sum jhbuild.modules.md5sum)) {
+        if (! -e $file) {
+            return 1;
+        }
+
+        # Get the md5 sum of the file we're testing.
+        $file =~ m/(.+)\.md5sum/;
+        my $actualFile = join('/', $sourceDir, 'Tools', 'gtk', $1);
+        my $currentSum = getMD5HashForFile($actualFile);
+
+        # Get our previous record.
+        open(PREVIOUS_MD5, $file);
+        chomp(my $previousSum = <PREVIOUS_MD5>);
+        close(PREVIOUS_MD5);
+
+        if ($previousSum ne $currentSum) {
+            return 1;
+        }
+    }
+
     return 0;
 }
 
@@ -1679,19 +1734,20 @@
         runAutogenForAutotoolsProject($dir, $prefix, $sourceDir, $buildingWebKit, $autogenArgumentsFile, @buildArgs);
     }
 
-    if ($buildingWebKit and autogenArgumentsHaveChanged($autogenArgumentsFile, @buildArgs)) {
+    if ($buildingWebKit and mustReRunAutogen($sourceDir, $autogenArgumentsFile, @buildArgs)) {
         runAutogenForAutotoolsProject($dir, $prefix, $sourceDir, $buildingWebKit, $autogenArgumentsFile, @buildArgs);
     }
 
-    if (system("$make $makeArgs") ne 0) {
+    my $jhbuild = join(' ', @jhbuildArgs);
+    if (system("$jhbuild $make $makeArgs") ne 0) {
         die "\nFailed to build WebKit using '$make'!\n";
     }
 
     chdir ".." or die;
 
-    if (isGtk() && $buildingWebKit) {
+    if ($buildingWebKit) {
         my $relativeScriptsPath = relativeScriptsDir();
-        if (system("$relativeScriptsPath/../gtk/generate-gtkdoc --skip-html")) {
+        if (system("$jhbuild $relativeScriptsPath/../gtk/generate-gtkdoc --skip-html")) {
             die "\n gtkdoc did not build without warnings\n";
         }
     }

Modified: trunk/Tools/gtk/jhbuild.modules (101707 => 101708)


--- trunk/Tools/gtk/jhbuild.modules	2011-12-01 22:22:41 UTC (rev 101707)
+++ trunk/Tools/gtk/jhbuild.modules	2011-12-01 22:25:00 UTC (rev 101708)
@@ -1,24 +1 @@
-<?xml version="1.0"?>
-<!DOCTYPE moduleset SYSTEM "moduleset.dtd">
-<?xml-stylesheet type="text/xsl" href=""
-<moduleset>
-
-  <metamodule id="webkitgtk-testing-dependencies">
-    <dependencies>
-      <dep package="fonts"/>
-    </dependencies>
-  </metamodule>
-
-  <repository type="tarball" name="github.com"
-      href=""
-
-  <autotools id="fonts"
-             skip-autogen="true">
-    <branch module="downloads/mrobinson/webkitgtk-test-fonts/webkitgtk-test-fonts-0.0.1.tar.gz" version="0.0.1"
-            repo="github.com"
-            hash="sha256:df40960ec98bd23de2f6ea8f5135ffc9485929aeddb4f08be5144881a1fd3887"
-            md5sum="2c752a694f41f3ff7aed6e3015250f69" size="6635293">
-    </branch>
-  </autotools>
-
-</moduleset>
+74be16979710d4c4e7c6647856088456
\ No newline at end of file
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to