[mingw-webkitgtk] Added win64 support (contributed by Mikkel Kruse Johnsen)

epienbro epienbro at fedoraproject.org
Sun Mar 18 19:41:01 UTC 2012


commit 4df189108fccfb113734cbc39ae25b627ba4c244
Author: Erik van Pienbroek <epienbro at fedoraproject.org>
Date:   Sun Mar 18 20:40:51 2012 +0100

    Added win64 support (contributed by Mikkel Kruse Johnsen)

 changeset_r107098.diff                      |   13 +++
 mingw-webkitgtk.spec                        |  140 ++++++++++++++++++++------
 webkitgtk-fix-threading-win-on-x86_64.patch |   16 +++
 3 files changed, 136 insertions(+), 33 deletions(-)
---
diff --git a/changeset_r107098.diff b/changeset_r107098.diff
new file mode 100644
index 0000000..95d795b
--- /dev/null
+++ b/changeset_r107098.diff
@@ -0,0 +1,13 @@
+Index: trunk/Tools/gtk/common.py
+===================================================================
+--- trunk/Tools/gtk/common.py	(revision 106786)
++++ trunk/Tools/gtk/common.py	(revision 107098)
+@@ -65,4 +65,8 @@
+         return build_dir
+ 
++    build_dir = os.getcwd()
++    if is_valid_build_directory(build_dir):
++        return build_dir
++
+     print 'Could not determine build directory.'
+     sys.exit(1)
diff --git a/mingw-webkitgtk.spec b/mingw-webkitgtk.spec
index a870924..076412f 100644
--- a/mingw-webkitgtk.spec
+++ b/mingw-webkitgtk.spec
@@ -1,13 +1,14 @@
-%global __strip %{mingw32_strip}
-%global __objdump %{mingw32_objdump}
-%define __debug_install_post %{mingw32_debug_install_post}
+%?mingw_package_header
 
 ## NOTE: Lots of files in various subdirectories have the same name (such as
 ## "LICENSE") so this short macro allows us to distinguish them by using their
 ## directory names (from the source tree) as prefixes for the files.
-%global add_to_doc_files() \
-    mkdir -p %{buildroot}%{_docdir}/%{name}-%{version} ||: ; \
-    cp -p %1  %{buildroot}%{_docdir}/%{name}-%{version}/$(echo '%1' | sed -e 's!/!.!g')
+%global add_to_doc_files32() \
+    mkdir -p %{buildroot}%{_docdir}/mingw32-%{mingw_pkg_name}-%{version} ||: ; \
+    cp -p %1  %{buildroot}%{_docdir}/mingw32-%{mingw_pkg_name}-%{version}/$(echo '%1' | sed -e 's!/!.!g')
+%global add_to_doc_files64() \
+    mkdir -p %{buildroot}%{_docdir}/mingw64-%{mingw_pkg_name}-%{version} ||: ; \
+    cp -p %1  %{buildroot}%{_docdir}/mingw64-%{mingw_pkg_name}-%{version}/$(echo '%1' | sed -e 's!/!.!g')
 
 #define	svn_revision	41071
 
@@ -41,7 +42,7 @@
 
 Name:		mingw-webkitgtk
 Version:	1.7.5
-Release:	6%{?dist}
+Release:	7%{?dist}
 Summary:	MinGW Windows web content engine library
 
 Group:		Development/Libraries
@@ -72,6 +73,14 @@ Patch5:		0002-GTK-Add-missing-pango-include-dir-to-fix-build.patch
 # Use correct ICU import library name, fixed upstream as well
 Patch6:		webkitgtk-1.7.5-icu.patch
 
+# The compilation of ThreadingWin.cpp fails on x86_64
+# ../Source/JavaScriptCore/wtf/ThreadingWin.cpp:220:45: error: cast from 'void*' to 'unsigned int' loses precision [-fpermissive]
+# https://bugs.webkit.org/show_bug.cgi?id=78389
+Patch8:         webkitgtk-fix-threading-win-on-x86_64.patch
+
+# Generating docs is broken when using out of source builds
+Patch9:         changeset_r107098.diff
+
 BuildArch:	noarch
 
 BuildRequires:	bison
@@ -113,6 +122,7 @@ as well as the sample GtkLauncher tool.
 This is the MinGW port of WebKitGTK+
 
 
+# Win32
 %package -n mingw32-webkitgtk
 Summary:	MinGW Windows web content engine library
 
@@ -123,17 +133,33 @@ as well as the sample GtkLauncher tool.
 
 This is the MinGW port of WebKitGTK+
 
-
 %package -n mingw32-webkitgtk-static
 Summary:	Static version of the MinGW Windows WebKitGTK+ library
 Requires:	mingw32-webkitgtk = %{version}-%{release}
-Group:		Development/Libraries
 
 %description -n mingw32-webkitgtk-static
 Static version of the MinGW Windows WebKitGTK+ library.
 
+# Win64
+%package -n mingw64-webkitgtk
+Summary:        MinGW Windows web content engine library
+
+%description -n mingw64-webkitgtk
+WebKitGTK+ is an open-source Web content engine library.
+This package contains the shared libraries for the WebKit GTK+ port
+as well as the sample GtkLauncher tool.
+
+This is the MinGW port of WebKitGTK+
+
+%package -n mingw64-webkitgtk-static
+Summary:        Static version of the MinGW Windows WebKitGTK+ library
+Requires:       mingw64-webkitgtk = %{version}-%{release}
 
-%{?mingw32_debug_package}
+%description -n mingw64-webkitgtk-static
+Static version of the MinGW Windows WebKitGTK+ library.
+
+
+%?mingw_debug_package
 
 
 %prep
@@ -145,6 +171,8 @@ Static version of the MinGW Windows WebKitGTK+ library.
 %patch4 -p1 -b .webview_map
 %patch5 -p1 -b .pango_includes
 %patch6 -p1 -b .icu
+%patch8 -p1 -b .threading_x86_64
+%patch9 -p1 -b .docs
 
 autoreconf --verbose --install -I Source/autotools
 
@@ -153,7 +181,7 @@ autoreconf --verbose --install -I Source/autotools
 # lower debug level to prevent memory exhaustion by linker
 %global mingw32_cflags %(echo %{mingw32_cflags} | sed 's/-g /-g1 /')
 
-%{mingw32_configure}						\
+%mingw_configure						\
 			--with-target=win32			\
 			--with-gtk=2.0				\
 			--with-font-backend=freetype		\
@@ -168,47 +196,71 @@ autoreconf --verbose --install -I Source/autotools
 %{?with_svg:		--enable-svg-filters		}	\
 %{?with_wml:		--enable-wml			}
 	
-make %{?_smp_mflags} V=99
+%mingw_make %{?_smp_mflags} V=99
 
 
 %install
-make install DESTDIR=%{buildroot}
-install -m 755 Programs/.libs/GtkLauncher.exe %{buildroot}%{mingw32_bindir}
+%mingw_make install DESTDIR=%{buildroot}
+
+install -m 755 build_win64/Programs/.libs/GtkLauncher.exe %{buildroot}%{mingw32_bindir}
+install -m 755 build_win64/Programs/.libs/GtkLauncher.exe %{buildroot}%{mingw64_bindir}
 
 # Drop all .la files
 find $RPM_BUILD_ROOT -name "*.la" -delete
 
 # Remove docs which duplicate those in Fedora native.
 rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/gtk-doc
+rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/gtk-doc
 
-%find_lang webkit-2.0
-
+%mingw_find_lang webkit-2.0
 
 ## Copy over and rename the various files for %%doc inclusion.
-%add_to_doc_files Source/WebKit/LICENSE
-%add_to_doc_files Source/WebKit/gtk/po/README
-%add_to_doc_files Source/WebKit/gtk/NEWS
-%add_to_doc_files Source/WebCore/icu/LICENSE
-%add_to_doc_files Source/WebCore/LICENSE-APPLE
-%add_to_doc_files Source/WebCore/LICENSE-LGPL-2
-%add_to_doc_files Source/WebCore/LICENSE-LGPL-2.1
-%add_to_doc_files Source/JavaScriptCore/COPYING.LIB
-%add_to_doc_files Source/JavaScriptCore/THANKS
-%add_to_doc_files Source/JavaScriptCore/AUTHORS
-%add_to_doc_files Source/JavaScriptCore/icu/README
-%add_to_doc_files Source/JavaScriptCore/icu/LICENSE
-
-
-%postun
+%add_to_doc_files32 Source/WebKit/LICENSE
+%add_to_doc_files32 Source/WebKit/gtk/po/README
+%add_to_doc_files32 Source/WebKit/gtk/NEWS
+%add_to_doc_files32 Source/WebCore/icu/LICENSE
+%add_to_doc_files32 Source/WebCore/LICENSE-APPLE
+%add_to_doc_files32 Source/WebCore/LICENSE-LGPL-2
+%add_to_doc_files32 Source/WebCore/LICENSE-LGPL-2.1
+%add_to_doc_files32 Source/JavaScriptCore/COPYING.LIB
+%add_to_doc_files32 Source/JavaScriptCore/THANKS
+%add_to_doc_files32 Source/JavaScriptCore/AUTHORS
+%add_to_doc_files32 Source/JavaScriptCore/icu/README
+%add_to_doc_files32 Source/JavaScriptCore/icu/LICENSE
+
+%add_to_doc_files64 Source/WebKit/LICENSE
+%add_to_doc_files64 Source/WebKit/gtk/po/README
+%add_to_doc_files64 Source/WebKit/gtk/NEWS
+%add_to_doc_files64 Source/WebCore/icu/LICENSE
+%add_to_doc_files64 Source/WebCore/LICENSE-APPLE
+%add_to_doc_files64 Source/WebCore/LICENSE-LGPL-2
+%add_to_doc_files64 Source/WebCore/LICENSE-LGPL-2.1
+%add_to_doc_files64 Source/JavaScriptCore/COPYING.LIB
+%add_to_doc_files64 Source/JavaScriptCore/THANKS
+%add_to_doc_files64 Source/JavaScriptCore/AUTHORS
+%add_to_doc_files64 Source/JavaScriptCore/icu/README
+%add_to_doc_files64 Source/JavaScriptCore/icu/LICENSE
+
+
+%postun -n mingw32-webkitgtk
 if [ $1 -eq 0 ] ; then
     /usr/bin/glib-compile-schemas %{mingw32_datadir}/glib-2.0/schemas &> /dev/null || :
 fi
 
-%posttrans
+%posttrans -n mingw32-webkitgtk
 /usr/bin/glib-compile-schemas %{mingw32_datadir}/glib-2.0/schemas &> /dev/null || :
 
+%postun -n mingw64-webkitgtk
+if [ $1 -eq 0 ] ; then
+    /usr/bin/glib-compile-schemas %{mingw64_datadir}/glib-2.0/schemas &> /dev/null || :
+fi
 
-%files -n mingw32-webkitgtk -f webkit-2.0.lang
+%posttrans -n mingw64-webkitgtk
+/usr/bin/glib-compile-schemas %{mingw64_datadir}/glib-2.0/schemas &> /dev/null || :
+
+
+# Win32
+%files -n mingw32-webkitgtk -f mingw32-webkit-2.0.lang
 %{_docdir}/%{name}-%{version}/
 %{mingw32_bindir}/jsc-1.exe
 %{mingw32_bindir}/GtkLauncher.exe
@@ -226,8 +278,30 @@ fi
 %{mingw32_libdir}/libjavascriptcoregtk-1.0.a
 %{mingw32_libdir}/libwebkitgtk-1.0.a
 
+# Win64
+%files -n mingw64-webkitgtk -f mingw64-webkit-2.0.lang
+%{_docdir}/%{name}-%{version}/
+%{mingw64_bindir}/jsc-1.exe
+%{mingw64_bindir}/GtkLauncher.exe
+%{mingw64_bindir}/libjavascriptcoregtk-1.0-0.dll
+%{mingw64_bindir}/libwebkitgtk-1.0-0.dll
+%{mingw64_includedir}/webkitgtk-1.0/
+%{mingw64_libdir}/libjavascriptcoregtk-1.0.dll.a
+%{mingw64_libdir}/libwebkitgtk-1.0.dll.a
+%{mingw64_libdir}/pkgconfig/javascriptcoregtk-1.0.pc
+%{mingw64_libdir}/pkgconfig/webkit-1.0.pc
+%{mingw64_datadir}/glib-2.0/schemas/org.webkitgtk-1.0.gschema.xml
+%{mingw64_datadir}/webkitgtk-1.0/
+
+%files -n mingw64-webkitgtk-static
+%{mingw64_libdir}/libjavascriptcoregtk-1.0.a
+%{mingw64_libdir}/libwebkitgtk-1.0.a
+
 
 %changelog
+* Sun Mar 18 2012 Erik van Pienbroek <epienbro at fedoraproject.org> - 1.7.5-7
+- Added win64 support (contributed by Mikkel Kruse Johnsen)
+
 * Tue Mar 06 2012 Kalev Lember <kalevlember at gmail.com> - 1.7.5-6
 - Renamed the source package to mingw-webkitgtk (#800452)
 - Use mingw macros without leading underscore
diff --git a/webkitgtk-fix-threading-win-on-x86_64.patch b/webkitgtk-fix-threading-win-on-x86_64.patch
new file mode 100644
index 0000000..a534e0d
--- /dev/null
+++ b/webkitgtk-fix-threading-win-on-x86_64.patch
@@ -0,0 +1,16 @@
+diff --git a/Source/JavaScriptCore/wtf/ThreadingWin.cpp b/Source/JavaScriptCore/wtf/ThreadingWin.cpp
+index ac0f73f..464bc32 100644
+--- a/Source/JavaScriptCore/wtf/ThreadingWin.cpp
++++ b/Source/JavaScriptCore/wtf/ThreadingWin.cpp
+@@ -217,7 +217,10 @@ static unsigned __stdcall wtfThreadEntryPoint(void* param)
+     ThreadSpecificThreadExit();
+ #endif
+ 
+-    return reinterpret_cast<unsigned>(result);
++    if (!result)
++        return 1;
++
++    return 0;
+ }
+ 
+ ThreadIdentifier createThreadInternal(ThreadFunction entryPoint, void* data, const char* threadName)


More information about the scm-commits mailing list