mirror of
https://github.com/libretro/libretro-puzzlescript.git
synced 2026-11-07 11:16:01 -10:00
Fix minor build issues related to using old Ubuntu to build. Add option to use precompiled font.js, Pillow was not working properly in old Python versions.
25 lines
714 B
Python
25 lines
714 B
Python
'''
|
|
Bundle any number of files into one generated C include header with xxd.
|
|
|
|
'''
|
|
|
|
import argparse
|
|
import os
|
|
import subprocess
|
|
import sys
|
|
|
|
if __name__ == '__main__':
|
|
parser = argparse.ArgumentParser(description='Bundle sources into one generated output C header file')
|
|
parser.add_argument('--inpath')
|
|
parser.add_argument('--out')
|
|
parser.add_argument('sources', nargs='+')
|
|
args = parser.parse_args()
|
|
with open(args.out, 'wb') as fout:
|
|
if args.inpath:
|
|
os.chdir(args.inpath)
|
|
out = bytes()
|
|
for source in args.sources:
|
|
result = subprocess.check_output(' '.join(["xxd", "-i", source]), shell=True)
|
|
out += result
|
|
fout.write(out)
|