Skip to content

Commit a5fd817

Browse files
committed
Fixed issue with unpacking SDK contents.
1 parent 32cea38 commit a5fd817

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

common.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ def wrapper(*args, **kwargs):
342342
else:
343343
target = fill_in(name)
344344
target = target.replace('_', '-')
345+
target = target.replace('/', '-')
345346
stamp = path.join('{stamps}', target)
346347
if not path.exists('{stamps}'):
347348
mkdir('{stamps}')

toolchain-ppc

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# Build cross toolchain for AmigaOS 4.x / PowerPC target.
44

55
from fnmatch import fnmatch
6-
from glob import glob
76
from logging import info
87
from os import environ
98
import argparse
@@ -12,7 +11,7 @@ import platform
1211
import sys
1312

1413
URLS = \
15-
['git://github.com/cahirwpz/python-lhafile',
14+
['git://github.com/FrodeSolheim/python-lhafile',
1615
'ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.3.tar.bz2',
1716
'ftp://ftp.gnu.org/gnu/mpc/mpc-1.0.3.tar.gz',
1817
'ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.3.tar.bz2',
@@ -35,24 +34,12 @@ from common import * # NOQA
3534
def prepare_sdk():
3635
info('preparing {sdk}')
3736

38-
base = ''
39-
clib2 = ''
40-
newlib = ''
37+
target = path.join('{target}', 'ppc-amigaos/SDK')
4138

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'))
5643

5744

5845
def build():
@@ -182,6 +169,7 @@ def clean():
182169
rmtree('{sources}')
183170
rmtree('{host}')
184171
rmtree('{build}')
172+
rmtree('{tmpdir}')
185173

186174

187175
if __name__ == "__main__":

0 commit comments

Comments
 (0)