-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.py
More file actions
50 lines (42 loc) · 1.33 KB
/
Copy pathbuild.py
File metadata and controls
50 lines (42 loc) · 1.33 KB
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
#!/usr/bin/env python3
import sys
import os
import shutil
from architectds.architectds import *
APP_VERSION = '0.3.0'
NDS_FILE_NAME = 'simple-decompress.nds'
RELEASE_DIR = 'release'
# USE_FILE32API is mandatory: minizip's ioapi.c otherwise selects the 64-bit
# backend (fopen64/ftello64/fseeko64), which the DS libc does not provide.
arm9 = Arm9Binary(
sourcedirs=['source'],
defines=['USE_FILE32API'],
libs=['nds9', 'z'],
libdirs=['${BLOCKSDS}/libs/libnds'],
)
arm9.generate_elf()
# No networking and no audio, so the minimal prebuilt ARM7 is enough.
arm7 = Arm7BinaryDefault(
elf_path='${BLOCKSDS}/sys/arm7/main_core/arm7_minimal.elf'
)
nds = NdsRom(
nds_path=NDS_FILE_NAME,
binaries=[arm9, arm7],
game_title='simple-decompress',
game_subtitle='Archive utility',
game_author='loganturner',
game_icon='icon.png',
)
nds.generate_nds()
nds.run_command_line_arguments()
if 'release' in sys.argv:
if not os.path.exists(RELEASE_DIR):
os.mkdir(RELEASE_DIR)
if os.path.exists(NDS_FILE_NAME):
shutil.move(NDS_FILE_NAME, os.path.join(RELEASE_DIR, NDS_FILE_NAME))
version_file = os.path.join(RELEASE_DIR, 'version.txt')
with open(version_file, 'w') as f:
f.write(APP_VERSION + '\n')
elif '--clean' in sys.argv:
if os.path.exists(RELEASE_DIR):
shutil.rmtree(RELEASE_DIR)