From 26cd987cee6f50001c41d78abc9cd1d853b456e1e5114b76f3742a2a224e612d Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Tue, 2 Oct 2012 21:16:54 +0000 Subject: [PATCH] Accepting request 135945 from home:sbrabec:branches:GNOME:Apps - libEMF is now available on all platforms. Fix 64-bit build (bgo#675495, dia-libemf-64bit.patch). OBS-URL: https://build.opensuse.org/request/show/135945 OBS-URL: https://build.opensuse.org/package/show/GNOME:Apps/dia?expand=0&rev=18 --- dia-libemf-64bit.patch | 27 +++++++++++++++++++++++++++ dia.changes | 6 ++++++ dia.spec | 11 +++++++++-- 3 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 dia-libemf-64bit.patch diff --git a/dia-libemf-64bit.patch b/dia-libemf-64bit.patch new file mode 100644 index 0000000..362c1c4 --- /dev/null +++ b/dia-libemf-64bit.patch @@ -0,0 +1,27 @@ +From 222d8f1b5c47408900638955b094b6a6e28dcc20 Mon Sep 17 00:00:00 2001 +From: Hans Breuer +Date: Sun, 20 May 2012 17:35:26 +0000 +Subject: Bug 675495 - Compile error with libEMF on 64bit + +We have to define STRICT to make libemf/64 work. Otherwise there is +wmf.cpp:1383:40: error: cast from 'void*' to 'W32::HDC' loses precision +--- +Index: dia-0.97.2/plug-ins/wmf/wmf.cpp +=================================================================== +--- dia-0.97.2.orig/plug-ins/wmf/wmf.cpp ++++ dia-0.97.2/plug-ins/wmf/wmf.cpp +@@ -53,9 +53,14 @@ typedef W32::LOGFONTW LOGFONTW; + #include + + #elif HAVE_LIBEMF ++/* We have to define STRICT to make libemf/64 work. Otherwise there is ++wmf.cpp:1383:40: error: cast from 'void*' to 'W32::HDC' loses precision ++ */ ++#define STRICT + namespace W32 { + # include + } ++#undef STRICT + #else + # include "wmf_gdi.h" + # define SAVE_EMF diff --git a/dia.changes b/dia.changes index 545bfa6..b70de86 100644 --- a/dia.changes +++ b/dia.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Sep 25 17:35:23 CEST 2012 - sbrabec@suse.cz + +- libEMF is now available on all platforms. Fix 64-bit build + (bgo#675495, dia-libemf-64bit.patch). + ------------------------------------------------------------------- Wed Aug 15 09:38:09 UTC 2012 - dimstar@opensuse.org diff --git a/dia.spec b/dia.spec index 6f7ca93..389d624 100644 --- a/dia.spec +++ b/dia.spec @@ -21,9 +21,13 @@ BuildRequires: docbook-xsl-stylesheets BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: intltool -%ifarch %ix86 -# libEMF is not on x86_64 +%if 0%{?suse_version} > 1210 BuildRequires: libEMF-devel +%else +%ifarch %ix86 +# libEMF was not on x86_64 before 12.2 +BuildRequires: libEMF-devel +%endif %endif BuildRequires: libgnomeui-devel BuildRequires: libtool @@ -58,6 +62,8 @@ Patch17: dia-remove-datetime.patch Patch18: dia-swig-2x.patch # PATCH-FIX-UPSTREAM dia-glib-2.31.patch bgo#655335 dimstar@opensuse.org -- Fix build with glib 2.31. Patch19: dia-glib-2.31.patch +# PATCH-FIX-UPSTREAM dia-libemf-64bit.patch bgo#675495 sbrabec@suse.cz -- Fix build with libEMF on 64-bit platforms. +Patch20: dia-libemf-64bit.patch Url: http://live.gnome.org/Dia BuildRoot: %{_tmppath}/%{name}-%{version}-build Recommends: %{name}-lang @@ -83,6 +89,7 @@ translation-update-upstream %patch17 -p1 %patch18 %patch19 -p1 +%patch20 -p1 cp $RPM_SOURCE_DIR/font-test*dia . %build