def ensure_mobile_android_packages(self, artifact_mode=False): import re import subprocess # For downloading the Oracle JDK, Android SDK and NDK. self.run_as_root(['emerge', '--noreplace', '--quiet', 'wget']) # Obtain the path held in the DISTDIR portage variable emerge_info = subprocess.check_output(['emerge', '--info']) distdir_re = re.compile('^DISTDIR="(.*)"$', re.MULTILINE) distdir = distdir_re.search(emerge_info).group(1) # Fetch the Oracle JDK since portage can't fetch it on its own base_url = 'http://download.oracle.com/otn-pub/java/jdk' jdk_dir = '8u162-b12/0da788060d494f5095bf8624735fa2f1' jdk_file = 'jdk-8u162-linux-x64.tar.gz' cookie = 'Cookie: oraclelicense=accept-securebackup-cookie' self.run_as_root(['wget', '-c', '-O', distdir + '/' + jdk_file, '--header', cookie, base_url + '/' + jdk_dir + '/' + jdk_file]) # Install the Oracle JDK. We explicitly prompt the user to accept the # changes because this command might need to modify the portage # configuration files and doing so without user supervision is dangerous self.run_as_root(['emerge', '--noreplace', '--quiet', '--autounmask-continue', '--ask', '=dev-java/oracle-jdk-bin-1.8.0.162']) from mozboot import android android.ensure_android('linux', artifact_mode=artifact_mode, no_interactive=self.no_interactive)
def ensure_mobile_android_packages(self, artifact_mode=False): # Install Android specific packages. self.dnf_install(*self.mobile_android_packages) from mozboot import android android.ensure_android('linux', artifact_mode=artifact_mode, no_interactive=self.no_interactive)
def ensure_macports_mobile_android_packages(self, artifact_mode=False): # Multi-part process: # 1. System packages. # 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages. # 1. System packages. packages = [ 'wget', ] self._ensure_macports_packages(packages) # Verify the presence of java and javac. if not self.which('java') or not self.which('javac'): raise Exception('You need to have Java version 1.7 or later installed. ' 'Please visit http://www.java.com/en/download/mac_download.jsp ' 'to get the latest version.') is_64bits = sys.maxsize > 2**32 if not is_64bits: raise Exception('You need a 64-bit version of Mac OS X to build Firefox for Android.') # 2. Android pieces. from mozboot import android android.ensure_android('macosx', artifact_mode=artifact_mode, no_interactive=self.no_interactive)
def ensure_homebrew_mobile_android_packages(self, artifact_mode=False): # Multi-part process: # 1. System packages. # 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages. # 1. System packages. packages = [ 'wget', ] self._ensure_homebrew_packages(packages) casks = [ 'java8', ] installed = self._ensure_homebrew_casks(casks) if installed: print(JAVA_LICENSE_NOTICE) # We accepted a license agreement for the user. is_64bits = sys.maxsize > 2**32 if not is_64bits: raise Exception('You need a 64-bit version of Mac OS X to build Firefox for Android.') # 2. Android pieces. from mozboot import android android.ensure_android('macosx', artifact_mode=artifact_mode, no_interactive=self.no_interactive)
def ensure_mobile_android_packages(self, mozconfig_builder, artifact_mode=False): # Multi-part process: # 1. System packages. # 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages. self.apt_install(*self.MOBILE_ANDROID_COMMON_PACKAGES) # 2. Android pieces. self.ensure_java(mozconfig_builder) from mozboot import android android.ensure_android('linux', artifact_mode=artifact_mode, no_interactive=self.no_interactive)
def ensure_mobile_android_packages(self, artifact_mode=False): # Multi-part process: # 1. System packages. # 2. Android SDK. Android NDK only if we are not in artifact mode. Android packages. # 1. This is hard to believe, but the Android SDK binaries are 32-bit # and that conflicts with 64-bit Debian and Ubuntu installations out of # the box. The solution is to add the i386 architecture. See # "Troubleshooting Ubuntu" at # http://developer.android.com/sdk/installing/index.html?pkg=tools. self.run_as_root(['dpkg', '--add-architecture', 'i386']) # After adding a new arch, the list of packages has to be updated self.apt_update() self.apt_install(*self.mobile_android_packages) # 2. Android pieces. from mozboot import android android.ensure_android('linux', artifact_mode=artifact_mode, no_interactive=self.no_interactive)
def ensure_mobile_android_packages(self, artifact_mode=False): from mozboot import android android.ensure_android( "linux", artifact_mode=artifact_mode, no_interactive=self.no_interactive )