浏览代码

perform all builds on Debian Jessie

Errors when performing debootstrap for Ubuntu were fixed by temporarily
mounting /sys and /proc during the chroot setup process. A workaround
required for the CentOS 7 chroot was also removed as it is not needed
with rinse 3.0.6 present in Debian Jessie.
Ashish Kulkarni 10 年之前
父节点
当前提交
4a9ea92f29
共有 2 个文件被更改,包括 9 次插入2 次删除
  1. 1 1
      INSTALL.md
  2. 8 1
      scripts/build.py

+ 1 - 1
INSTALL.md

@@ -33,7 +33,7 @@ and [non standard home directories](https://github.com/wkhtmltopdf/wkhtmltopdf/i
 (i.e. not located in `/home`) are not supported -- you are advised to
 use a VM instead to build wkhtmltopdf.
 
-Building is supported only on the current Ubuntu release (14.10), and
+Building is supported only on Debian Jessie (i.e. testing release), and
 the binaries are produced in a self-contained chroot environment for the
 target distribution -- you will need to first setup the build environment
 and then only you can perform the build for a 32-bit or 64-bit binary.

+ 8 - 1
scripts/build.py

@@ -313,7 +313,6 @@ deb http://archive.ubuntu.com/ubuntu/ precise-security main restricted universe
         ('append_file', 'etc/yum.conf', 'exclude = *.i?86\n'),
         ('shell', 'yum install -y gcc gcc-c++ make diffutils perl ruby-devel rubygems rpm-build libffi-devel'),
         ('shell', 'yum install -y openssl-devel libX11-devel libXrender-devel libXext-devel fontconfig-devel freetype-devel libjpeg-turbo-devel libpng-devel zlib-devel'),
-        ('shell', 'yum reinstall -y binutils'), # binutils isn't properly installed (no /usr/bin/ld) hence reinstall it
         ('shell', 'gem install fpm --no-ri --no-rdoc'),
         ('write_file', 'update.sh', 'yum update -y\ngem update fpm\n'),
         ('fpm_setup',  'fpm_package.sh'),
@@ -729,6 +728,7 @@ def build_setup_schroot(config, basedir):
 
     for arch in ARCH:
         message('******************* %s-%s\n' % (chroot, arch))
+        unmount  = False
         base_dir = os.environ.get('WKHTMLTOX_CHROOT') or '/var/chroot'
         root_dir = os.path.join(base_dir, 'wkhtmltopdf-%s-%s' % (chroot, arch))
         rmdir(root_dir)
@@ -746,6 +746,10 @@ def build_setup_schroot(config, basedir):
             if name == 'debootstrap':
                 shell('debootstrap --arch=%(arch)s --variant=buildd %(distro)s %(dir)s %(url)s' % {
                     'arch': arch, 'dir': root_dir, 'distro': command[1], 'url': command[2] })
+                cmd = (arch == 'i386' and 'linux32 chroot' or 'chroot')
+                shell('%s %s mount -t proc  proc  /proc' % (cmd, root_dir))
+                shell('%s %s mount -t sysfs sysfs /sys'  % (cmd, root_dir))
+                unmount = True
             elif name == 'rinse':
                 cmd = (arch == 'i386' and 'linux32 rinse' or 'rinse')
                 shell('%s --arch %s --distribution %s --directory %s' % (cmd, arch, command[1], root_dir))
@@ -780,6 +784,9 @@ def build_setup_schroot(config, basedir):
                 if arch == 'i386' and 'amd64' in ARCH:
                     cfg.write('personality=linux32\n')
                 cfg.close()
+        if unmount:
+            shell('umount %s/proc' % root_dir)
+            shell('umount %s/sys'  % root_dir)
 
 def check_update_schroot(config):
     check_running_on_debian()