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 Arch installations out of the box. The # solution is to add the multilibs repository; unfortunately, this # requires manual intervention. try: self.pacman_install(*self.MOBILE_ANDROID_COMMON_PACKAGES) except Exception as e: print( 'Failed to install all packages. The Android developer ' 'toolchain requires 32 bit binaries be enabled (see ' 'https://wiki.archlinux.org/index.php/Android). You may need to ' 'manually enable the multilib repository following the instructions ' 'at https://wiki.archlinux.org/index.php/Multilib.') raise e # 2. Android pieces. import android android.ensure_android('linux', artifact_mode=artifact_mode, no_interactive=self.no_interactive)
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 jdk_file = 'jdk-8u144-linux-x64.tar.gz' self.run_as_root([ 'wget', '-c', '-O', distdir + '/' + jdk_file, '--header', 'Cookie: oraclelicense=accept-securebackup-cookie', 'http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/' + 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.144' ]) 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. 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 = [ 'java', ] 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. import android android.ensure_android('macosx', 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) 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. import android android.ensure_android('linux', artifact_mode=artifact_mode, no_interactive=self.no_interactive)