Bug 1344244 - Pre: Support mobile/android in bootstrap on CentOS. r=glandium
authorNick Alexander <nalexander@mozilla.com>
Wed, 05 Jul 2017 15:06:46 -0700
changeset 418212 1515fd3c7003a92d954b839e300f2a1a743dafc7
parent 418211 962cf9dd104c650e014590b916689537c6fb1cb8
child 418213 7c127a4f904a704de6ee521ec50749d4dd1ebb6c
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1344244
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1344244 - Pre: Support mobile/android in bootstrap on CentOS. r=glandium This works in a centos:7 docker image. MozReview-Commit-ID: LZEgSho7xb
python/mozboot/mozboot/centosfedora.py
--- a/python/mozboot/mozboot/centosfedora.py
+++ b/python/mozboot/mozboot/centosfedora.py
@@ -17,16 +17,17 @@ class CentOSFedoraBootstrapper(StyloInst
         self.version = version
         self.dist_id = dist_id
 
         self.group_packages = []
 
         self.packages = [
             'autoconf213',
             'mercurial',
+            'which',
         ]
 
         self.browser_group_packages = [
             'GNOME Software Development',
         ]
 
         self.browser_packages = [
             'alsa-lib-devel',
@@ -38,17 +39,21 @@ class CentOSFedoraBootstrapper(StyloInst
             'libstdc++-static',
             'libXt-devel',
             'mesa-libGL-devel',
             'pulseaudio-libs-devel',
             'wireless-tools-devel',
             'yasm',
         ]
 
-        self.mobile_android_packages = []
+        self.mobile_android_packages = [
+            'java-1.8.0-openjdk-devel',
+            # For downloading the Android SDK and NDK.
+            'wget',
+        ]
 
         if self.distro in ('CentOS', 'CentOS Linux'):
             self.group_packages += [
                 'Development Tools',
                 'Development Libraries',
                 'GNOME Software Development',
             ]
 
@@ -70,58 +75,45 @@ class CentOSFedoraBootstrapper(StyloInst
                 'redhat-rpm-config',
             ]
 
             self.browser_packages += [
                 'gcc-c++',
                 'python-dbus',
             ]
 
-            self.mobile_android_packages += [
-                'java-1.8.0-openjdk-devel',
-                'ncurses-devel.i686',
-                'libstdc++.i686',
-                'zlib-devel.i686',
-            ]
-
     def install_system_packages(self):
         self.dnf_groupinstall(*self.group_packages)
         self.dnf_install(*self.packages)
 
     def install_browser_packages(self):
         self.ensure_browser_packages()
 
     def install_browser_artifact_mode_packages(self):
         self.ensure_browser_packages(artifact_mode=True)
 
     def install_mobile_android_packages(self):
-        if self.distro in ('CentOS', 'CentOS Linux'):
-            BaseBootstrapper.install_mobile_android_packages(self)
-        elif self.distro == 'Fedora':
-            self.install_fedora_mobile_android_packages()
+        self.ensure_mobile_android_packages(artifact_mode=False)
 
     def install_mobile_android_artifact_mode_packages(self):
-        if self.distro in ('CentOS', 'CentOS Linux'):
-            BaseBootstrapper.install_mobile_android_artifact_mode_packages(self)
-        elif self.distro == 'Fedora':
-            self.install_fedora_mobile_android_packages(artifact_mode=True)
+        self.ensure_mobile_android_packages(artifact_mode=True)
 
     def ensure_browser_packages(self, artifact_mode=False):
         # TODO: Figure out what not to install for artifact mode
         self.dnf_groupinstall(*self.browser_group_packages)
         self.dnf_install(*self.browser_packages)
 
         if self.distro in ('CentOS', 'CentOS Linux'):
             yasm = 'http://pkgs.repoforge.org/yasm/yasm-1.1.0-1.el6.rf.i686.rpm'
             if platform.architecture()[0] == '64bit':
                 yasm = 'http://pkgs.repoforge.org/yasm/yasm-1.1.0-1.el6.rf.x86_64.rpm'
 
             self.run_as_root(['rpm', '-ivh', yasm])
 
-    def install_fedora_mobile_android_packages(self, artifact_mode=False):
+    def ensure_mobile_android_packages(self, artifact_mode=False):
         import android
 
         # Install Android specific packages.
         self.dnf_install(*self.mobile_android_packages)
 
         # Fetch Android SDK and NDK.
         mozbuild_path = os.environ.get('MOZBUILD_STATE_PATH', os.path.expanduser(os.path.join('~', '.mozbuild')))
         self.sdk_path = os.environ.get('ANDROID_SDK_HOME', os.path.join(mozbuild_path, 'android-sdk-linux'))