# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*- # vim: set filetype=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # We could use confvars.sh and configure.in but for some reason it gets a bit messy... # Just use what we have.. While UXP may reduce the importance of moz.configure we # likely will never be able to eliminate it entirely... Oh well. # Disables building the platform code # NOTE: This negates any possiblity of an XPIDL or Binary XPCOM Components set_config('MOZ_DISABLE_PLATFORM', '1') # Minimum required by moz.configure since we don't want everything in # toolkit/moz.configure when the platform isn't built set_config('MOZ_PACKAGER_FORMAT', 'omni') set_config('MOZ_JAR_MAKER_FILE_FORMAT', 'flat') # moz.configure won't allow setting normal variables in a global context so # create a function that can be called to get specific info def confvars(key): metadata = { 'name': 'ABPrime', 'id': 'abprime@projects.binaryoutcast.com', 'version': '1.0.7', 'creator': 'Binary Outcast', 'description': 'Bootstrapped adblocking is yesterday!', 'slug': 'abprime', 'chrome': 'abprime', 'targetApp': 'Pale Moon', 'targetID': '{8de7fcbb-c55c-4fbe-bfc5-fc555c87dbc4}', 'targetMinVer': '27.0.0', 'targetMaxVer': '28.*', 'basilisk': '1' } return metadata[key] # These will set the config/substs set_config('ADDON_NAME', confvars('name')) set_config('ADDON_ID', confvars('id')) set_config('ADDON_VERSION', confvars('version')) set_config('ADDON_AUTHOR', confvars('creator')) set_config('ADDON_SHORT_DESC', confvars('description')) set_config('ADDON_XPI_NAME', confvars('slug')) set_config('ADDON_CHROME_NAME', confvars('chrome')) set_config('ADDON_TARGET_APP_NAME', confvars('targetApp')) set_config('ADDON_TARGET_APP_ID', confvars('targetID')) set_config('ADDON_TARGET_APP_MINVER', confvars('targetMinVer')) set_config('ADDON_TARGET_APP_MAXVER', confvars('targetMaxVer')) set_config('ADDON_TARGET_BASILISK', confvars('basilisk')) # These will set defines # Should weed them down to just what is required which I believe # is just ADDON_TARGET_BASILISK set_define('ADDON_NAME', confvars('name')) set_define('ADDON_ID', confvars('id')) set_define('ADDON_VERSION', confvars('version')) set_define('ADDON_AUTHOR', confvars('creator')) set_define('ADDON_SHORT_DESC', confvars('description')) set_define('ADDON_XPI_NAME', confvars('slug')) set_define('ADDON_CHROME_NAME', confvars('chrome')) set_define('ADDON_TARGET_APP_NAME', confvars('targetApp')) set_define('ADDON_TARGET_APP_ID', confvars('targetID')) set_define('ADDON_TARGET_APP_MINVER', confvars('targetMinVer')) set_define('ADDON_TARGET_APP_MAXVER', confvars('targetMaxVer')) set_define('ADDON_TARGET_BASILISK', confvars('basilisk'))