Paranoia2/waf

176 lines
177 KiB
Plaintext
Raw Permalink Normal View History

2020-08-31 19:01:38 +02:00
#!/usr/bin/env python
# encoding: latin-1
# Thomas Nagy, 2005-2018
#
"""
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
"""
import os, sys, inspect
VERSION="2.0.18"
REVISION="b10d031bad536f1fd766be4ad9ee5a86"
GIT="00501901eb8ea3051ac023e804f9d572ddb61d89"
INSTALL=''
C1='#h'
C2='#_'
C3='#/'
cwd = os.getcwd()
join = os.path.join
WAF='waf'
def b(x):
return x
if sys.hexversion>0x300000f:
WAF='waf3'
def b(x):
return x.encode()
def err(m):
print(('\033[91mError: %s\033[0m' % m))
sys.exit(1)
def unpack_wafdir(dir, src):
f = open(src,'rb')
c = 'corrupt archive (%d)'
while 1:
line = f.readline()
if not line: err('run waf-light from a folder containing waflib')
if line == b('#==>\n'):
txt = f.readline()
if not txt: err(c % 1)
if f.readline() != b('#<==\n'): err(c % 2)
break
if not txt: err(c % 3)
txt = txt[1:-1].replace(b(C1), b('\n')).replace(b(C2), b('\r')).replace(b(C3), b('\x00'))
import shutil, tarfile
try: shutil.rmtree(dir)
except OSError: pass
try:
for x in ('Tools', 'extras'):
os.makedirs(join(dir, 'waflib', x))
except OSError:
err("Cannot unpack waf lib into %s\nMove waf in a writable directory" % dir)
os.chdir(dir)
tmp = 't.bz2'
t = open(tmp,'wb')
try: t.write(txt)
finally: t.close()
try:
t = tarfile.open(tmp)
except:
try:
os.system('bunzip2 t.bz2')
t = tarfile.open('t')
tmp = 't'
except:
os.chdir(cwd)
try: shutil.rmtree(dir)
except OSError: pass
err("Waf cannot be unpacked, check that bzip2 support is present")
try:
for x in t: t.extract(x)
finally:
t.close()
for x in ('Tools', 'extras'):
os.chmod(join('waflib',x), 493)
if sys.hexversion<0x300000f:
sys.path = [join(dir, 'waflib')] + sys.path
import fixpy2
fixpy2.fixdir(dir)
os.remove(tmp)
os.chdir(cwd)
try: dir = unicode(dir, 'mbcs')
except: pass
try:
from ctypes import windll
windll.kernel32.SetFileAttributesW(dir, 2)
except:
pass
def test(dir):
try:
os.stat(join(dir, 'waflib'))
return os.path.abspath(dir)
except OSError:
pass
def find_lib():
src = os.path.abspath(inspect.getfile(inspect.getmodule(err)))
base, name = os.path.split(src)
#devs use $WAFDIR
w=test(os.environ.get('WAFDIR', ''))
if w: return w
#waf-light
if name.endswith('waf-light'):
w = test(base)
if w: return w
for dir in sys.path:
if test(dir):
return dir
err('waf-light requires waflib -> export WAFDIR=/folder')
dirname = '%s-%s-%s' % (WAF, VERSION, REVISION)
for i in (INSTALL,'/usr','/usr/local','/opt'):
w = test(i + '/lib/' + dirname)
if w: return w
#waf-local
dir = join(base, (sys.platform != 'win32' and '.' or '') + dirname)
w = test(dir)
if w: return w
#unpack
unpack_wafdir(dir, src)
return dir
wafdir = find_lib()
sys.path.insert(0, wafdir)
if __name__ == '__main__':
from waflib import Context
Context.WAFNAME='waifu'
Context.WAIFUVERSION='1.1.0'
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'scripts', 'waifulib'))
from waflib import Scripting
Scripting.waf_entry_point(cwd, VERSION, wafdir)
#==>
#BZh91AY&SY~7=<3D><01><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><7F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>h&_Z$e~P<12><><EFBFBD><EFBFBD><EFBFBD>c<EFBFBD>^z<>f<EFBFBD><0E><>#/#/#/#/#/#/#/#/#/#/#/#/P@#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/#/ <><EFA7A6><EFBFBD>#_><3E>}x<><07><>F<EFBFBD>Ͻѳ#h><3E>5<EFBFBD><35>nw<><77><EFBFBD>[=<3D><><EFBFBD>={<7B>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><14>*<2A>f<EFBFBD>%<25>'m<>7]zh<7A><68><EFBFBD><EFBFBD>X<16><>^_{<7B><>כ<EFBFBD>ca<63><61><EFBFBD>ݛ<EFBFBD>w[<5B>s:<3A><>][G6;<3B><><EFBFBD>n<EFBFBD><6E><EFBFBD>{<7B><>l_{<7B>si<73><69><EFBFBD>}<7D><><0F>͝oOC<1E><><<07>q<EFBFBD>ْjڭM<DAAD>m<1C>wO<77><4F> ;m<1C><><EFBFBD><EFBFBD>,<2C>h`<14>QK<51>ݻh<>PP $<24><><EFBFBD>κݞ<><DD9E><EFBFBD><EFBFBD><EFBFBD><EFBFBD>_A<5F><41>o[<5B>6.}<7D><><EFBFBD>#/<10>#/<07>_fu<66><75><EFBFBD><E1B9A5>`<60>D)J<><4A><EFBFBD>&<26><><EFBFBD><EFBFBD><1E>= <0C>7<EFBFBD>.(P<><50><1A>$SJE6k\۪ϼ<DBAA><CFBC><EFBFBD><EFBFBD>@S<>H+<2B>u*cBo3<6F>ս<EFBFBD>ym1<6D>—6B<36><42>Z<EFBFBD>׾<EFBFBD>{<7B><>^}N<><4E>@<40>#/vyw<79>@!T)U<>Õ><3E>Ux<><07>ֵ^x<> $<24>|<7C>{<7B>J館#ht<68>#/<02><><EFBFBD><EFBFBD><EFBFBD>M<19>ԝw<1D><1C>N<EFBFBD><4E>)RJ<52>9<EFBFBD><39><EFBFBD><EFBFBD>,m{<1E><><EFBFBD><EFBFBD>#h<><68>їYU><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>}<7D><>P<>a<>|W<><57>#/#/<2F>#/<06>#/<01>`h4}<7D>4ˀs<CB80>!U<>#/<2F>#h<>J<EFBFBD>mj<6D>Ph<50><0E>7<EFBFBD><37>΍<06>#/#hz:<3A><>ٮ<EFBFBD>0<EFBFBD><30>J7e:<3A><><EFBFBD><02> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>#/P#/<12><02><><EFBFBD><<10>@#/<07>Z<04><1D><14>T<EFBFBD><0E>uUl<03>m<EFBFBD><6D>}燝ۼ<E7879D><DBBC><EFBFBD>x<EFBFBD><06>wq<77><71><EFBFBD><EFBFBD>=<3D><>#hJِ.<2E>Ol/[<13>m<><6D>۷ZR<5A><18><><EFBFBD>J<EFBFBD><4A><EFBFBD><EFBFBD>=<3D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}v<>ﲟO<EFB29F><4F><EFBFBD>ۙ<EFBFBD>.<2E><><EFBFBD><EFBFBD><EFBFBD>{<7B><><EFBFBD><EFBFBD><EFBFBD>y}<7D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;{<7B><>{<7B><>|<7C><><EFBFBD><EFBFBD><EFBFBD>Wk<57><6B><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>w7<>{<7B>}<7D><><EFBFBD><05>z<EFBFBD><7A>V<EFBFBD>]<0F><><EFBFBD><75><01><>J<>{e<>F<EFBFBD>n<EFBFBD>;Ai<41><69>6<EFBFBD><36><EFBFBD><EFBFBD><05>̓d<>ཬ><3E><>O}n=<01><>@W{<7B>}<7D><><EFBFBD>w<0E><><EFBFBD>>}<7D><><EFBFBD><EFBFBD>/{t<>n><3E>ޟ{뭱<><EBADB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>9,<2C><><EFBFBD><EFBFBD>s<EFBFBD>m<EFBFBD>o<EFBFBD><6F><EFBFBD><EFBFBD>=<3D>-<2D><><EFBFBD>hz<68>v<EFBFBD><76><EFBFBD>w<EFBFBD>Y<><59><EFBFBD><EFBFBD><EFBFBD><EFBFBD>s<EFBFBD>u<EFBFBD><75>><3E><><EFBFBD><EFBFBD><EFBFBD>[jﲻ<6A>}<7D><><EFBFBD><EFBFBD><EFBFBD>w<EFBFBD><77><EFBFBD>><3E>Y<EFBFBD><59>\rr<72><72><EFBFBD><EFBFBD><EFBFBD><EFBFBD>b<EFBFBD><62><EFBFBD>嫽R<E5ABBD>}<7D>V<EFBFBD>c<>%[_w<5F>l<13><><77>{<7B>実o<E5AE9F><6F>c]ί<><E1BDB7><EFBFBD>=޸^<5E>t#/ ><3E> <0B><>B<EFBFBD><42><EFBFBD>;<3B><>3ۼwL<77>7<1E>S<EFBFBD><53><EFBFBD>k<EFBFBD>.<2E>j<EFBFBD><6A><EFBFBD>엎u<EC978E><75>sw׻<77>u<EFBFBD>L<EFBFBD>{<7B><<3C><>R<EFBFBD>޷v<DEB7><76>Z<EFBFBD>4<0E><>;<3B><0F><>*<2A>W<EFBFBD><57>yh<79><68>gI<67>6<EFBFBD><36><EFBFBD>m<EFBFBD>u gS<67>l<EFBFBD>g<EFBFBD><67>|}׽<>q<EFBFBD><71><EFBFBD><EFBFBD>Lu]<5D><><03>{ܺн<DCBA>l<EFBFBD>s<EFBFBD>J<EFBFBD><4A><EFBFBD>]m<><6D>uN<75><4E><EFBFBD><EFBFBD>i<EFBFBD>'nۋ/<2F><><EFBFBD><EBAAA0>^<5E>z<EFBFBD><7A>z<EFBFBD><7A>yr<79><72><19>9<EFBFBD>9<EFBFBD>4a<34>5<EFBFBD>l<EFBFBD><6C>֎&<26><> <09>u[<5B><>޼5<>m<EFBFBD><6D>v<EFBFBD><76>m<EFBFBD>5<EFBFBD><35><EFBFBD><EFBFBD><1C>w<-<2D><>s:<10><><EFBFBD>۩#/ݦâ<DDA6><C3A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>m<EFBFBD>;n<><6E>ã^<5E>gY<67>#_<><5F>p<EFBFBD>3*<2A><>C<>vR<76><52>j<EFBFBD><01><>#_#/ʀ#/O<>Р#h<><68><EFBFBD>j<EFBFBD><6A><EFBFBD>kl-d<><64>n<EFBFBD>ۯ<EFBFBD>ۋ<EFBFBD>w<EFBFBD>^<5E><11><><EFBFBD>*<2A><>{{ԃ<><D483>dm<64><6D>ǩ<EFBFBD><C7A9>7#\un<75>m<EFBFBD>U<EFBFBD><55>sS<73>҄<EFBFBD><D284>j<EFBFBD>l<EFBFBD><6C><EFBFBD>m<EFBFBD><6D><EFBFBD><EFBFBD><EFBFBD>T(<28><><EFBFBD>'<27>.<2E><06>Z4v<34>۽<EFBFBD><DBBD>;ulr[<5B>:#/#/#_<><5F><EFBFBD><EFBFBD>#h#/#/<17><><EFBFBD>+4<>sw<73>o{ïy<C3AF>͸#/<1E><><EFBFBD>siͅ<69><CD85><EFBFBD><68><D2B6>\<5C>Ͼ<EFBFBD>耣g<E880A3>{<7B><>#/<2F>a<EFBFBD><61><0E>F<EFBFBD>#/֝<>F<EFBFBD><46><EFBFBD>oP<6F>v<EFBFBD><76><EFBFBD>ޞ<EFBFBD><DE9E>/h<><68><0E>Wu֍@<40>ٛ#<23>9Cbw<>)<29><><EFBFBD>={{<7B><>{tx<04>*<2A>T#h<>z<EFBFBD>wE<77>J<EFBFBD><4A>ܭ<EFBFBD>^<5E>C<EFBFBD><43><EFBFBD>[<5B><>/w<><77>N<EFBFBD>=<3D><><0F><><EFBFBD>-<2D><><EFBFBD><1E>u<EFBFBD>\#hĈW<1B><> :<3A><>m<EFBFBD><6D><EFBFBD>o#<23><><P<07><>><3E><>Wn<>.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D><>L<EFBFBD><4C>e{1<><31>2<EFBFBD><32><EFBFBD>ǹ<EFBFBD>fS<66>rr<1C><>l<EFBFBD>4<EFBFBD><34><EFBFBD><EFBFBD>(<28><><EFBFBD>&<26><><EFBFBD><EFBFBD><1C><>w^<5E><><EFBFBD><EFBFBD>lk<6C>d<EFBFBD><64>I<03>6j<02><>]<5D><>٥5<D9A5>8<EFBFBD><38><EFBFBD><EFBFBD><06><>r<EFBFBD>yu^<5E><><EFBFBD>Q<EFBFBD>=<3D><>n<EFBFBD>#/0<03><>h<EFBFBD>t5BddH<64><48>;<3B>M445<34>z{<7B>q<EFBFBD>Gb<47>j<EFBFBD><6A>.<2E><>u<EFBFBD><75><EFBFBD>J^<5E><17>=<3D><><EFBFBD><EFBFBD>q<EFBFBD>F<EFBFBD><46><1D><>פ<EFBFBD>\<5C>,ʫn<CAAB> :<3A><><EFBFBD><17><><EFBFBD><18>G:<3A><>@<40> <20>#/(<02>V+Kl)v<>V<EFBFBD>#_<><5F>%<25>wlt<02><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>yz6<7A>ۺ<03>F<EFBFBD>H<><48>8<0E><01>v<EFBFBD><76><EFBFBD>w|<07>(L#/#/P<0E>#/1R<31>'<27><><EFBFBD><EFBFBD>i <20><56>=<17><>[<5B>j<EFBFBD>w<EFBFBD>_<<3C>5كV{sa<73><61><EFBFBD><EFBFBD><01><>#h(<28>*<2A>#/<2F>;]<5D><><EFBFBD>9wk@<40><>)<29><>ۍ`%wt-<2D>.v<><76><EFBFBD><EFBFBD>w^<5E>R<EFBFBD>];<3B><>*<2A>zi<7A><69><0E> J{c<><63>#/<2F>9<>B<EFBFBD> <><EBBAB0>s<EFBFBD>Mݻov<6F>-<2D><>[<5B><>[[<12><>#/<2F><>/ :<3A>G<EFBFBD><47>u<EFBFBD>)Iv{<7B>{<7B><><EFBFBD><EFBFBD>R<EFBFBD>u<EFBFBD><75><EFBFBD><EFBFBD>c<EFBFBD>h8<68>w<EFBFBD>QBw<42><77>ѵ<EFBFBD><D1B5><EFBFBD>u=s2J*&<26><><EFBFBD> <09><>f0[<0E>q<EFBFBD><71>#/k<><6B>><3E>|<7C>}<7D>{ֹowy=<3D>⭝wpc<><63>.<2E><>]R]=^O<><4F>#{<7B><>h<EFBFBD>m<15> C<>%o<><6F><EFBFBD><EFBFBD><EFBFBD>]|xi<78>#/<2F>#/#@2d#/L<><04>'<27>2SO)<29><><EFBFBD>䌙=MzM4di<64>xS<78><53><12><10><11><>#/<2F>ɅO<C985><4F><EFBFBD><EFBFBD>j<EFBFBD><6A>7<EFBFBD><37>=I<>4x<34><78>OP4<01>#/#/#/#/#/#/<04>D@<40><>!<21>&D<><44><04><>&j<><6A>4<EFBFBD>)<29><>P<EFBFBD>*<1F>G<EFBFBD><47><EFBFBD><EFBFBD>z<EFBFBD>dh#/#/#/#/#/#/ D<><44>h)<29><>)<29>6<EFBFBD><36><EFBFBD><EFBFBD><C28D>S<EFBFBD>(<28>&P<>z<EFBFBD><7A><EFBFBD>G<EFBFBD>hh<68><68> <0C>4<>#/#/#/#/#/#/<2F><>B<EFBFBD><42>abd<04>#/$<24>*<><7F>©<EFBFBD><C2A9><EFBFBD><EFBFBD>z<><7A><EFBFBD><EFBFBD><19><><EFBFBD>&<26>Ѵ<EFBFBD>@<40>#/#/<03>j"#/@#/<2F><>0<EFBFBD>4F<34>5OS<4F>6<EFBFBD>h<EFBFBD>?S<>i<EFBFBD>)<29><>jh#/#/<2F>#/#/#/<03><>t<07><>.<2E><>ٗ<EFBFBD><D997>~DT<44>h<EFBFBD>f#hG<68><47>*k<>dT<64>6<>0o<30><6F>z"<22>"<22>#_EQE<12>R<EFBFBD>-*<2A><>#/TC<54><EFBFBD>P<07>~<7E>ٟ<EFBFBD><D99F><EFBFBD>[<5B>_<EFBFBD><5F><EFBFBD># <18><>ݼIN:X<>ى<EFBFBD>a<EFBFBD>`z<><7A>W<1B>\i<><69><EFBFBD>tzc<7A><15><>KbB:<3A><>J<><4A>]<1F><>`jC1<43>_<EFBFBD>?<3F><>w<EFBFBD>*x<> w<>\<03>*<2A><EFBFBD>w<EFBFBD><77><EFBFBD><EFBFBD>6<EFBFBD><36>+/<2F><10><>w-ы'<18><>jbnqW<><57><EFBFBD>l<EFBFBD><6C>M<EFBFBD>u<EFBFBD><75><EFBFBD>ᾈIP<><50>߸<EFBFBD><1E><>ZO<5A><EFBFBD><7F>*t<> <0B><><EFBFBD>\<5C><EFBFBD>!<21>hQ<><02>dL1;@d(<28><>RW<52><57>-ң<>1#/D <20><><06>H<>B<EFBFBD><42><EFBFBD><EFBFBD><EFBFBD> J<03>L#_#h&<26>Z<EFBFBD>2@<>/<2F>V<EFBFBD><56>%<1D>1Vh<56>B<EFBFBD> &Jj<4A>R%P<>=<3D>M(%(<28>I{pʜR<CA9C>#h <16><08><>IS<12>l <0B><>P<EFBFBD>J<><4A>\e<17>MD<14><>UIKDEQL<51><4C><EFBFBD>EL!<21><><EFBFBD>nl<6E>S<><53>B<EFBFBD><42>`@E_b<5F><62><EFBFBD> 4<04><>C1CD<43>Q,UEQPDPSIDA1RIET<45>DSMQ$LED5<12><14>U<14><>DIT<49>UU4<55><04>RąP<C485><50> M0M1D<31>QEL<45><4C>EMB<02>"!T<14>U)I(T<>R<EFBFBD>,@)JD<4A>L<EFBFBD>QRI$<24>MTIEI 0<>"<22>*<2A>2L <20> DBCM5AT<41>A$<14>+<12>@Q0<51>TADQ+0<10>4ATSUTTS1R<14>I!ICAA<08>QDUUC$CT<><10>KU-DQQ-4<>$@<40>%LETCB<43>MBM$AHAACST@SJMI1A<12>%(EMD<14>5D00U3R%T<><10>P<EFBFBD>MK1SUP<55>L<14>3R<33>#hDHJ<48>RB$<14>#/<2F>TD<54>I<12>D%1PĔ3E5QPMJRC#_M5QA<04> $C<10>"ȂL<C882>,TLTAAQ#_$<24>Q<10><04>LEPC$<24>#h<>C)TA P1D<31><44>L<EFBFBD>#ẖ<14>3DIT<49>TSDMA<10>HQ<12>3P<>TDR<44><52>DR<44>!S$<24>I@QTD<>D<EFBFBD>0UCE%1RD<04><14>EHA4U-DQE#_%EUC55R<35>Q<14>+L4UTD<54>C2E<04>LDQUU53A,D<>0<EFBFBD>L<EFBFBD>ET<45>DA13 <14>P<EFBFBD>T<EFBFBD>1CS<10>QCJI2D1A$<24>LAILMKCUM1CE*SA@UP1TR<>%4PQ3<12><04>Q-#/DT<12>DM<04>L<EFBFBD>D<EFBFBD><44>4<><34>L@T4<54>%JUD$A0UED<>AIIE<04>E<14><><EFBFBD>QPSDQQ1D<31>-D<><44>ADMAEEM0<4D>@<40>TMTD4<44> E<14><>D<EFBFBD>AC1Q,0CKEE1TQ!$<24>DTDI<14>LAJAM%#_SIT3M<14>QCEE KBP<42>PEQDBEP<>ĕK$<24>PPDҔ0KQQ)S0U4<55>PI5E+30<>T %H0TC4<43>TT<54>KD<04>Q$<24>DL<44>IRQQQ0<51>PDRKTSD<53>DUQERD<52>EPE$<24>4<EFBFBD>0ATR<54>L<04>A+4<>D<EFBFBD>4)MQ<12>QD<51><44>$Q5MA4<>MT<><54>ETM<12>$<24>%PT<50><54>4<EFBFBD>AP<14>I@DU%4D<34><44>MTKDM-4ĄE<04><>--<14>D<EFBFBD>3UC<14>S)54QMQM130<33>D<EFBFBD>KK<14><12>DT<44>LDCDLPBD<42>@PQM0S<04>A#_1!@PDD<44>AM$E<14><>DSQIU,ULM52<14>LQ)T<>0U0EDTLA4R<34>EDT<44>-EEQA4<41>M!,E@<40><><EFBFBD>#_DDESD@DPM1<12>U!
#<==