| 1467 |
alewis |
1 |
########################################################################
|
| 6152 |
dpurdie |
2 |
# COPYRIGHT - VIX IP PTY LTD ("VIX"). ALL RIGHTS RESERVED.
|
| 1467 |
alewis |
3 |
#
|
|
|
4 |
# Module name : wsdl-tools
|
|
|
5 |
# Module type : JATS Plugin
|
|
|
6 |
# Compiler(s) : Perl
|
|
|
7 |
# Environment(s): JATS
|
|
|
8 |
#
|
|
|
9 |
# Description : This package extends the JATS toolset at build time
|
|
|
10 |
# It provides additional directives to the JATS makefiles
|
|
|
11 |
# to simplify the directives.
|
|
|
12 |
#
|
|
|
13 |
# The directive matches up with a run-time tool to
|
|
|
14 |
# do the bulk of the work.
|
|
|
15 |
#
|
|
|
16 |
# Operation : This package adds the JATS directive ShellBuild
|
|
|
17 |
# When used the directive will use GenerateFiles to invoke
|
|
|
18 |
# a shell program at make-time to actually do the hard work.
|
|
|
19 |
#
|
|
|
20 |
# Directives : ShellBuild (platform, script, ... )
|
| 6152 |
dpurdie |
21 |
# WindowsShellBuild(platform, script, ... )
|
|
|
22 |
# DebianShellBuild (platform, script, .... )
|
|
|
23 |
# DebianVariantShellBuild (platform, script, .... )
|
| 1467 |
alewis |
24 |
#
|
|
|
25 |
#......................................................................#
|
|
|
26 |
|
|
|
27 |
use strict;
|
|
|
28 |
use warnings;
|
|
|
29 |
use JatsError;
|
| 1475 |
dpurdie |
30 |
use FileUtils;
|
| 1467 |
alewis |
31 |
|
|
|
32 |
#
|
| 1475 |
dpurdie |
33 |
# Jats Globals
|
| 1467 |
alewis |
34 |
#
|
| 1475 |
dpurdie |
35 |
our $ScmPlatform;
|
| 1467 |
alewis |
36 |
|
|
|
37 |
#-------------------------------------------------------------------------------
|
|
|
38 |
# Function : ShellBuild
|
|
|
39 |
#
|
|
|
40 |
# Description : Launches a shell build script that has had a set of
|
|
|
41 |
# pre-invoke work performed already.
|
|
|
42 |
#
|
|
|
43 |
# Inputs : platform - Standard Platform Specifier
|
|
|
44 |
# script - The shell build script to launch.
|
|
|
45 |
# uargs - User options
|
|
|
46 |
#
|
|
|
47 |
# -DownloadPkg= - Name of the package that has been
|
|
|
48 |
# downloaded. If empty the download package
|
|
|
49 |
# is generated automatically.
|
| 1491 |
alewis |
50 |
# -CopyModsDir - Specifies that 'mods' directories should
|
|
|
51 |
# be copied rather than symlink
|
| 1477 |
dpurdie |
52 |
# -WorkDir= - Name of the package work dir
|
|
|
53 |
# Will override untar'ed dirname
|
| 1495 |
alewis |
54 |
# -WorkDirSuffix= - An additional suffix to add to the working
|
|
|
55 |
# directory.
|
| 1469 |
alewis |
56 |
# -ConfigVarient= - Sets the name of the package build
|
|
|
57 |
# configuration varient. This can then
|
|
|
58 |
# be used in the call-out script as
|
|
|
59 |
# ${CONFIG_VARIENT}.
|
| 4789 |
alewis |
60 |
# -PatchDir= - Sets the directory where patches are located.
|
| 6114 |
dpurdie |
61 |
# -IgnorePatchErr= - Sets to ignore patch errors when there are
|
|
|
62 |
# mutiple tar files invloved in a single package
|
| 1467 |
alewis |
63 |
#
|
|
|
64 |
# Returns : Nothing
|
|
|
65 |
#
|
|
|
66 |
sub ShellBuild
|
|
|
67 |
{
|
|
|
68 |
my ($platforms, $script, @uargs) = @_;
|
|
|
69 |
|
|
|
70 |
return if ( ! ActivePlatform($platforms) );
|
| 4270 |
alewis |
71 |
|
| 1467 |
alewis |
72 |
#
|
|
|
73 |
# Generate the files
|
|
|
74 |
# Use standard JATS directive
|
|
|
75 |
#
|
| 1475 |
dpurdie |
76 |
Src('*', $script);
|
| 4270 |
alewis |
77 |
GenerateFiles('*', '--Tool=shellbuild_linux.sh',# Tool to use
|
| 1475 |
dpurdie |
78 |
'-ShellBuild='.$script, # User script
|
| 1467 |
alewis |
79 |
'--Var(BuildName)', # Target Package
|
|
|
80 |
'--Var(BuildVersion)', # Target Package Version
|
|
|
81 |
'--Var(Platform)', # Target platform
|
|
|
82 |
'--Var(Type)', # Build Type
|
|
|
83 |
'--Var(Arch)', # Architecture
|
|
|
84 |
'--Var(MachType)', # Machine Type
|
|
|
85 |
'--Var(BuildRoot)', # Build Root
|
| 1475 |
dpurdie |
86 |
'--Var(InterfaceDir)', # Interface dir
|
| 1477 |
dpurdie |
87 |
'--Var(LocalDir)', # Local dirs
|
|
|
88 |
'--Var(LocalIncDir)',
|
|
|
89 |
'--Var(LocalLibDir)',
|
|
|
90 |
'--Var(LocalBinDir)',
|
| 1467 |
alewis |
91 |
'--Var(CompilerPath)', # Path to compiler
|
| 1469 |
alewis |
92 |
'--Var(BinDir)', # Binary output directory
|
|
|
93 |
'--Var(ObjDir)', # Object output directory
|
|
|
94 |
'--Var(LibDir)', # Library output directory
|
| 1467 |
alewis |
95 |
'--Var(PackageBinDir)', # Package Bin dir
|
|
|
96 |
'--Var(PackageIncDir)', # Package Inc dir
|
|
|
97 |
'--Var(PackageLibDir)', # Package Lib dir
|
|
|
98 |
'--Var(PackagePkgDir)', # Package Pkg dir
|
|
|
99 |
'--Var(PackageDir)', # Package dir
|
| 6112 |
dpurdie |
100 |
If('TOOLSET', '-Toolset'), # Flag TOOLSET packaging
|
| 1467 |
alewis |
101 |
'--Var(PackageToolDir)', # Tools dir
|
|
|
102 |
'--Var(PackageToolBin)', # Tools binaries dir
|
|
|
103 |
'--Var(PackageToolScript)', # Tools scripts dir
|
|
|
104 |
"--NoGenerate", "--Clean", @uargs );
|
|
|
105 |
}
|
|
|
106 |
|
|
|
107 |
#-------------------------------------------------------------------------------
|
|
|
108 |
# Function : DebianShellBuild
|
|
|
109 |
#
|
|
|
110 |
# Description : Launches a shell build script that has had a set of
|
|
|
111 |
# pre-invoke work performed already. Once the script
|
|
|
112 |
# Completes a Debian package builder is launched.
|
|
|
113 |
#
|
|
|
114 |
# Inputs : platform - Standard Platform Specifier
|
|
|
115 |
# script - The shell build script to launch.
|
|
|
116 |
# uargs - User options, as per ShellBuild().
|
|
|
117 |
#
|
|
|
118 |
# Returns : Nothing
|
|
|
119 |
#
|
|
|
120 |
sub DebianShellBuild
|
|
|
121 |
{
|
|
|
122 |
my ($platforms, $script, @uargs) = @_;
|
|
|
123 |
|
|
|
124 |
return if ( ! ActivePlatform($platforms) );
|
|
|
125 |
|
| 1475 |
dpurdie |
126 |
#
|
|
|
127 |
# The ShellBuild script will create the 'debbuild.pl' file
|
|
|
128 |
# Create a temp copy here in order to supress warnings
|
|
|
129 |
#
|
|
|
130 |
my $deb_dir = "$ScmPlatform.deb";
|
|
|
131 |
my $deb_build = $deb_dir . '/debbuild.pl';
|
|
|
132 |
mkdir ($deb_dir);
|
|
|
133 |
TouchFile ( $deb_build );
|
|
|
134 |
|
| 1467 |
alewis |
135 |
# Generate the files using ShellBuild()
|
| 1475 |
dpurdie |
136 |
ShellBuild ('*', $script, "-DebianPackage=$deb_dir", @uargs);
|
|
|
137 |
MakeDebianPackage('*', "--Script=$deb_build" );
|
| 1467 |
alewis |
138 |
}
|
|
|
139 |
|
| 4270 |
alewis |
140 |
#-------------------------------------------------------------------------------
|
| 6152 |
dpurdie |
141 |
# Function : DebianVariantShellBuild
|
| 5863 |
alewis |
142 |
#
|
|
|
143 |
# Description : Launches a shell build script that has had a set of
|
|
|
144 |
# pre-invoke work performed already. Once the script
|
|
|
145 |
# Completes a Debian package builder is launched.
|
|
|
146 |
#
|
|
|
147 |
# Inputs : platform - Standard Platform Specifier
|
|
|
148 |
# script - The shell build script to launch.
|
|
|
149 |
# variant - The Debian package name variant.
|
|
|
150 |
# uargs - User options, as per ShellBuild().
|
|
|
151 |
#
|
|
|
152 |
# Returns : Nothing
|
|
|
153 |
#
|
|
|
154 |
sub DebianVariantShellBuild
|
|
|
155 |
{
|
|
|
156 |
my ($platforms, $script, $variant, @uargs) = @_;
|
|
|
157 |
|
|
|
158 |
return if ( ! ActivePlatform($platforms) );
|
|
|
159 |
|
|
|
160 |
#
|
|
|
161 |
# The ShellBuild script will create the 'debbuild.pl' file
|
|
|
162 |
# Create a temp copy here in order to supress warnings
|
|
|
163 |
#
|
|
|
164 |
my $deb_dir = "$ScmPlatform.deb";
|
|
|
165 |
my $deb_build = $deb_dir . '/debbuild.pl';
|
|
|
166 |
mkdir ($deb_dir);
|
|
|
167 |
TouchFile ( $deb_build );
|
|
|
168 |
|
|
|
169 |
# Generate the files using ShellBuild()
|
|
|
170 |
ShellBuild ('*', $script, "-DebianPackage=$deb_dir", @uargs);
|
|
|
171 |
MakeDebianPackage('*', "--Script=$deb_build", "--Variant=$variant" );
|
|
|
172 |
}
|
|
|
173 |
|
|
|
174 |
#-------------------------------------------------------------------------------
|
| 4270 |
alewis |
175 |
# Function : WindowsShellBuild
|
|
|
176 |
#
|
|
|
177 |
# Description : Runs a build script intended for Windows rather than Linux.
|
|
|
178 |
#
|
|
|
179 |
# Inputs : platform - Standard Platform Specifier
|
|
|
180 |
# script - The shell build script to launch.
|
|
|
181 |
# uargs - User options
|
|
|
182 |
#
|
|
|
183 |
# -DownloadPkg= - Name of the package that has been
|
|
|
184 |
# downloaded. If empty the download package
|
|
|
185 |
# is generated automatically.
|
|
|
186 |
# -CopyModsDir - Specifies that 'mods' directories should
|
|
|
187 |
# be copied rather than symlink
|
|
|
188 |
# -WorkDir= - Name of the package work dir
|
|
|
189 |
# Will override untar'ed dirname
|
|
|
190 |
# -WorkDirSuffix= - An additional suffix to add to the working
|
|
|
191 |
# directory.
|
|
|
192 |
# -ConfigVarient= - Sets the name of the package build
|
|
|
193 |
# configuration varient. This can then
|
|
|
194 |
# be used in the call-out script as
|
|
|
195 |
# ${CONFIG_VARIENT}.
|
| 4789 |
alewis |
196 |
# -PatchDir= - Sets the directory where patches are located.
|
| 4270 |
alewis |
197 |
#
|
|
|
198 |
# Returns : Nothing
|
|
|
199 |
#
|
|
|
200 |
sub WindowsShellBuild
|
|
|
201 |
{
|
|
|
202 |
my ($platforms, $script, @uargs) = @_;
|
|
|
203 |
|
|
|
204 |
return if ( ! ActivePlatform($platforms) );
|
|
|
205 |
|
|
|
206 |
#
|
|
|
207 |
# Generate the files
|
|
|
208 |
# Use standard JATS directive
|
|
|
209 |
#
|
|
|
210 |
Src('*', $script);
|
|
|
211 |
GenerateFiles('*', '--Tool=shellbuild_windows.pl',# Tool to use
|
|
|
212 |
'-ShellBuild='.$script, # User script
|
|
|
213 |
'--Var(BuildName)', # Target Package
|
|
|
214 |
'--Var(BuildVersion)', # Target Package Version
|
|
|
215 |
'--Var(Platform)', # Target platform
|
|
|
216 |
'--Var(Type)', # Build Type
|
|
|
217 |
'--Var(MachType)', # Machine Type
|
|
|
218 |
'--Var(BuildRoot)', # Build Root
|
|
|
219 |
'--Var(InterfaceDir)', # Interface dir
|
|
|
220 |
'--Var(LocalDir)', # Local dirs
|
|
|
221 |
'--Var(LocalIncDir)',
|
|
|
222 |
'--Var(LocalLibDir)',
|
|
|
223 |
'--Var(LocalBinDir)',
|
|
|
224 |
'--Var(BinDir)', # Binary output directory
|
|
|
225 |
'--Var(ObjDir)', # Object output directory
|
|
|
226 |
'--Var(LibDir)', # Library output directory
|
|
|
227 |
'--Var(PackageBinDir)', # Package Bin dir
|
|
|
228 |
'--Var(PackageIncDir)', # Package Inc dir
|
|
|
229 |
'--Var(PackageLibDir)', # Package Lib dir
|
|
|
230 |
'--Var(PackagePkgDir)', # Package Pkg dir
|
|
|
231 |
'--Var(PackageDir)', # Package dir
|
| 6112 |
dpurdie |
232 |
If('TOOLSET', '-Toolset'), # Flag TOOLSET packaging
|
| 4270 |
alewis |
233 |
'--Var(PackageToolDir)', # Tools dir
|
|
|
234 |
'--Var(PackageToolBin)', # Tools binaries dir
|
|
|
235 |
'--Var(PackageToolScript)', # Tools scripts dir
|
|
|
236 |
"--NoGenerate", "--Clean", @uargs );
|
|
|
237 |
}
|
|
|
238 |
|
| 1467 |
alewis |
239 |
1;
|