From cc7e44bbc013673ac38c35938ac2dec86c796838c34ebcd347276eba88349ef4 Mon Sep 17 00:00:00 2001 From: Petr Gajdos Date: Wed, 31 Oct 2018 08:35:42 +0000 Subject: [PATCH] - asan_build: build ASAN included - debug_build: build more suitable for debugging OBS-URL: https://build.opensuse.org/package/show/graphics/ImageMagick?expand=0&rev=393 --- ImageMagick.changes | 3 ++- ImageMagick.spec | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ImageMagick.changes b/ImageMagick.changes index 0006b68..fb828f5 100644 --- a/ImageMagick.changes +++ b/ImageMagick.changes @@ -9,7 +9,8 @@ Wed Oct 31 07:58:16 UTC 2018 - Petr Gajdos ------------------------------------------------------------------- Mon Oct 22 09:40:38 UTC 2018 - Petr Gajdos -- add a possibility to build with ASAN +- asan_build: build ASAN included +- debug_build: build more suitable for debugging ------------------------------------------------------------------- Wed Oct 3 08:07:50 UTC 2018 - Petr Gajdos diff --git a/ImageMagick.spec b/ImageMagick.spec index a2c171e..f537b03 100644 --- a/ImageMagick.spec +++ b/ImageMagick.spec @@ -16,6 +16,7 @@ # +%define debug_build 1 %define asan_build 0 %define maj 7 %define mfr_version %{maj}.0.8 @@ -149,6 +150,7 @@ Requires: pkgconfig(bzip2) Requires: libbz2-devel %endif +%if !%{debug_build} %package extra Summary: Extra codecs for the ImageMagick image viewer/converter Group: Productivity/Graphics/Other @@ -160,6 +162,7 @@ Recommends: hp2xx Recommends: libwmf Recommends: netpbm Recommends: transfig +%endif %package -n libMagickCore%{libspec}%{clibver} Summary: C runtime library for ImageMagick @@ -216,6 +219,7 @@ different image formats. Image processing operations are available from the command line as well as through C, C++, and Perl-based programming interfaces. +%if !%{debug_build} %description extra This package adds support for djvu, wmf and jpeg2000 formats and installs optional helper applications. @@ -229,6 +233,7 @@ add special effects to an image and save your completed work in many different image formats. Image processing operations are available from the command line as well as through C, C++, and Perl-based programming interfaces. +%endif %description -n libMagickCore%{libspec}%{clibver} ImageMagick is a robust collection of tools and libraries to read, @@ -309,12 +314,20 @@ sed -i 's:\.t1:.otf:' config/type-urw-base35.xml.in export MODULES_DIRNAME="modules%{libspec}%{clibver}" export SHAREARCH_DIRNAME="config%{libspec}%{clibver}" export CONFIGURE_RELATIVE_PATH="ImageMagick%{libspec}%{clibver}" +%if %{debug_build} +export CFLAGS="%{optflags} -O0" +export CXXFLAGS="%{optflags} -O0" +%endif %configure \ --disable-silent-rules \ --enable-shared \ --without-frozenpaths \ --with-magick_plus_plus \ +%if !%{debug_build} --with-modules \ +%else + --without-modules \ +%endif --with-threads \ %if %{urw_base35_fonts} --with-urw-base35-font-dir=/usr/share/fonts/truetype \ @@ -361,6 +374,11 @@ dos2unix www/api/*.php chmod -x PerlMagick/demo/*.pl %check +%if %{debug_build} +# testsuite does not succeed with -O0 for some reason, +# research TODO +exit 0 +%endif %if %{asan_build} # ASAN needs /proc to be mounted exit 0 @@ -437,6 +455,7 @@ sed -i 's:%{buildroot}::' %{buildroot}/%{_libdir}/ImageMagick-%{mfr_version}/con %dir %{_sysconfdir}/ImageMagick* %config %{_sysconfdir}/ImageMagick*/* %dir %{_libdir}/ImageMagick* +%if !%{debug_build} %dir %{_libdir}/ImageMagick*/modules* %dir %{_libdir}/ImageMagick*/modules*/* %exclude %{_libdir}/ImageMagick*/modules*/*/wmf.* @@ -447,6 +466,7 @@ sed -i 's:%{buildroot}::' %{buildroot}/%{_libdir}/ImageMagick-%{mfr_version}/con %{_libdir}/ImageMagick*/modules*/*/*.so # don't remove la files, see bnc#579798 %{_libdir}/ImageMagick*/modules*/*/*.la +%endif %{_libdir}/ImageMagick*/config* %files -n libMagickWand%{libspec}%{cwandver} @@ -455,6 +475,7 @@ sed -i 's:%{buildroot}::' %{buildroot}/%{_libdir}/ImageMagick-%{mfr_version}/con %endif %{_libdir}/libMagickWand*.so.%{cwandver}* +%if !%{debug_build} %files extra %if 0%{?suse_version} < 1315 %defattr(-,root,root) @@ -467,6 +488,7 @@ sed -i 's:%{buildroot}::' %{buildroot}/%{_libdir}/ImageMagick-%{mfr_version}/con %endif %{_libdir}/ImageMagick*/modules*/*/djvu.so %{_libdir}/ImageMagick*/modules*/*/djvu.la +%endif %files devel %if 0%{?suse_version} < 1315