rpms/dvdauthor/devel dvdauthor-0.6.14-graphicsmagick.patch, NONE, 1.1 dvdauthor.spec, 1.8, 1.9
Ville Skytta (scop)
fedora-extras-commits at redhat.com
Wed Feb 13 23:10:22 UTC 2008
Author: scop
Update of /cvs/pkgs/rpms/dvdauthor/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9430
Modified Files:
dvdauthor.spec
Added Files:
dvdauthor-0.6.14-graphicsmagick.patch
Log Message:
* Wed Feb 13 2008 Ville Skyttä <ville.skytta at iki.fi> - 0.6.14-5
- Build with GraphicsMagick, drop all build time conditionals (#245155).
- Patch to differentiate ImageMagick vs GraphicsMagick at build time, don't
rely on GM's IM compat things installed, fix RGBA treatment with GM.
- Avoid linkage bloat from GraphicsMagick-config --libs.
dvdauthor-0.6.14-graphicsmagick.patch:
--- NEW FILE dvdauthor-0.6.14-graphicsmagick.patch ---
o Do not apply the "RGBA meaning swapped in ImageMagick 6" to GraphicsMagick.
o Do not rely on GraphicsMagick's ImageMagick compat things installed.
o Identify ImageMagick/GraphicsMagick in build spec.
diff -rN -u old-dvdauthor/configure.ac new-dvdauthor/configure.ac
--- old-dvdauthor/configure.ac 2008-02-14 00:24:10.000000000 +0200
+++ new-dvdauthor/configure.ac 2008-02-14 00:24:10.000000000 +0200
@@ -27,9 +27,9 @@
setmode \
)
-AC_CHECK_PROGS(MAGICKCONFIG, [Magick-config GraphicsMagick-config])
-
usemagick=0
+
+AC_CHECK_PROGS(MAGICKCONFIG, [Magick-config])
if test -n "$MAGICKCONFIG"; then
ac_save_CPPFLAGS="$CPPFLAGS"
ac_save_LIBS="$LIBS"
@@ -37,11 +37,31 @@
MAGICK_LIBS="`$MAGICKCONFIG --ldflags` `$MAGICKCONFIG --libs`"
CPPFLAGS="$CPPFLAGS $MAGICK_CPPFLAGS"
LIBS="$MAGICK_LIBS $LIBS"
- AC_CHECK_FUNC(ExportImagePixels, usemagick=1, AC_MSG_NOTICE([ImageMagick/GraphicsMagick does not support the function
- ExportImagePixels. Please upgrade to ImageMagick 5.5.7 or newer (or
- the corresponding GraphicsMagick version)]))
+ AC_CHECK_FUNC(ExportImagePixels, usemagick=1, AC_MSG_NOTICE([ImageMagick does not support the function
+ ExportImagePixels. Please upgrade to ImageMagick 5.5.7 or newer]))
CPPFLAGS="$ac_save_CPPFLAGS"
LIBS="$ac_save_LIBS"
+ if test "$usemagick" = 1; then
+ AC_DEFINE(HAVE_MAGICK, 1, [Whether the ImageMagick libraries are available])
+ fi
+fi
+
+if test "$usemagick" != 1; then
+ AC_CHECK_PROGS(GMAGICKCONFIG, [GraphicsMagick-config])
+ if test -n "$GMAGICKCONFIG"; then
+ ac_save_CPPFLAGS="$CPPFLAGS"
+ ac_save_LIBS="$LIBS"
+ MAGICK_CPPFLAGS="`$GMAGICKCONFIG --cppflags`"
+ MAGICK_LIBS="`$GMAGICKCONFIG --ldflags` `$GMAGICKCONFIG --libs`"
+ CPPFLAGS="$CPPFLAGS $MAGICK_CPPFLAGS"
+ LIBS="$MAGICK_LIBS $LIBS"
+ AC_CHECK_FUNC(DispatchImage, usemagick=1)
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIBS="$ac_save_LIBS"
+ if test "$usemagick" = 1; then
+ AC_DEFINE(HAVE_GMAGICK, 1, [Whether the GraphicsMagick libraries are available])
+ fi
+ fi
fi
if test "$usemagick" != 1; then
@@ -50,8 +70,6 @@
AC_CHECK_LIB(png, png_sig_cmp, test, AC_MSG_ERROR([You must have libpng(-devel) installed]), -lz -lm)
MAGICK_CPPFLAGS=
MAGICK_LIBS="-lpng -lz -lm"
-else
- AC_DEFINE(HAVE_MAGICK, 1, [Whether the ImageMagick or GraphicsMagick libraries are available])
fi
AC_SUBST(MAGICK_CPPFLAGS)
diff -rN -u old-dvdauthor/src/compat.h new-dvdauthor/src/compat.h
--- old-dvdauthor/src/compat.h 2008-02-14 00:24:10.000000000 +0200
+++ new-dvdauthor/src/compat.h 2008-02-14 00:24:10.000000000 +0200
@@ -47,10 +47,14 @@
// this doesn't really belong here, but it was easiest
#ifdef HAVE_MAGICK
-#define BUILDSPEC_MAGICK " magick"
+#define BUILDSPEC_MAGICK " imagemagick"
+#else
+#ifdef HAVE_GMAGICK
+#define BUILDSPEC_MAGICK " graphicsmagick"
#else
#define BUILDSPEC_MAGICK ""
#endif
+#endif
#ifdef HAVE_GETOPT_LONG
#define BUILDSPEC_GETOPT " gnugetopt"
diff -rN -u old-dvdauthor/src/subgen-image.c new-dvdauthor/src/subgen-image.c
--- old-dvdauthor/src/subgen-image.c 2008-02-14 00:24:10.000000000 +0200
+++ new-dvdauthor/src/subgen-image.c 2008-02-14 00:24:10.000000000 +0200
@@ -25,7 +25,7 @@
#include <fcntl.h>
#include <math.h>
-#ifdef HAVE_MAGICK
+#if defined(HAVE_MAGICK) || defined(HAVE_GMAGICK)
#include <stdarg.h>
#include <magick/api.h>
#else
@@ -140,7 +140,7 @@
}
}
-#ifdef HAVE_MAGICK
+#if defined(HAVE_MAGICK) || defined(HAVE_GMAGICK)
static int read_magick(pict *s)
{
Image *im;
@@ -167,7 +167,13 @@
for( y=0; y<im->rows; y++ ) {
char pdata[MAXX*4];
- if(!ExportImagePixels(im,0,y,im->columns,1,"RGBA",CharPixel,pdata,&ei)) {
+ if(!
+#ifdef HAVE_MAGICK
+ ExportImagePixels
+#else // HAVE_GMAGICK
+ DispatchImage
+#endif
+ (im,0,y,im->columns,1,"RGBA",CharPixel,pdata,&ei)) {
fprintf(stderr,"ERR: Extracting row %d from %s (%s,%s)\n",y,s->fname,ei.reason,ei.description);
CatchException(&ei);
MagickError(ei.severity,ei.reason,ei.description);
@@ -181,7 +187,8 @@
p.g=pdata[x*4+1];
p.b=pdata[x*4+2];
// the meaning of RGBA swapped with ImageMagick 6.0.0...
-#if MagickLibVersion >= 0x600
+ // ...but not with GraphicsMagick
+#if defined(HAVE_MAGICK) && MagickLibVersion >= 0x600
p.t=pdata[x*4+3];
#else
p.t=255-pdata[x*4+3];
@@ -319,7 +326,7 @@
{
if( !p->fname )
return 0;
-#ifdef HAVE_MAGICK
+#if defined(HAVE_MAGICK) || defined(HAVE_GMAGICK)
r=read_magick(p);
#else
r=read_png(p);
@@ -961,14 +968,14 @@
void image_init()
{
-#ifdef HAVE_MAGICK
+#if defined(HAVE_MAGICK) || defined(HAVE_GMAGICK)
InitializeMagick(NULL);
#endif
}
void image_shutdown()
{
-#ifdef HAVE_MAGICK
+#if defined(HAVE_MAGICK) || defined(HAVE_GMAGICK)
DestroyMagick();
#endif
}
Index: dvdauthor.spec
===================================================================
RCS file: /cvs/pkgs/rpms/dvdauthor/devel/dvdauthor.spec,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- dvdauthor.spec 13 Feb 2008 17:14:42 -0000 1.8
+++ dvdauthor.spec 13 Feb 2008 23:09:42 -0000 1.9
@@ -1,15 +1,13 @@
-%bcond_with imagemagick
-%bcond_with graphicsmagick
-
Name: dvdauthor
Version: 0.6.14
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: Command line DVD authoring tool
Group: Applications/Multimedia
License: GPLv2+
URL: http://dvdauthor.sourceforge.net/
Source0: http://downloads.sourceforge.net/dvdauthor/%{name}-%{version}.tar.gz
+Patch0: %{name}-0.6.14-graphicsmagick.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libdvdread-devel >= 0.9.4-4
@@ -19,15 +17,9 @@
BuildRequires: libxml2-devel >= 2.6.0
BuildRequires: fribidi-devel
BuildRequires: freetype-devel
-%if %{with graphicsmagick}
-# Wait for dep bloat to decrease before making this default to on: #432651
BuildRequires: GraphicsMagick-devel
-%else
-# Ditto here: #212478
-%if %{with imagemagick}
-BuildRequires: ImageMagick-devel
-%endif # imagemagick
-%endif # graphicsmagick
+# autofoo etc for Patch0
+BuildRequires: autoconf automake gettext-devel
%description
dvdauthor is a program that will generate a DVD movie from a valid
@@ -36,20 +28,13 @@
%prep
%setup -q
-%if %{with graphicsmagick}
-# No ImageMagick compat built in Fedora GraphicsMagick
-sed -i -e 's/ExportImagePixels/DispatchImage/g' configure src/subgen-image.c
-%endif # graphicsmagick
+%patch0 -p1 -b .graphicsmagick
+autoreconf # for Patch0
%build
-%if %{with graphicsmagick}
-export MAGICKCONFIG=GraphicsMagick-config
-%else
-%if ! %{with imagemagick}
-export MAGICKCONFIG=/bin/true
-%endif # imagemagick
-%endif # graphicsmagick
+export MAGICKCONFIG=/bin/true # disable ImageMagick
+export LDFLAGS="$LDFLAGS -Wl,--as-needed" # avoid *Magick-config linkage bloat
%configure --disable-rpath --disable-dependency-tracking
make %{?_smp_mflags}
@@ -82,6 +67,12 @@
%changelog
+* Wed Feb 13 2008 Ville Skyttä <ville.skytta at iki.fi> - 0.6.14-5
+- Build with GraphicsMagick, drop all build time conditionals (#245155).
+- Patch to differentiate ImageMagick vs GraphicsMagick at build time, don't
+ rely on GM's IM compat things installed, fix RGBA treatment with GM.
+- Avoid linkage bloat from GraphicsMagick-config --libs.
+
* Wed Feb 13 2008 Ville Skyttä <ville.skytta at iki.fi> - 0.6.14-4
- Add build time conditional for GraphicsMagick, disabled by default (#432651).
- Get rid of need for BuildConflicts.
More information about the fedora-extras-commits
mailing list