changeset 6292:4af0bd462b71

Use mingw-w64 (32-bit) instead of mingw.org
author Masamichi Hosoda <trueroad@users.noreply.github.com>
date Sun, 30 Nov 2014 02:58:04 +0900
parents 05b8e42d6792
children e5f0e1d2b917
files gub/gup.py gub/specs/cross/gcc.py gub/specs/ghostscript.py gub/specs/mingw-w64-runtime.py gub/specs/pango.py gub/specs/python.py patches/ghostscript-8.70-mingw-w64-snprintf.patch
diffstat 7 files changed, 58 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/gub/gup.py	Sun Nov 30 02:41:49 2014 +0900
+++ b/gub/gup.py	Sun Nov 30 02:58:04 2014 +0900
@@ -427,7 +427,7 @@
     # FIXME: rename packages, fragile
     if [True for x in [
             'freebsd-runtime',
-            'mingwrt-dev',
+            'mingw-w64-runtime',
             'lilypond-doc',
             'cygwin::',
             ] if x in name]:
--- a/gub/specs/cross/gcc.py	Sun Nov 30 02:41:49 2014 +0900
+++ b/gub/specs/cross/gcc.py	Sun Nov 30 02:58:04 2014 +0900
@@ -85,8 +85,12 @@
 class Gcc__mingw (Gcc):
     source = 'http://ftp.gnu.org/pub/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2'
     dependencies = (Gcc.dependencies
-                + ['mingwrt-dev', 'mingwrt-dll', 'w32api']
+                + ['mingw-w64-runtime']
                 + ['tools::libtool'])
+    configure_flags = (Gcc.configure_flags
+                + misc.join_lines ('''
+--enable-threads=posix
+'''))
     def patch (self):
         Gcc.patch (self)
         self.system('''
--- a/gub/specs/ghostscript.py	Sun Nov 30 02:41:49 2014 +0900
+++ b/gub/specs/ghostscript.py	Sun Nov 30 02:58:04 2014 +0900
@@ -215,6 +215,7 @@
         'ghostscript-8.70-windows-wb.patch',
         'ghostscript-8.70-windows-make.patch',
         'ghostscript-8.70-gs_dll.patch',
+        'ghostscript-8.70-mingw-w64-snprintf.patch',
         ]
     def __init__ (self, settings, source):
         Ghostscript.__init__ (self, settings, source)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gub/specs/mingw-w64-runtime.py	Sun Nov 30 02:58:04 2014 +0900
@@ -0,0 +1,26 @@
+from gub import build
+
+class Mingw_w64_runtime (build.BinaryBuild, build.SdkBuild):
+    source = 'http://sourceforge.net/projects/mingw-w64/files/Toolchains%%20targetting%%20Win32/Personal%%20Builds/mingw-builds/4.8.2/threads-posix/sjlj/i686-4.8.2-release-posix-sjlj-rt_v3-rev4.7z'
+    def install (self):
+        self.system ('''
+mkdir -p %(install_prefix)s/include
+mkdir -p %(install_prefix)s/lib
+mkdir -p %(install_prefix)s/bin
+cd %(srcdir)s/mingw32/i686-w64-mingw32/include/ && tar -C %(srcdir)s/mingw32/i686-w64-mingw32/include/ -cf - . | tar -C %(install_prefix)s/include/ -xf -
+cd %(srcdir)s/mingw32/i686-w64-mingw32/lib/ && tar -C %(srcdir)s/mingw32/i686-w64-mingw32/lib/ -cf - . | tar -C %(install_prefix)s/lib/ -xf -
+cp %(srcdir)s/mingw32/bin/libwinpthread-1.dll %(install_prefix)s/bin/
+rm -f %(install_prefix)s/lib/libgcc_s.a # for cross/gcc conflict
+rm -f %(install_prefix)s/lib/libquadmath-0.dll # for cross/gcc conflict
+rm -f %(install_prefix)s/lib/libssp-0.dll # for cross/gcc conflict
+rm -f %(install_prefix)s/lib/libgcc_s_sjlj-1.dll # for cross/gcc conflict
+rm -f %(install_prefix)s/include/zlib.h # for zlib conflict
+rm -f %(install_prefix)s/include/zconf.h # for zlib conflict
+rm -f %(install_prefix)s/lib/libz.a # for zlib conflict
+rm -f %(install_prefix)s/include/localcharset.h # for libiconv conflict
+rm -f %(install_prefix)s/include/libcharset.h # for libiconv conflict
+rm -f %(install_prefix)s/include/error.h # for regex failure
+rm -f %(install_prefix)s/include/iconv.h # for fontconfig failure
+rm -f %(install_prefix)s/lib/libiconv.a # for ghostscript failure
+rm -fr %(srcdir)s/mingw32/
+''', locals ())
--- a/gub/specs/pango.py	Sun Nov 30 02:41:49 2014 +0900
+++ b/gub/specs/pango.py	Sun Nov 30 02:58:04 2014 +0900
@@ -91,10 +91,6 @@
 ''', '%(install_prefix)s/etc/relocate/pango.reloc', env=locals (), mode='a')
 
 class Pango__mingw (Pango):
-        # FIXME: need -lpthread now?
-        # /home/janneke/vc/gub/target/mingw/root/usr/cross/bin/i686-mingw32-ld: cannot find -lpthread
-    dependencies = (Pango.dependencies
-                + ['pthreads-w32-devel'])
     def create_config_files (self, prefix='/usr'):
         Pango.create_config_files (self, prefix)
         etc = self.expand ('%(install_root)s/%(prefix)s/etc/pango', locals ())
--- a/gub/specs/python.py	Sun Nov 30 02:41:49 2014 +0900
+++ b/gub/specs/python.py	Sun Nov 30 02:58:04 2014 +0900
@@ -119,7 +119,6 @@
     def __init__ (self, settings, source):
         Python.__init__ (self, settings, source)
         self.target_gcc_flags = '-DMS_WINDOWS -DPy_WIN_WIDE_FILENAMES -I%(system_prefix)s/include' % self.settings.__dict__
-    dependencies = Python.dependencies + ['pthreads-w32-devel']
     # FIXME: first is cross compile + mingw patch, backported to
     # 2.4.2 and combined in one patch; move to cross-Python?
     def patch (self):
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/ghostscript-8.70-mingw-w64-snprintf.patch	Sun Nov 30 02:58:04 2014 +0900
@@ -0,0 +1,25 @@
+--- a/base/gp_mswin.c	2014-11-29 16:00:46.394874900 +0900
++++ b/base/gp_mswin.c	2014-11-29 16:01:09.262874900 +0900
+@@ -716,22 +716,3 @@
+ #endif
+ }
+ 
+-/* -------------------------  _snprintf -----------------------------*/
+-
+-/* Microsoft Visual C++ 2005  doesn't properly define snprintf,
+-   which is defined in the C standard ISO/IEC 9899:1999 (E) */
+-
+-int snprintf(char *buffer, size_t count, const char *format, ...)
+-{
+-    if (count > 0) {
+-	va_list args;
+-	int n; 
+-
+-	va_start(args, format);
+-	n = _vsnprintf(buffer, count, format, args);
+-	buffer[count - 1] = 0;
+-	va_end(args);
+-	return n;
+-    } else
+-	return 0;
+-}