forked from Komodo/KomodoEdit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConscript
505 lines (452 loc) · 20.2 KB
/
Conscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
#!/usr/bin/env perl
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is Komodo code.
#
# The Initial Developer of the Original Code is ActiveState Software Inc.
# Portions created by ActiveState Software Inc are Copyright (C) 2000-2007
# ActiveState Software Inc. All Rights Reserved.
#
# Contributor(s):
# ActiveState Software Inc
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
Import(
'cons',
'build',
'buildAbsDir',
'compiler',
'platform',
'buildFlavour',
'buildType',
'idlExportDir',
'komodoPythonUtilsDir',
'supportDir',
'unsiloedPythonExe',
'productType',
'mozVersion',
'mozExtensionDir',
'mozChromeDir',
'komodoShortVersion',
'mozBin',
'withJSLib',
'ranRegxpcomStateFileName',
'siloedPython',
'readmeDir',
'sdkDir',
'universal',
'komodoDevDir',
'withKomodoCix',
'withWatchdogFSNotifications',
);
# Various setup.py-based things need extra flags for debbugging
if ($buildType eq 'debug') {
$debugFlags = "--debug";
} else {
$debugFlags = "";
}
my $consLocal = $cons;
#---- Komodo's schema-based autocomplete and other parts of the
# codeintel system use ElementTree.
# Python ElementTree (cElementTree depends upon this)
my $landmark = "$komodoPythonUtilsDir/elementtree/__init__.py";
$consLocal->Command($landmark,
"elementtree/setup.py",
qq(
cd %1:d && $siloedPython %1:f build $debugFlags
cd %1:d && $siloedPython %1:f install --skip-build --install-lib=$komodoPythonUtilsDir
));
$consLocal->DependsRecursive($landmark, "elementtree", ("build", '\.svn'));
# cElementTree
my $pydExt = ($platform eq "win" ? ".pyd" : ".so");
my $landmark = "$komodoPythonUtilsDir/cElementTree$pydExt";
$consLocal->Command($landmark,
"cElementTree/setup.py",
qq(
cd %1:d && $siloedPython %1:f build $debugFlags
cd %1:d && $siloedPython %1:f install --skip-build --install-lib=$komodoPythonUtilsDir
));
$consLocal->DependsRecursive($landmark, "cElementTree", ("build", '\.svn'));
#---- sgmlop (used for HTML parsing for HTML autocomplete)
my $pydExt = ($platform eq "win" ? ".pyd" : ".so");
my $landmark = "$komodoPythonUtilsDir/sgmlop$pydExt";
$consLocal->Command($landmark,
"sgmlop/setup.py",
qq(
cd %1:d && $siloedPython %1:f build $debugFlags
cd %1:d && $siloedPython %1:f install --skip-build --install-lib=$komodoPythonUtilsDir
));
$consLocal->DependsRecursive($landmark, "sgmlop", ("build", '\.svn'));
#---- Stock XML catalogs
$consLocal->InstallRecursive("$supportDir/catalogs",
#XXX must be absolute path (bug in InstallRecursive)
cwd()."/contrib/catalogs",
('\.svn'));
#---- Komodo's SFTP support uses 'paramiko' which, in turn, uses PyCrypto and
# ecdsa.
# PyCrypto (http://www.amk.ca/python/code/crypto)
my $landmark = "$komodoPythonUtilsDir/Crypto/__init__.py";
$consLocal->Command($landmark,
"pycrypto/setup.py",
qq(
cd %1:d && $siloedPython %1:f build $debugFlags
cd %1:d && $siloedPython %1:f install --skip-build --install-lib=$komodoPythonUtilsDir
));
$consLocal->DependsRecursive($landmark, "pycrypto", ("build", '\.svn'));
# ecdsa (http://github.com/warner/python-ecdsa)
my $landmark = "$komodoPythonUtilsDir/ecdsa";
$consLocal->InstallRecursive($landmark,
#XXX must be absolute path (bug in InstallRecursive)
cwd()."/contrib/ecdsa/ecdsa");
# paramiko (http://www.lag.net/paramiko/)
# See bug 73155 for a long discussion on why we are NOT using
# paramiko's setup.py for installation.
$landmark = "$komodoPythonUtilsDir/paramiko";
$consLocal->InstallRecursive($landmark,
#XXX must be absolute path (bug in InstallRecursive)
cwd()."/contrib/paramiko/paramiko",
('\.svn'));
if ($withJSLib) {
#---- jslib
# Some of Komodo's optional extensions use jslib:
# komodo_javascript_debugger (Komodo's FF extension for JS debugging)
# Casper (a Komodo extension for GUI testing)
#
# To update jslib, do the following *on a Linux box* to avoid EOL issues.
#
# cd contrib/jslib
# rm -rf *
# wget http://www.mozdevgroup.com/dropbox/jslib/signed/jslib_current_signed.xpi
# unzip jslib_current_signed.xpi
# rm -f jslib_current_signed.xpi
# patch -p0 < patches/jslib_komodo_rdf.patch
# px diff -sn ./... | px -x - add
# p4 diff -se ./... | p4 -x - edit
# p4 diff -sd ./... | p4 -x - delete
# p4 submit ./...
# Update to jsLib version X.X.XXX
#
# Currently we install the extension for dev builds and only place
# the .xpi in the install tree for installer builds because jslib is
# only required for dev testing bits (e.g. Casper).
if ($buildFlavour eq "dev") {
# install into komodo dev build
my $baseDir = "$mozExtensionDir/{DF8E5247-8E0A-4de6-B393-0735A39DFD80}/";
$consLocal->InstallRecursive(
$baseDir,
#XXX must be absolute path (bug in InstallRecursive)
cwd()."/contrib/jslib",
(".consign", "jslib.xpi", '\.svn'));
# install into firefox
# XXX FIXME The following installrecursive does not work. why?
# Answer:
# 1. Because $firefoxProfileDir isn't defined.
# 2. Because Cons is only considering targets under the dirs
# it is told to build via Default() call in Construct --
# and the firefox profile dir is not in these dirs.
#$baseDir = "$firefoxProfileDir/extensions/{DF8E5247-8E0A-4de6-B393-0735A39DFD80}/";
#if (! -d $baseDir) {
# mkdir($baseDir);
#}
#$cons->Install($baseDir, "jslib/install.rdf");
#$cons->InstallRecursive($baseDir,
# cwd()."/build/release/contrib/jslib/",
# (".consign", "install.p.rdf", "jslib.xpi", '\.svn'));
}
$consLocal->Command(
"jslib/jslib.xpi",
"jslib/install.rdf",
qq(
$unsiloedPythonExe bin/run-in-dir.py %1:d zip -r %0:f "*" -x .consign chrome/.consign chrome/jsliblive/.consign components/.consign META-INF/.consign
));
$consLocal->DependsRecursive("jslib/jslib.xpi", "jslib", (".consign", '\.svn'));
$consLocal->Install("$supportDir/modules", 'jslib/jslib.xpi');
}
#---- PCRE
# A C-based regex engine being used for Komodo's multi-language lexer (aka
# luddite, aka LexUDT). Note that the code here is integrated from
# //depot/main/support/pcre/...
# and the original pcre source integrated from:
# //depot/main/contrib/pcre/...
# and that from:
# ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
# also here:
# \\crimper\apps\Komodo\support\pcre
# Build a static PCRE lib.
if ($platform eq "win") {
# We are currently building all Komodo bits with VC6 so we use msdev.com.
my $scintilla_dir_for_cons = "$build/scintilla";
my $scintilla_dir = "$buildAbsDir\\scintilla";
my $silvercity_dir_for_cons = "$build/silvercity";
my $silvercity_dir = "$buildAbsDir\\silvercity";
$landmark = "$scintilla_dir_for_cons/win32/libpcre.lib";
# Building with the .mak files here should work with any VC
# version.
$consLocal->Command([$landmark,
"$scintilla_dir_for_cons/include/pcre.h",
"$silvercity_dir_for_cons/libpcre.lib"],
"pcre/pcreposix.h",
"pcre/Win32/dftables.mak",
"pcre/Win32/libpcre.mak",
qq(
cd %2:d && nmake -nologo -f %2:f
cd %3:d && nmake -nologo -f %3:f
copy %1:d\\Win32\\Release\\libpcre.lib $scintilla_dir\\win32\\libpcre.lib
copy %1:d\\Win32\\pcre.h $scintilla_dir\\include\\pcre.h
copy %1:d\\Win32\\Release\\libpcre.lib $silvercity_dir\\libpcre.lib
));
$consLocal->DependsRecursive($landmark, "pcre",
('\.svn', 'doc', 'testdata'));
} else {
my $scintilla_dir_for_cons = "$build/scintilla";
my $scintilla_dir = "$buildAbsDir/scintilla";
my $silvercity_dir_for_cons = "$build/silvercity";
my $silvercity_dir = "$buildAbsDir/silvercity";
my $build_env = "";
my $scintilla_plat_dir = "gtk";
if ($platform eq "darwin") {
$scintilla_plat_dir = "cocoa";
}
$landmark = "$scintilla_dir_for_cons/$scintilla_plat_dir/libpcre.a";
$consLocal->Command([$landmark,
"$scintilla_dir_for_cons/include/pcre.h",
"$silvercity_dir_for_cons/libpcre.a"],
"pcre/configure",
# 'ranlib' required on Mac OS X for SilverCity build
# to avoid this error:
# ld: table of contents for archive: libpcre.a is out of date; rerun ranlib(1) (can't load from it)
# error: command 'c++' failed with exit status 1
# See this discussion:
# http://lists.apple.com/archives/darwin-dev/2005/Sep/msg00053.html
qq(
cd %1:d && ./configure --enable-shared=no --enable-utf8 --enable-unicode-properties $build_env && make
ranlib %1:d/.libs/libpcre.a
cp %1:d/.libs/libpcre.a $scintilla_dir/$scintilla_plat_dir/libpcre.a
cp %1:d/pcre.h $scintilla_dir/include/pcre.h
cp %1:d/.libs/libpcre.a $silvercity_dir/libpcre.a
ranlib $silvercity_dir/libpcre.a
));
# Needs depends recursive for all three landmark files!
$consLocal->DependsRecursive([$landmark,
"$scintilla_dir_for_cons/include/pcre.h",
"$silvercity_dir_for_cons/libpcre.a"],
"pcre",
('\.svn', 'doc', 'testdata'));
}
#---- pywin
# Komodo uses the wnd package (from http://wnd.sourceforge.net/)
# as a replacement for PyWin32. 'wnd' provides some of the same Windows
# API functionality via ctypes. We've renamed 'wnd' to 'pywin' to
# hopefully be more clear -- though that renaming may be reverted.
if ($platform eq "win") {
my $landmark = "$komodoPythonUtilsDir/wnd";
$consLocal->InstallRecursive($landmark,
cwd() . "/contrib/pywin/wnd-0-1-20",
('\.svn', '\.consign'));
}
#---- inflector: Komodo's ruby codeintel uses this
# svn export http://opensvn.csie.org/inflector/trunk/python inflector
#
# This is a Python package providing English word inflections similar to
# what Ruby on Rails does for naming db tables, model classes, etc. It
# is used for providing rails completion.
#
# Note: Not using InstallRecursive because don't want
# inflector/tests.py.
$consLocal->InstallPythonUtility("inflector/__init__.py", "inflector");
$consLocal->InstallPythonUtility("inflector/Inflector.py", "inflector");
$consLocal->InstallPythonUtility("inflector/Rules/__init__.py", "inflector/Rules");
$consLocal->InstallPythonUtility("inflector/Rules/Base.py", "inflector/Rules");
$consLocal->InstallPythonUtility("inflector/Rules/English.py", "inflector/Rules");
$consLocal->InstallPythonUtility("inflector/Rules/Spanish.py", "inflector/Rules");
#---- htmltidy
{
local $build = substr($build, 1, length($build)); # drop the leading '#'
my ($exeName, $make, $makefile, $makeflags);
if ($platform eq "win") {
$exeName = "tidy\\bin\\tidy.exe";
$make = "nmake";
$makefile = "Makefile.vc6";
$tidyDir = "$build\\contrib\\tidy\\build\\msvc\\";
# Get rid of -opt:ref -opt:nowin98, which is no longer supported on new compilers
$makeflags = "LDNDEBUG=";
} else {
$exeName = "tidy/bin/tidy";
if ($platform eq "darwin") {
$make = "RANLIB=ranlib make OTHERCFLAGS='-D_DEBUG=1 -mmacosx-version-min=10.5' ";
} else {
$make = "make";
}
$makefile = "Makefile";
$tidyDir = "$build/contrib/tidy/build/gmake";
$makeflags = "";
}
my %consTidy = $consLocal->copy();
$consTidy{CPPPATH} = "include";
$consTidy{LIBPATH} = "obj";
my $consTidy = new cons(%consTidy);
$consTidy->Command($exeName,
"tidy/build/gmake/Makefile",
"tidy/build/msvc/Makefile.vc6",
"tidy/console/tab2space.c",
"tidy/console/tidy.c",
"tidy/include/buffio.h",
"tidy/include/platform.h",
"tidy/include/tidy.h",
"tidy/include/tidyenum.h",
"tidy/src/access.c",
"tidy/src/access.h",
"tidy/src/alloc.c",
"tidy/src/attrask.c",
"tidy/src/attrdict.c",
"tidy/src/attrdict.h",
"tidy/src/attrget.c",
"tidy/src/attrs.c",
"tidy/src/attrs.h",
"tidy/src/buffio.c",
"tidy/src/charsets.c",
"tidy/src/charsets.h",
"tidy/src/clean.c",
"tidy/src/clean.h",
"tidy/src/config.c",
"tidy/src/config.h",
"tidy/src/entities.c",
"tidy/src/entities.h",
"tidy/src/fileio.c",
"tidy/src/fileio.h",
"tidy/src/forward.h",
"tidy/src/iconvtc.c",
"tidy/src/iconvtc.h",
"tidy/src/istack.c",
"tidy/src/lexer.c",
"tidy/src/lexer.h",
"tidy/src/localize.c",
"tidy/src/mappedio.c",
"tidy/src/mappedio.h",
"tidy/src/message.h",
"tidy/src/parser.c",
"tidy/src/parser.h",
"tidy/src/pprint.c",
"tidy/src/pprint.h",
"tidy/src/streamio.c",
"tidy/src/streamio.h",
"tidy/src/tagask.c",
"tidy/src/tags.c",
"tidy/src/tags.h",
"tidy/src/tidy-int.h",
"tidy/src/tidylib.c",
"tidy/src/tmbstr.c",
"tidy/src/tmbstr.h",
"tidy/src/utf8.c",
"tidy/src/utf8.h",
"tidy/src/version.h",
"tidy/src/win32tc.c",
"tidy/src/win32tc.h",
"tidy/obj/empty.txt",
qq{cd $tidyDir && $make -f $makefile $makeflags}
);
$consTidy->Install("$supportDir/html", $exeName);
}
# six (required for html5lib)
$consLocal->Install("$komodoPythonUtilsDir", "six/six.py");
# html5lib
$landmark = "$komodoPythonUtilsDir/html5lib";
$consLocal->InstallRecursive($landmark,
#XXX must be absolute path (bug in InstallRecursive)
cwd()."/contrib/html5lib/html5lib",
('\.svn'));
# jshint
$consLocal->Install("$supportDir/lint/javascript", "jslint/jshint.js");
# ejs
$consLocal->InstallAs("$mozChromeDir/komodo/content/library/ejs.js", "ejs/ejs_edited.js");
#less css
$consLocal->InstallAs("$mozChromeDir/komodo/content/contrib/less.js", "smallstuff/less.js");
# commonjs
$consLocal->InstallAs("$mozChromeDir/komodo/content/contrib/commonjs/dot.js", "commonjs/dot.js");
$consLocal->InstallAs("$mozChromeDir/komodo/content/contrib/commonjs/randomColor.js", "commonjs/randomColor.js");
$consLocal->InstallAs("$mozChromeDir/komodo/content/contrib/commonjs/underscore.js", "commonjs/underscore.js");
$consLocal->InstallAs("$mozChromeDir/komodo/content/contrib/commonjs/marked.js", "commonjs/marked.js");
#---- Watchdog for file notifcations
if ($withWatchdogFSNotifications) {
# Watchdog has further requirements: PyYAML, argh (and argparse for < 2.7)
# and select-backport (for < 2.7). However, we don't use any of the features
# that require those.
my $landmark = "$komodoPythonUtilsDir/pathtools/__init__.py";
$consLocal->Command($landmark,
"pathtools/setup.py",
qq(
cd %1:d && $siloedPython %1:f build $debugFlags
cd %1:d && $siloedPython %1:f install --skip-build --install-lib=$komodoPythonUtilsDir
));
$consLocal->DependsRecursive($landmark, "pathtools", ("build", '\.svn', '\.consign'));
$landmark = "$komodoPythonUtilsDir/watchdog/__init__.py";
$consLocal->Command($landmark,
"watchdog/setup.py",
qq(
cd %1:d && $siloedPython %1:f build $debugFlags
cd %1:d && $siloedPython %1:f install --skip-build --install-lib=$komodoPythonUtilsDir
));
$consLocal->DependsRecursive($landmark, "watchdog", ("build", '\.svn', '\.consign'));
}
#---- Zope property descriptors.
my $landmark = "$komodoPythonUtilsDir/zope/cachedescriptors/__init__.py";
$consLocal->Command($landmark,
"zope/cachedescriptors/setup.py",
qq(
cd %1:d && $siloedPython %1:f build $debugFlags
cd %1:d && $siloedPython %1:f install --skip-build --install-lib=$komodoPythonUtilsDir
));
$consLocal->DependsRecursive($landmark, "zope/cachedescriptors", ("build", '\.svn', '\.consign'));
#---- Scandir property descriptors.
my $landmark = "$komodoPythonUtilsDir/scandir/scandir.py";
$consLocal->Command($landmark,
"scandir/setup.py",
qq(
cd %1:d && $siloedPython %1:f build $debugFlags
cd %1:d && $siloedPython %1:f install --skip-build --install-lib=$komodoPythonUtilsDir
));
$consLocal->DependsRecursive($landmark, "scandir", ("build"));
#---- Markdown2.
$consLocal->InstallPythonUtility('smallstuff/markdown2.py');
if ($platform eq "win") {
$consLocal->InstallPythonUtility('smallstuff/winprocess.py');
}
# Bugsnag
$consLocal->InstallRecursive("$komodoPythonUtilsDir/bugsnag",
#XXX must be absolute path (bug in InstallRecursive)
cwd()."/contrib/bugsnag-python/2.3.1");
if ($platform ne "win") {
#---- Newer subprocess module back-ported from Python 3.2.
# http://code.google.com/p/python-subprocess32/
$landmark = "$komodoPythonUtilsDir/subprocess32.py";
$consLocal->Command($landmark,
"subprocess32/setup.py",
qq(
cd %1:d && $siloedPython %1:f build $debugFlags
cd %1:d && $siloedPython %1:f install --skip-build --install-lib=$komodoPythonUtilsDir
));
$consLocal->DependsRecursive($landmark, "subprocess32", ("build", '\.svn'));
}