Fixes for building spread-sheet-widget as part of the build.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 17 Sep 2017 17:06:35 +0000 (10:06 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 17 Sep 2017 17:06:35 +0000 (10:06 -0700)
build-pspp
results2html

index 811a39f33defc373e8b70d96176e6f9306dded0e..16c19cf0e8c781910c9724fcf83b164fee6c9903 100755 (executable)
@@ -15,10 +15,13 @@ my $build_binary = 1;
 my $batch = 0;
 my $builddir;
 my $build_number;
 my $batch = 0;
 my $builddir;
 my $build_number;
+my $builder = `hostname`;
+chomp $builder;
 GetOptions ("h|help" => \$help,
            "binary!" => \$build_binary,
            "batch!" => \$batch,
            "o|output=s" => \$builddir,
 GetOptions ("h|help" => \$help,
            "binary!" => \$build_binary,
            "batch!" => \$batch,
            "o|output=s" => \$builddir,
+           "builder=s" => \$builder,
            "build-number=i" => \$build_number);
 
 usage () if $help;
            "build-number=i" => \$build_number);
 
 usage () if $help;
@@ -61,9 +64,7 @@ VARS->autoflush (1);
 our $logfile = "$resultsdir/LOG";
 open (LOG, '>', $logfile) or die "creating $logfile failed: $!\n";
 
 our $logfile = "$resultsdir/LOG";
 open (LOG, '>', $logfile) or die "creating $logfile failed: $!\n";
 
-my $build_host = `hostname`;
-chomp $build_host;
-set_var ("build_host", $build_host);
+set_var ("builder", $builder);
 set_var ("build_number", $build_number);
 
 our $GIT = "git --git-dir=$topdir/.git";
 set_var ("build_number", $build_number);
 
 our $GIT = "git --git-dir=$topdir/.git";
@@ -124,9 +125,23 @@ sub ref_to_commit {
     return $commit;
 }
 
     return $commit;
 }
 
+my $ssw = "spread-sheet-widget-0.1";
 if (@ARGV == 2) {
     my ($repo, $branch) = @ARGV;
 
 if (@ARGV == 2) {
     my ($repo, $branch) = @ARGV;
 
+    my $ssw_tar = "$topdir/$ssw.tar.gz";
+    start_step ("Extract spread-sheet-widget");
+    run ("tar xzf $ssw_tar");
+
+    start_step ("Configure spread-sheet-widget");
+    run ("cd $ssw && ./configure --prefix=''");
+
+    start_step ("Build spread-sheet-widget");
+    run ("cd $ssw && make -j10");
+
+    start_step ("Install spread-sheet-widget");
+    run ("cd $ssw && make -j10 install DESTDIR=\$PWD/inst");
+
     start_step ("Fetch branch from Git");
     set_var ("git_repo", $repo);
     set_var ("git_branch", $branch);
     start_step ("Fetch branch from Git");
     set_var ("git_repo", $repo);
     set_var ("git_branch", $branch);
@@ -221,7 +236,7 @@ if (@ARGV == 2) {
 Changes from $repo_version to $version:
 
  * Built from PSPP commit $revision
 Changes from $repo_version to $version:
 
  * Built from PSPP commit $revision
-   in branch $branch on host $build_host.
+   in branch $branch on builder $builder.
 
  * Built from Gnulib commit $gnulib_commit.
 
 
  * Built from Gnulib commit $gnulib_commit.
 
@@ -249,11 +264,11 @@ EOF
 
     # Bootstrap.
     start_step ("Bootstrap (make -f Smake)");
 
     # Bootstrap.
     start_step ("Bootstrap (make -f Smake)");
-    run ("cd pspp && make -f Smake", "bootstrap");
+    run ("cd pspp && make -f Smake -j10", "bootstrap");
 
     # Configure.
     start_step ("Configure source");
 
     # Configure.
     start_step ("Configure source");
-    run ("cd pspp && mkdir _build && cd _build && ../configure", "configure");
+    run ("cd pspp && mkdir _build && cd _build && ../configure PKG_CONFIG_PATH=\$PWD/../../../source/$ssw/inst/lib/pkgconfig", "configure");
 
     # Distribute.
     start_step ("Make source tarball");
 
     # Distribute.
     start_step ("Make source tarball");
@@ -268,15 +283,15 @@ EOF
 
     # Build user manual
     start_step ("Build user manual");
 
     # Build user manual
     start_step ("Build user manual");
-    run ("cd pspp && GENDOCS_TEMPLATE_DIR=$topdir $topdir/gendocs.sh -s doc/pspp.texinfo -I doc -o $resultsdir/user-manual --email bug-gnu-pspp\@gnu.org pspp \"GNU PSPP User Manual\"", "user-manual");
+    run ("cd pspp && GENDOCS_TEMPLATE_DIR=$topdir $topdir/gendocs.sh -s doc/pspp.texi -I doc -o $resultsdir/user-manual --email bug-gnu-pspp\@gnu.org pspp \"GNU PSPP User Manual\"", "user-manual");
     saved_result ("User Manual", "user-manual");
 
     # Build developer's guide
     start_step ("Build developers guide");
     saved_result ("User Manual", "user-manual");
 
     # Build developer's guide
     start_step ("Build developers guide");
-    run ("cd pspp && GENDOCS_TEMPLATE_DIR=$topdir $topdir/gendocs.sh -s doc/pspp-dev.texinfo -I doc -o $resultsdir/dev-guide --email bug-gnu-pspp\@gnu.org pspp-dev \"GNU PSPP Developers Guide\"", "dev-guide");
+    run ("cd pspp && GENDOCS_TEMPLATE_DIR=$topdir $topdir/gendocs.sh -s doc/pspp-dev.texi -I doc -o $resultsdir/dev-guide --email bug-gnu-pspp\@gnu.org pspp-dev \"GNU PSPP Developers Guide\"", "dev-guide");
     saved_result ("Developers Guide", "dev-guide");
 } else {
     saved_result ("Developers Guide", "dev-guide");
 } else {
-    $tarball = saved_result ("source distribution", $tarball);
+    start_step ("Starting from $tarball");
 }
 
 if ($build_binary) {
 }
 
 if ($build_binary) {
@@ -297,7 +312,7 @@ if ($build_binary) {
     my ($version) = `cd $builddir/$tarball_dir && ./configure --version | head -1`
       =~ /configure (\S+)$/;
     set_var ("dist_version", $version);
     my ($version) = `cd $builddir/$tarball_dir && ./configure --version | head -1`
       =~ /configure (\S+)$/;
     set_var ("dist_version", $version);
-    my ($binary_version) = "$version-$build_host-build$build_number";
+    my ($binary_version) = "$version-$builder-build$build_number";
     set_var ("binary_version", $binary_version);
 
     start_step ("Configuring");
     set_var ("binary_version", $binary_version);
 
     start_step ("Configuring");
@@ -305,7 +320,7 @@ if ($build_binary) {
     run ("chmod u+w $builddir/$tarball_dir");
     run ("mkdir $builddir/$tarball_dir/_build");
     run ("chmod a-w $builddir/$tarball_dir");
     run ("chmod u+w $builddir/$tarball_dir");
     run ("mkdir $builddir/$tarball_dir/_build");
     run ("chmod a-w $builddir/$tarball_dir");
-    my $ok = try_run ("cd $builddir/$tarball_dir/_build && ../configure --enable-relocatable --prefix=''", "bin-configure");
+    my $ok = try_run ("cd $builddir/$tarball_dir/_build && ../configure --enable-relocatable --prefix='' PKG_CONFIG_PATH=\$PWD/../../../source/$ssw/inst/lib/pkgconfig CPPFLAGS=\"-I\$PWD/../../../source/$ssw/inst/include\" LDFLAGS=\"-L\$PWD/../../../source/$ssw/inst/lib\"", "bin-configure");
     for my $basename ("config.h", "config.log") {
        save_result_if_exists ("build configuration",
                               "$builddir/$tarball_dir/_build/$basename");
     for my $basename ("config.h", "config.log") {
        save_result_if_exists ("build configuration",
                               "$builddir/$tarball_dir/_build/$basename");
@@ -313,10 +328,11 @@ if ($build_binary) {
     fail () if !$ok;
 
     start_step ("Build");
     fail () if !$ok;
 
     start_step ("Build");
-    run ("cd $builddir/$tarball_dir/_build && make -j2", "build");
+    run ("cd $builddir/$tarball_dir/_build && make -j10", "build");
 
     start_step ("Install");
     run ("cd $builddir/$tarball_dir/_build && make install DESTDIR=\$PWD/pspp-$binary_version", "install");
 
     start_step ("Install");
     run ("cd $builddir/$tarball_dir/_build && make install DESTDIR=\$PWD/pspp-$binary_version", "install");
+    run ("cd ../source/$ssw && make -j10 install DESTDIR=$builddir/$tarball_dir/_build/pspp-$binary_version");
 
     start_step ("Make binary distribution");
     run ("cd $builddir/$tarball_dir/_build && tar cfz pspp-$binary_version.tar.gz pspp-$binary_version");
 
     start_step ("Make binary distribution");
     run ("cd $builddir/$tarball_dir/_build && tar cfz pspp-$binary_version.tar.gz pspp-$binary_version");
@@ -330,6 +346,7 @@ if ($build_binary) {
     fail () if !$ok;
 
     start_step ("Uninstall");
     fail () if !$ok;
 
     start_step ("Uninstall");
+    run ("cd ../source/$ssw && make -j10 uninstall DESTDIR=$builddir/$tarball_dir/_build/pspp-$binary_version");
     run ("cd $builddir/$tarball_dir/_build && make uninstall DESTDIR=\$PWD/pspp-$binary_version", "uninstall");
 
     start_step ("Check uninstall");
     run ("cd $builddir/$tarball_dir/_build && make uninstall DESTDIR=\$PWD/pspp-$binary_version", "uninstall");
 
     start_step ("Check uninstall");
index 1e8ea802226110c44f73f6b883ddd2b288e2bbdd..988b1e26724566a60c810a330d7be6ac93ba86c2 100755 (executable)
@@ -80,7 +80,7 @@ while (<LOG>) {
            $p{HREF} = $href;
            $p{LN} = $ln;
            push (@products, \%p);
            $p{HREF} = $href;
            $p{LN} = $ln;
            push (@products, \%p);
-           push (@{$steps[$#steps]{CHILDREN}}, \%p);
+           push (@{$steps[$#steps]{CHILDREN}}, \%p) if @steps;
 
            if (defined ($name) && $name eq 'source distribution') {
                open (DIST, '-|', "zcat $product | tar tf -");
 
            if (defined ($name) && $name eq 'source distribution') {
                open (DIST, '-|', "zcat $product | tar tf -");