зеркало из https://github.com/mozilla/gecko-dev.git
Bug 913965 - Don't use build-dep for installing dependencies; install modern Mercurial on Ubuntu; r=glandium
DONTBUILD (NPOTB)
This commit is contained in:
Родитель
0d94a76251
Коммит
540afa6b4d
|
@ -1,12 +1,40 @@
|
|||
# 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/.
|
||||
|
||||
import os
|
||||
# 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/.
|
||||
|
||||
from mozboot.base import BaseBootstrapper
|
||||
|
||||
class DebianBootstrapper(BaseBootstrapper):
|
||||
# These are common packages for all Debian-derived distros (such as
|
||||
# Ubuntu).
|
||||
COMMON_PACKAGES = [
|
||||
'autoconf2.13',
|
||||
'build-essential',
|
||||
'ccache',
|
||||
'libasound2-dev',
|
||||
'libcurl4-openssl-dev',
|
||||
'libdbus-1-dev',
|
||||
'libdbus-glib-1-dev',
|
||||
'libgconf2-dev',
|
||||
'libgstreamer0.10-dev',
|
||||
'libgstreamer-plugins-base0.10-dev',
|
||||
'libgtk2.0-dev',
|
||||
'libiw-dev',
|
||||
'libnotify-dev',
|
||||
'libxt-dev',
|
||||
'mercurial',
|
||||
'mesa-common-dev',
|
||||
'python-dev',
|
||||
'unzip',
|
||||
'uuid',
|
||||
'yasm',
|
||||
'xvfb',
|
||||
'zip',
|
||||
]
|
||||
|
||||
# Subclasses can add packages to this variable to have them installed.
|
||||
DISTRO_PACKAGES = []
|
||||
|
||||
def __init__(self, version, dist_id):
|
||||
BaseBootstrapper.__init__(self)
|
||||
|
||||
|
@ -14,18 +42,8 @@ class DebianBootstrapper(BaseBootstrapper):
|
|||
self.dist_id = dist_id
|
||||
|
||||
def install_system_packages(self):
|
||||
self.run_as_root(['apt-get', 'build-dep', 'iceweasel'])
|
||||
packages = self.COMMON_PACKAGES + self.DISTRO_PACKAGES
|
||||
self.apt_install(*packages)
|
||||
|
||||
self.apt_install(
|
||||
'autoconf2.13',
|
||||
'libasound2-dev',
|
||||
'libcurl4-openssl-dev',
|
||||
'libgstreamer0.10-dev',
|
||||
'libgstreamer-plugins-base0.10-dev',
|
||||
'libiw-dev',
|
||||
'libnotify-dev',
|
||||
'libxt-dev',
|
||||
'mercurial',
|
||||
'mesa-common-dev',
|
||||
'uuid',
|
||||
'yasm')
|
||||
def _update_package_manager(self):
|
||||
self.run_as_root(['apt-get', 'update'])
|
||||
|
|
|
@ -1,39 +1,38 @@
|
|||
# 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/.
|
||||
# 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/.
|
||||
|
||||
import os
|
||||
|
||||
from mozboot.base import BaseBootstrapper
|
||||
from mozboot.debian import DebianBootstrapper
|
||||
|
||||
class UbuntuBootstrapper(BaseBootstrapper):
|
||||
def __init__(self, version, dist_id):
|
||||
BaseBootstrapper.__init__(self)
|
||||
|
||||
self.version = version
|
||||
self.dist_id = dist_id
|
||||
MERCURIAL_PPA = '''
|
||||
Ubuntu does not provide a modern Mercurial in its package repository. So,
|
||||
we will install a PPA that does.
|
||||
'''.strip()
|
||||
|
||||
def install_system_packages(self):
|
||||
self.run_as_root(['apt-get', 'build-dep', 'firefox'])
|
||||
|
||||
self.apt_install(
|
||||
'autoconf2.13',
|
||||
'libasound2-dev',
|
||||
'libcurl4-openssl-dev',
|
||||
'libgstreamer0.10-dev',
|
||||
'libgstreamer-plugins-base0.10-dev',
|
||||
'libiw-dev',
|
||||
'libnotify-dev',
|
||||
'libxt-dev',
|
||||
'mercurial',
|
||||
'mesa-common-dev',
|
||||
'uuid',
|
||||
'yasm')
|
||||
|
||||
def _update_package_manager(self):
|
||||
self.run_as_root(['apt-get', 'update'])
|
||||
# Ubuntu shares much logic with Debian, so it inherits from it.
|
||||
class UbuntuBootstrapper(DebianBootstrapper):
|
||||
DISTRO_PACKAGES = [
|
||||
# This contains add-apt-repository.
|
||||
'software-properties-common',
|
||||
]
|
||||
|
||||
def upgrade_mercurial(self, current):
|
||||
self._ensure_package_manager_updated()
|
||||
# Ubuntu releases up through at least 13.04 don't ship a modern
|
||||
# Mercurial. So we hook up a PPA that provides one.
|
||||
self._add_ppa('mercurial-ppa/releases')
|
||||
self._update_package_manager()
|
||||
self.apt_install('mercurial')
|
||||
|
||||
def _add_ppa(self, ppa):
|
||||
# Detect PPAs that have already been added. Sadly add-apt-repository
|
||||
# doesn't do this for us and will import keys, etc every time. This
|
||||
# incurs a user prompt and is annoying, so we try to prevent it.
|
||||
list_file = ppa.replace('/', '-')
|
||||
for source in os.listdir('/etc/apt/sources.list.d'):
|
||||
if source.startswith(list_file) and source.endswith('.list'):
|
||||
return
|
||||
|
||||
self.run_as_root(['add-apt-repository', 'ppa:%s' % ppa])
|
||||
|
|
Загрузка…
Ссылка в новой задаче