diff options
Diffstat (limited to 'acprep')
-rwxr-xr-x | acprep | 111 |
1 files changed, 56 insertions, 55 deletions
@@ -12,11 +12,7 @@ import optparse import os import re import shutil -import string import sys -import time -import tempfile -import datetime try: import hashlib @@ -57,16 +53,17 @@ def which(program): class BoostInfo(object): def dependencies(self, system): - if system == 'darwin-homebrew': + if system in ['darwin-homebrew']: return [ 'boost' ] - if system == 'darwin-macports': + if system in ['darwin-macports']: return [ 'boost-jam', 'boost', '+python27+universal' ] - if system == 'centos': + if system in ['centos']: return [ 'boost-devel' ] - elif system == 'ubuntu-xenial': + elif system in ['ubuntu-bionic', 'ubuntu-xenial', + 'ubuntu-trusty', 'ubuntu-cosmic']: return [ 'libboost-dev', 'libboost-date-time-dev', 'libboost-filesystem-dev', @@ -74,19 +71,10 @@ class BoostInfo(object): 'libboost-python-dev', 'libboost-regex-dev', 'libboost-system-dev', - 'libboost-test-dev' ] - - elif system == 'ubuntu-trusty': - return [ 'libboost-dev', - 'libboost-date-time-dev', - 'libboost-filesystem-dev', - 'libboost-iostreams-dev', - 'libboost-python-dev', - 'libboost-regex-dev', - 'libboost-system-dev', - 'libboost-test-dev' ] + 'libboost-test-dev', + 'tzdata' ] - elif system == 'ubuntu-saucy' or system == 'ubuntu-precise': + elif system in [ 'ubuntu-saucy', 'ubuntu-precise']: return [ 'autopoint', 'libboost-dev', 'libboost-test-dev', @@ -96,7 +84,7 @@ class BoostInfo(object): 'libboost-iostreams-dev', 'libboost-python-dev' ] - elif system == 'ubuntu-lucid': + elif system in ['ubuntu-lucid']: return [ 'bjam', 'autopoint', 'libboost-dev', 'libboost-regex-dev', @@ -514,11 +502,11 @@ class PrepareBuild(CommandLineApp): self.log.info("Installing Ledger's build dependencies ...") - system = self.get_stdout('uname', '-s') + system = self.get_stdout('uname', '-s').decode('utf8') if system == 'Darwin': if exists('/opt/local/bin/port'): - self.log.info('Looks like you are using MacPorts on OS X') + self.log.info('Looks like you are using MacPorts on macOS') packages = [ 'sudo', 'port', 'install', '-f', 'automake', 'autoconf', 'libtool', @@ -535,7 +523,7 @@ class PrepareBuild(CommandLineApp): self.log.info('Executing: ' + ' '.join(packages)) self.execute(*packages) elif exists('/usr/local/bin/brew') or exists('/opt/local/bin/brew'): - self.log.info('Looks like you are using Homebrew on OS X') + self.log.info('Looks like you are using Homebrew on macOS') packages = [ 'brew', 'install', 'cmake', 'ninja', @@ -544,7 +532,7 @@ class PrepareBuild(CommandLineApp): self.log.info('Executing: ' + ' '.join(packages)) self.execute(*packages) elif exists('/sw/bin/fink'): - self.log.info('Looks like you are using Fink on OS X') + self.log.info('Looks like you are using Fink on macOS') self.log.error("I don't know the package names for Fink yet!") sys.exit(1) @@ -552,14 +540,17 @@ class PrepareBuild(CommandLineApp): if exists('/etc/issue'): issue = open('/etc/issue') if issue.readline().startswith('Ubuntu'): - release = open('/etc/lsb-release') - info = release.read() - release.close() - if re.search('trusty', info): - self.log.info('Looks like you are using APT on Ubuntu Trusty') - packages = [ - 'sudo', 'apt-get', 'install', - 'build-essential', + info = dict([line.strip().split('=', 1) + for line in open('/etc/lsb-release')]) + release = info['DISTRIB_CODENAME'] + self.log.info('Looks like you are using APT on Ubuntu ' + release) + packages = [ + 'sudo', 'apt-get', 'install', + 'build-essential', + ] + + if release == 'bionic': + packages.extend([ 'doxygen', 'cmake', 'ninja-build', @@ -574,12 +565,9 @@ class PrepareBuild(CommandLineApp): 'lcov', 'libutfcpp-dev', 'sloccount' - ] + BoostInfo().dependencies('ubuntu-trusty') - elif re.search('xenial', info): - self.log.info('Looks like you are using APT on Ubuntu Xenial') - packages = [ - 'sudo', 'apt-get', 'install', - 'build-essential', + ]) + elif release == 'trusty': + packages.extend([ 'doxygen', 'cmake', 'ninja-build', @@ -594,13 +582,27 @@ class PrepareBuild(CommandLineApp): 'lcov', 'libutfcpp-dev', 'sloccount' - ] + BoostInfo().dependencies('ubuntu-xenial') - elif re.search('saucy', info): - self.log.info('Looks like you are using APT on Ubuntu Saucy') - packages = [ - 'sudo', 'apt-get', 'install', - 'build-essential', - 'libtool', + ]) + elif release == 'xenial': + packages.extend([ + 'doxygen', + 'cmake', + 'ninja-build', + 'zlib1g-dev', + 'libbz2-dev', + 'python-dev', + 'libgmp3-dev', + 'libmpfr-dev', + 'gettext', + 'libedit-dev', + 'texinfo', + 'lcov', + 'libutfcpp-dev', + 'sloccount' + ]) + elif release == 'saucy': + packages.extend([ + 'doxygen', 'cmake', 'ninja-build', 'zlib1g-dev', @@ -613,12 +615,9 @@ class PrepareBuild(CommandLineApp): 'texinfo', 'lcov', 'sloccount' - ] + BoostInfo().dependencies('ubuntu-saucy') - elif re.search('precise', info): - self.log.info('Looks like you are using APT on Ubuntu Precise') - packages = [ - 'sudo', 'apt-get', 'install', - 'build-essential', + ]) + elif release == 'precise': + packages.extend([ 'libtool', 'cmake', 'zlib1g-dev', @@ -632,11 +631,13 @@ class PrepareBuild(CommandLineApp): 'lcov', 'libutfcpp-dev', 'sloccount' - ] + BoostInfo().dependencies('ubuntu-precise') + ]) else: self.log.info('I do not recognize your version of Ubuntu!') packages = None if packages: + packages.extend( + BoostInfo().dependencies('ubuntu-' + release)) self.log.info('Executing: ' + ' '.join(packages)) self.execute(*packages) @@ -696,7 +697,7 @@ class PrepareBuild(CommandLineApp): elif system.startswith('CYGWIN'): self.log.info('Looks like you are using Cygwin') - self.log.info('Please install the dependencies manually.') + self.log.info('Please install the dependencies manually.') ######################################################################### # Determine the system's basic configuration # @@ -1090,7 +1091,7 @@ being 'debug': debug Debugging and --verify support (default) opt Full optimizations gcov Coverage analysis - gprof Code profiling (for OS X, just use: 'shark -i ledger ...') + gprof Code profiling (for macOS, just use: 'shark -i ledger ...') Next is the optional build PHASE, with 'config' being the default: |