Subversion Repositories DevTools

Rev

Rev 4270 | Rev 4789 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4270 Rev 4275
Line 1... Line 1...
1
########################################################################
1
########################################################################
2
# Copyright (C) 2008 ERG Limited, All rights reserved
2
# Copyright (C) 2014 Vix Technology, All rights reserved
3
#
3
#
4
# Module name   : BuildQt.pl
4
# Module name   : shellbuild_windows.pl
5
# Module type   : Makefile system
5
# Module type   : Makefile system
6
# Compiler(s)   : Perl
6
# Compiler(s)   : Perl
7
# Environment(s): jats
7
# Environment(s): jats
8
#
8
#
9
# Description   : Script invoked by Makefile system to do the hard work
9
# Description   : Script invoked by Makefile system to do the hard work
10
#                 of building QT for use with our development environment
10
#                 of building COTS windows packages.
11
#
-
 
12
#                 Perl has been used for this script because the Windows
-
 
13
#                 shell provided with JATS is not upto the task. The PATH
-
 
14
#                 variable has incorrect slashes for DOS programs
-
 
15
#
11
#
16
#......................................................................#
12
#......................................................................#
17
 
13
 
18
require 5.008_002;
14
require 5.008_002;
19
use strict;
15
use strict;
Line 30... Line 26...
30
use JatsError;
26
use JatsError;
31
use FileUtils;
27
use FileUtils;
32
use JatsSystem;
28
use JatsSystem;
33
use JatsCopy;
29
use JatsCopy;
34
 
30
 
35
Message('Hello!');
-
 
36
#
31
#
37
#   Options
32
#   Options
38
#
33
#
39
my $opt_debug   = $ENV{'GBE_DEBUG'};        # Allow global debug
34
my $opt_debug   = $ENV{'GBE_DEBUG'};        # Allow global debug
40
my $opt_verbose = $ENV{'GBE_VERBOSE'};      # Allow global verbose
35
my $opt_verbose = $ENV{'GBE_VERBOSE'};      # Allow global verbose
Line 217... Line 212...
217
my $ext;
212
my $ext;
218
 
213
 
219
if ( -e $TARBALL_FILE . ".tar.bz2" ) {
214
if ( -e $TARBALL_FILE . ".tar.bz2" ) {
220
    $TARBALL_FILE=$TARBALL_FILE . ".tar.bz2";
215
    $TARBALL_FILE=$TARBALL_FILE . ".tar.bz2";
221
    $TAR_DECOMP_ARG='j';
216
    $TAR_DECOMP_ARG='j';
222
    $ext = '.bz2';
217
    $ext = '.tar.bz2';
223
} elsif ( -e $TARBALL_FILE . ".tar.gz" ) {
218
} elsif ( -e $TARBALL_FILE . ".tar.gz" ) {
224
    $TARBALL_FILE=$TARBALL_FILE . ".tar.gz";
219
    $TARBALL_FILE=$TARBALL_FILE . ".tar.gz";
225
    $TAR_DECOMP_ARG='z';
220
    $TAR_DECOMP_ARG='z';
226
    $ext = '.tar.gz';
221
    $ext = '.tar.gz';
227
} elsif ( $TARBALL_FILE . ".tgz" ) {
222
} elsif ( $TARBALL_FILE . ".tgz" ) {
Line 272... Line 267...
272
}
267
}
273
 
268
 
274
#
269
#
275
#   Download and unzip/untar the source package
270
#   Download and unzip/untar the source package
276
#
271
#
277
$DO_DOWNLOAD = 1
272
if ( ! -d  $WORK_DIR )
-
 
273
{
278
    if ( ! -d  $WORK_DIR );
274
    $DO_DOWNLOAD = 1;
-
 
275
}
279
 
276
 
280
if ( $DO_DOWNLOAD )
277
if ( $DO_DOWNLOAD )
281
{
278
{
282
    Message " --> Deleting existing build objects directory";
279
    Message " --> Deleting existing build objects directory";
283
    DeleteDir( $UNTAR_DIR );
280
    DeleteDir( $UNTAR_DIR );
Line 288... Line 285...
288
    }
285
    }
289
    if ( -d $WORK_DIR )
286
    if ( -d $WORK_DIR )
290
    {
287
    {
291
        Error("Could not delete directory $WORK_DIR");
288
        Error("Could not delete directory $WORK_DIR");
292
    }
289
    }
293
}
-
 
294
else
-
 
295
{
-
 
296
    Message " --> Keep downloaded package";
-
 
297
}
-
 
298
 
290
 
299
if ( $DO_DOWNLOAD )
-
 
300
{
-
 
301
    Message " --> Extracting $TARBALL_FILE";
291
    Message " --> Extracting $TARBALL_FILE";
302
    $DO_PATCHES = 1;
292
    $DO_PATCHES = 1;
303
    chdir $SRC_DIR || Error ("Cannot cd to $SRC_DIR");
293
    chdir $SRC_DIR || Error ("Cannot cd to $SRC_DIR");
304
    if ( $TAR_DECOMP_ARG )
294
    if ( $TAR_DECOMP_ARG )
305
    {
295
    {
306
        #
296
        #
307
        # Extract tar from archive
297
        # Extract tar from archive
308
        # Extract files from tar
298
        # Extract files from tar
309
        #
299
        #
310
        my $tfile = $opt_DOWNLOAD_PKG ;
300
        my $tfile = $opt_DOWNLOAD_PKG . '.tar';
311
        $tfile =~ s~\Q$ext~~;
-
 
312
        $tfile .= '.tar';
-
 
313
 
301
 
314
        System ('7z', 'e', $TARBALL_FILE, '-y');
302
        System ('7z', 'e', $TARBALL_FILE, '-y');
315
        System ('7z', 'x', $tfile, '-y' );
303
        System ('7z', 'x', $tfile, '-y' );
316
        unlink $tfile;
304
        unlink $tfile;
317
    }
305
    }
Line 327... Line 315...
327
    
315
    
328
    # It does exist, so move it to the TARBALL directory we expect.
316
    # It does exist, so move it to the TARBALL directory we expect.
329
    rename $UNTAR_DIR,$WORK_DIR || Error("Could not move $UNTAR_DIR to $WORK_DIR");
317
    rename $UNTAR_DIR,$WORK_DIR || Error("Could not move $UNTAR_DIR to $WORK_DIR");
330
    
318
    
331
}
319
}
-
 
320
else
-
 
321
{
-
 
322
    Message " --> Keep downloaded package";
-
 
323
}
332
chdir $WORK_DIR || Error ("Cannot cd to $WORK_DIR");
324
chdir $WORK_DIR || Error ("Cannot cd to $WORK_DIR");
333
 
325
 
334
#
326
#
335
#   Apply local patches
327
#   Apply local patches
336
#
328
#