Skip to content

Instantly share code, notes, and snippets.

@connorjclark
Created April 28, 2022 00:25
Show Gist options
  • Save connorjclark/b9e0986c518d0193031c71181c8e2fd3 to your computer and use it in GitHub Desktop.
Save connorjclark/b9e0986c518d0193031c71181c8e2fd3 to your computer and use it in GitHub Desktop.
gme.py
# Copyright 2022 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import os
import shutil
import logging
TAG = '0.6.3'
HASH = '1d45e1c9702061add6fc6ccabe650806adb2487309518784aa1e510f4b4d913a7452141d89f1df06d5a79004c46d3d233eca8cea9e57722df6c6d8e06d0b9b91'
def needed(settings):
return settings.USE_GME
def get(ports, settings, shared):
source_dir = 'mpyne-game-music-emu-e76bdc0cb916'
ports.fetch_project('gme', 'https://bitbucket.org/mpyne/game-music-emu/get/' + TAG + '.zip', source_dir, sha512hash=HASH)
def create(final):
logging.info('building port: gme')
source_path = os.path.join(ports.get_dir(), 'gme', source_dir)
dest_path = os.path.join(ports.get_build_dir(), 'gme')
shutil.rmtree(dest_path, ignore_errors=True)
shutil.copytree(source_path, dest_path)
flags = [
'-O2',
'-DVGM_YM2612_GENS',
'-DBLARGG_BUILD_DLL',
]
ports.build_port(
dest_path,
final,
includes=[
os.path.join(source_path, 'gme'),
],
flags=flags,
exclude_files=[],
exclude_dirs=[]
)
ports.install_headers(source_path, pattern='gme/*.h', target='gme')
return [shared.Cache.get_lib('gme.a', create, what='port')]
def clear(ports, settings, shared):
shared.Cache.erase_lib('gme.a')
def process_args(ports):
return []
def show():
return 'GME (USE_GME; GPL 2.1 license)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment