3
3
# Build cross toolchain for AmigaOS 4.x / PowerPC target.
4
4
5
5
from fnmatch import fnmatch
6
- from glob import glob
7
6
from logging import info
8
7
from os import environ
9
8
import argparse
@@ -12,7 +11,7 @@ import platform
12
11
import sys
13
12
14
13
URLS = \
15
- ['git://github.com/cahirwpz /python-lhafile' ,
14
+ ['git://github.com/FrodeSolheim /python-lhafile' ,
16
15
'ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.3.tar.bz2' ,
17
16
'ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz' ,
18
17
'ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.3.tar.bz2' ,
@@ -35,24 +34,12 @@ from common import * # NOQA
35
34
def prepare_sdk ():
36
35
info ('preparing {sdk}' )
37
36
38
- base = ''
39
- clib2 = ''
40
- newlib = ''
37
+ target = path .join ('{target}' , 'ppc-amigaos/SDK' )
41
38
42
- with cwd ('{sources}' ):
43
- for arc in ['base.lha' , 'clib2-*.lha' , 'newlib-*.lha' ]:
44
- info ('extracting "%s"' % arc )
45
- execute ('lha' , '-xifq' , path .join ('{archives}' , '{sdk}.lha' ),
46
- path .join ('SDK_Install' , arc ))
47
- base = path .join ('{sources}' , glob ('base*.lha' )[0 ])
48
- clib2 = path .join ('{sources}' , glob ('clib2*.lha' )[0 ])
49
- newlib = path .join ('{sources}' , glob ('newlib*.lha' )[0 ])
50
-
51
- with cwd (path .join ('{target}' , 'ppc-amigaos/SDK' )):
52
- execute ('lha' , '-xf' , clib2 , 'clib2/*' )
53
- execute ('lha' , '-xf' , newlib , 'newlib/*' )
54
- execute ('lha' , '-xf' , base , 'Include/*' )
55
- move ('Include' , 'include' )
39
+ unpack ('{sdk}' , work_dir = '{archives}' , top_dir = 'SDK_Install' , dst_dir = 'SDK' )
40
+ unpack ('SDK/base' , top_dir = 'Include' , dst_dir = path .join (target , 'include' ))
41
+ unpack ('SDK/clib2' , top_dir = 'clib2' , dst_dir = path .join (target , 'clib2' ))
42
+ unpack ('SDK/newlib' , top_dir = 'newlib' , dst_dir = path .join (target , 'newlib' ))
56
43
57
44
58
45
def build ():
@@ -182,6 +169,7 @@ def clean():
182
169
rmtree ('{sources}' )
183
170
rmtree ('{host}' )
184
171
rmtree ('{build}' )
172
+ rmtree ('{tmpdir}' )
185
173
186
174
187
175
if __name__ == "__main__" :
0 commit comments