Browse Source

build the MinGW-w64 target using the packages in Debian Jessie

The MinGW-w64 packages in Ubuntu 14.10 (earlier host environment)
were broken and hence used a chroot of Ubuntu 14.04 LTS, which
is no longer required. This effectively reverts the commits:

a3aae5ecc3c10c1de10d4683ab14e335a593cbb5
0f8e049647a2a78af8344b2e04190eb40dae98d6
Ashish Kulkarni 10 years ago
parent
commit
33f6a47630
2 changed files with 12 additions and 24 deletions
  1. 2 2
      INSTALL.md
  2. 10 22
      scripts/build.py

+ 2 - 2
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 64-bit Debian Jessie (i.e. testing release), and
+Building is supported only on 64-bit Debian Jessie (i.e. stable 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.
@@ -47,7 +47,7 @@ Ubuntu Trusty  | `sudo scripts/build.py setup-schroot-trusty`  | `scripts/build.
 Ubuntu Precise | `sudo scripts/build.py setup-schroot-precise` | `scripts/build.py precise-i386`          | `scripts/build.py precise-amd64`
 CentOS 7       | `sudo scripts/build.py setup-schroot-centos7` | not available                            | `scripts/build.py centos7-amd64`
 CentOS 6       | `sudo scripts/build.py setup-schroot-centos6` | `scripts/build.py centos6-i386`          | `scripts/build.py centos6-amd64`
-MinGW-w64      | `sudo scripts/build.py setup-mingw_w64`       | `scripts/build.py mingw-w64-cross-win32` | `scripts/build.py mingw-w64-cross-win64`
+MinGW-w64      | `sudo scripts/build.py setup-mingw-w64`       | `scripts/build.py mingw-w64-cross-win32` | `scripts/build.py mingw-w64-cross-win64`
 
 The MinGW-w64 toolchain can cross-compile 32/64-bit Windows binaries from
 Linux -- it is useful for targetting Windows XP/Windows 2003, which are not

+ 10 - 22
scripts/build.py

@@ -23,7 +23,7 @@ BUILDERS = {
     'source-tarball':        'source_tarball',
     'msvc2013-win32':        'msvc',
     'msvc2013-win64':        'msvc',
-    'setup-mingw_w64':       'setup_schroot',
+    'setup-mingw-w64':       'setup_mingw_w64',
     'setup-schroot-centos6': 'setup_schroot',
     'setup-schroot-centos7': 'setup_schroot',
     'setup-schroot-wheezy':  'setup_schroot',
@@ -326,20 +326,6 @@ deb http://archive.ubuntu.com/ubuntu/ precise-security main restricted universe
         ('write_file', 'update.sh', 'yum update -y\ngem update fpm\n'),
         ('fpm_setup',  'fpm_package.sh'),
         ('schroot_conf', 'CentOS 7')
-    ],
-
-    'mingw_w64:amd64': [
-        ('set_alias', 'mingw-w64'),
-        ('debootstrap', 'trusty', 'http://archive.ubuntu.com/ubuntu/'),
-        ('write_file', 'etc/apt/sources.list', """
-deb http://archive.ubuntu.com/ubuntu/ trusty          main restricted universe multiverse
-deb http://archive.ubuntu.com/ubuntu/ trusty-updates  main restricted universe multiverse
-deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse"""),
-        ('shell', 'apt-get update'),
-        ('shell', 'apt-get dist-upgrade --assume-yes'),
-        ('shell', 'apt-get install --assume-yes build-essential mingw-w64 nsis python ruby perl gperf bison flex git'),
-        ('write_file', 'update.sh', 'apt-get update\napt-get dist-upgrade --assume-yes\n'),
-        ('schroot_conf', 'MinGW-w64 on Ubuntu Trusty')
     ]
 }
 
@@ -839,6 +825,12 @@ def build_update_schroot(config, basedir):
         message('******************* %s\n' % name[name.index('wkhtmltopdf-'):])
         shell('schroot -c %s -- /bin/bash /update.sh' % name[name.index('wkhtmltopdf-'):])
 
+def check_setup_mingw_w64(config):
+    check_running_on_debian()
+
+def build_setup_mingw_w64(config, basedir):
+    install_packages('build-essential', 'mingw-w64', 'nsis', 'perl', 'git')
+
 def check_source_tarball(config):
     if not get_output('git', 'rev-parse', '--short', 'HEAD'):
         error("This can only be run inside a git checkout.")
@@ -971,13 +963,9 @@ MINGW_W64_PREFIX = {
 }
 
 def check_mingw64_cross(config):
-    chroot_shell('mingw-w64', '%s-gcc --version' % MINGW_W64_PREFIX[rchop(config, '-dbg')])
+    shell('%s-gcc --version' % MINGW_W64_PREFIX[rchop(config, '-dbg')])
 
 def build_mingw64_cross(config, basedir):
-    os.chdir(os.path.realpath(os.path.join(basedir, '..')))
-    chroot_shell('mingw-w64', 'python scripts/build.py %s -chroot-build' % ' '.join(sys.argv[1:]))
-
-def chroot_build_mingw64_cross(config, basedir):
     version, simple_version = get_version(basedir)
     build_deplibs(config, basedir, mingw_w64=MINGW_W64_PREFIX.get(rchop(config, '-dbg')))
 
@@ -1014,12 +1002,12 @@ def chroot_build_mingw64_cross(config, basedir):
     shell('make')
     shutil.copy('bin/libwkhtmltox0.a', 'bin/wkhtmltox.lib')
     shell('rm -f bin/lib*.dll')
-    for dll in ['libgcc_s_sjlj-1.dll', 'libstdc++-6.dll', 'libwinpthread-1.dll']:
+    for dll in ['libgcc_s_sjlj-1.dll', 'libgcc_s_seh-1.dll', 'libstdc++-6.dll']:
         dll_path = get_output('dpkg', '-S', dll)
         if dll_path:
             for line in dll_path.split('\n'):
                 loc = line[1+line.index(':'):].strip()
-                if exists(loc) and MINGW_W64_PREFIX[rchop(config, '-dbg')] in loc:
+                if exists(loc) and MINGW_W64_PREFIX[rchop(config, '-dbg')] in loc and '-posix' not in loc:
                     shell('cp %s bin/' % loc)
 
     os.chdir(os.path.join(basedir, '..'))