rpms/xemacs/F-11 xemacs-21.5.29-png.patch, NONE, 1.1 xemacs-21.5.29-no-xft.patch, 1.2, 1.3 xemacs.spec, 1.50, 1.51 xemacs-21.5.28-courier-default.patch, 1.3, NONE

Jerry James jjames at fedoraproject.org
Thu Sep 24 14:13:39 UTC 2009


Author: jjames

Update of /cvs/pkgs/rpms/xemacs/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18090/F-11

Modified Files:
	xemacs-21.5.29-no-xft.patch xemacs.spec 
Added Files:
	xemacs-21.5.29-png.patch 
Removed Files:
	xemacs-21.5.28-courier-default.patch 
Log Message:
* Wed S ep 23 2009 Jerry James <loganjerry at gmail.com> - 21.5.29-5
- Final fix for bz 512623, which is actually two bugs, because ...
- ... the courier font patch breaks TTY font detection.  Do not apply the
  patch for now until I understand what is going on
- Add macros.xemacs (bz 480546)
- Add png patch to fix a problem with reading PNG files


xemacs-21.5.29-png.patch:
 glyphs-eimage.c |   79 +++++++++++++++++++++++++++++---------------------------
 1 file changed, 41 insertions(+), 38 deletions(-)

--- NEW FILE xemacs-21.5.29-png.patch ---
--- xemacs-21.5.29/src/glyphs-eimage.c	2009-09-23 12:58:39.770625034 -0600
+++ xemacs-21.5.29/src/glyphs-eimage.c	2009-09-23 13:06:23.662801742 -0600
@@ -954,7 +954,7 @@
   png_read_info (png_ptr, info_ptr);
 
   {
-    int y;
+    int y, padding;
     Binbyte **row_pointers;
     UINT_64_BIT pixels_sq;
     height = info_ptr->height;
@@ -963,14 +963,22 @@
     if (pixels_sq > ((size_t) -1) / 3)
       signal_image_error ("PNG image too large to instantiate", instantiator);
 
-    /* Wow, allocate all the memory.  Truly, exciting. */
-    unwind.eimage = xnew_array_and_zero (Binbyte, (size_t) (pixels_sq * 3));
+    /* Wow, allocate all the memory.  Truly, exciting.
+       Well, yes, there's excitement to be had.  It turns out that libpng
+       strips in place, so the last row overruns the buffer if depth is 16
+       or there's an alpha channel.  This is a crash on Linux.  So we need
+       to add padding.
+       The worst case is reducing 8 bytes (16-bit RGBA) to 3 (8-bit RGB). */
+
+    padding = 5 * width;
+    unwind.eimage = xnew_array_and_zero (Binbyte,
+					 (size_t) (pixels_sq * 3 + padding));
+
     /* libpng expects that the image buffer passed in contains a
        picture to draw on top of if the png has any transparencies.
        This could be a good place to pass that in... */
 
     row_pointers  = xnew_array (png_byte *, height);
-
     for (y = 0; y < height; y++)
       row_pointers[y] = unwind.eimage + (width * 3 * y);
 
@@ -990,16 +998,15 @@
 	}
       else
 	{
-	  Lisp_Color_Instance *c;
-	  Lisp_Object rgblist;
-
-	  c = XCOLOR_INSTANCE (bkgd);
-	  rgblist = MAYBE_LISP_DEVMETH (XDEVICE (c->device),
-					color_instance_rgb_components,
-					(c));
-	  my_background.red = (unsigned short) XINT (XCAR (rgblist));
-	  my_background.green = (unsigned short) XINT (XCAR (XCDR (rgblist)));
-	  my_background.blue = (unsigned short) XINT (XCAR (XCDR (XCDR (rgblist))));
+	  Lisp_Color_Instance *c = XCOLOR_INSTANCE (bkgd);
+	  Lisp_Object rgb = MAYBE_LISP_DEVMETH (XDEVICE (c->device),
+						color_instance_rgb_components,
+						(c));
+#define GETCOLOR(col) my_background.col = (unsigned short) XINT (XCAR (rgb))
+	  GETCOLOR(red); rgb = XCDR (rgb);
+	  GETCOLOR(green); rgb = XCDR (rgb);
+	  GETCOLOR(blue);
+#undef GETCOLOR
 	}
 
       if (png_get_bKGD (png_ptr, info_ptr, &image_background))
@@ -1012,41 +1019,38 @@
 
     /* Now that we're using EImage, ask for 8bit RGB triples for any type
        of image*/
-    /* convert palette images to full RGB */
+    /* convert palette images to RGB */
     if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
-      png_set_expand (png_ptr);
-    /* send grayscale images to RGB too */
-    if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
-        info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+      png_set_palette_to_rgb (png_ptr);
+    /* convert grayscale images to RGB */
+    else if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
+	     info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
       png_set_gray_to_rgb (png_ptr);
-    /* we can't handle alpha values */
-    if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
-      png_set_strip_alpha (png_ptr);
-    /* tell libpng to strip 16 bit depth files down to 8 bits */
-    if (info_ptr->bit_depth == 16)
-      png_set_strip_16 (png_ptr);
-    /* if the image is < 8 bits, pad it out */
-    if (info_ptr->bit_depth < 8)
+    /* pad images with depth < 8 bits */
+    else if (info_ptr->bit_depth < 8)
       {
 	if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY)
 	  png_set_expand (png_ptr);
 	else
 	  png_set_packing (png_ptr);
       }
+    /* strip 16-bit depth files down to 8 bits */
+    if (info_ptr->bit_depth == 16)
+      png_set_strip_16 (png_ptr);
+    /* strip alpha channel
+       #### shouldn't we handle this?
+       first call png_read_update_info in case above transformations
+       have generated an alpha channel */
+    png_read_update_info(png_ptr, info_ptr);
+    if (info_ptr->color_type & PNG_COLOR_MASK_ALPHA)
+      png_set_strip_alpha (png_ptr);
 
     png_read_image (png_ptr, row_pointers);
     png_read_end (png_ptr, info_ptr);
 
-#if 1 /* def PNG_SHOW_COMMENTS */
-    /* ####
-     * I turn this off by default now, because the !%^@#!% comments
-     * show up every time the image is instantiated, which can get
-     * really really annoying.  There should be some way to pass this
-     * type of data down into the glyph code, where you can get to it
-     * from lisp anyway. - WMP
-     */
-    /* #### I've turned this on, since these warnings are now
-       unobtrusive. */
+    /* #### There should be some way to pass this type of data down
+     * into the glyph code, where you can get to it from lisp
+     * anyway. - WMP */
     {
       int i;
       DECLARE_EISTRING (key);
@@ -1066,7 +1070,6 @@
 			  eidata(key), eidata(text));
 	}
     }
-#endif
 
     xfree (row_pointers, Binbyte **);
   }

xemacs-21.5.29-no-xft.patch:
 font.el |   17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

Index: xemacs-21.5.29-no-xft.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xemacs/F-11/xemacs-21.5.29-no-xft.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -p -r1.2 -r1.3
--- xemacs-21.5.29-no-xft.patch	26 Aug 2009 20:57:27 -0000	1.2
+++ xemacs-21.5.29-no-xft.patch	24 Sep 2009 14:13:38 -0000	1.3
@@ -1,12 +1,12 @@
 diff -dur xemacs-21.5.29.ORIG/lisp/font.el xemacs-21.5.29/lisp/font.el
---- xemacs-21.5.29/lisp/font.el	2009-08-26 14:49:58.859385283 -0600
-+++ xemacs-21.5.29/lisp/font.el	2009-08-26 14:49:20.000998807 -0600
+--- xemacs-21.5.29.ORIG/lisp/font.el	2009-05-18 08:51:06.000000000 -0600
++++ xemacs-21.5.29/lisp/font.el	2009-09-23 15:13:48.543673471 -0600
 @@ -753,14 +753,23 @@
  
  (defvar font-xft-font-regexp
    (concat "\\`"
 -	  #r"\(\\-\|\\:\|\\,\|[^:-]\)*"	        ; optional foundry and family
-+	  #r"\(\\[-,]|[^-:,*]\)*"               ; optional foundry and family
++	  #r"\(\\-\|\\:\|\\,\|[^-:*]\)*"	; optional foundry and family
  						; (allows for escaped colons, 
 -						; dashes, commas)
 +						; dashes, commas, asterisks)
@@ -37,16 +37,3 @@ diff -dur xemacs-21.5.29.ORIG/lisp/font.
    (let* ((name fontname)
  	 (device (or device (default-x-device)))
  	 (pattern (fc-font-match device (fc-name-parse name)))
-diff -dur xemacs-21.5.29.ORIG/lisp/font-mgr.el xemacs-21.5.29/lisp/font-mgr.el
---- xemacs-21.5.29/lisp/font-mgr.el	2009-05-18 08:51:06.000000000 -0600
-+++ xemacs-21.5.29/lisp/font-mgr.el	2009-08-26 14:46:44.073953826 -0600
-@@ -39,7 +39,8 @@
- 
- ;; #### should we wrap the world in `(unless (featurep 'font-mgr) ... )'?
- 
--(provide 'font-mgr)
-+;; #### implementation is incomplete
-+;; (provide 'font-mgr)
- 
- (defvar xft-xlfd-font-regexp
-   (concat


Index: xemacs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xemacs/F-11/xemacs.spec,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -p -r1.50 -r1.51
--- xemacs.spec	26 Aug 2009 20:57:27 -0000	1.50
+++ xemacs.spec	24 Sep 2009 14:13:39 -0000	1.51
@@ -21,7 +21,7 @@
 
 Name:           xemacs
 Version:        21.5.29
-Release:        3%{?snap:.%{snap}}%{?dist}
+Release:        4%{?snap:.%{snap}}%{?dist}
 Summary:        Different version of Emacs
 
 Group:          Applications/Editors
@@ -47,7 +47,8 @@ Patch4:         %{name}-21.5.27-no-expdy
 Patch5:         %{name}-21.5.25-wnnfix-128362.patch
 # Proposed by upstream 2009-08-25
 Patch6:         %{name}-21.5.29-no-xft.patch
-Patch8:         %{name}-21.5.28-courier-default.patch
+# Applied upstream 2009-09-23
+Patch7:         %{name}-21.5.29-png.patch
 Patch9:         %{name}-21.5.29-destdir.patch
 # Sent upstream 2009-03-12
 Patch14:        %{name}-beta-infodir.patch
@@ -99,6 +100,7 @@ Requires:       %{name}-common = %{versi
 Requires:       xorg-x11-fonts-ISO8859-1-75dpi
 Requires:       xorg-x11-fonts-ISO8859-1-100dpi
 Requires:       xorg-x11-fonts-misc
+Requires:       bitmap-fonts
 Requires(post): coreutils
 Provides:       xemacs(bin) = %{version}-%{release}
 
@@ -212,8 +214,10 @@ touch -r aclocal.m4 aclocal.m4-stamp
 touch -r aclocal.m4-stamp aclocal.m4
 %endif
 %patch5 -p1
+%if %{without xft}
 %patch6 -p1
-%patch8 -p1
+%endif
+%patch7 -p1
 %patch9 -p1
 %patch14 -p1
 
@@ -331,6 +335,19 @@ Cflags: -I${includedir}
 %endif
 EOF
 
+cat > macros.xemacs << EOF
+%%_xemacs_version %{version}
+%%_xemacs_ev %{?epoch:%{epoch}:}%{version}
+%%_xemacs_evr %{?epoch:%{epoch}:}%{version}-%{release}
+%%_xemacs_sitepkgdir %{_datadir}/xemacs/site-packages
+%%_xemacs_sitelispdir %{_datadir}/xemacs/site-packages/lisp
+%%_xemacs_sitestartdir %{_datadir}/xemacs/site-packages/lisp/site-start.d
+%%_xemacs_bytecompile /usr/bin/xemacs -q -no-site-file -batch -f batch-byte-compile
+%if %{with modules}
+%%_xemacs_includedir %{_libdir}/xemacs-%{xver}/%{xbuild}/include
+%%_xemacs_sitemoduledir %{_libdir}/xemacs/site-modules
+%endif
+EOF
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -389,6 +406,9 @@ install -Dpm 644 %{SOURCE3} $RPM_BUILD_R
 install -Dpm 644 %{SOURCE1} \
     $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/48x48/apps/xemacs.png
 
+# macro file
+install -Dpm 644 macros.xemacs $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.xemacs
+
 # make sure nothing is 0400
 chmod -R a+rX $RPM_BUILD_ROOT%{_prefix}
 
@@ -503,6 +523,7 @@ fi
 %{_datadir}/icons/hicolor/48x48/apps/xemacs.png
 %{_mandir}/man1/gnuclient.1*
 %{_mandir}/man1/gnudoit.1*
+%config(noreplace) %{_sysconfdir}/rpm/macros.xemacs
 
 %if %{with nox}
 %files nox
@@ -558,6 +579,13 @@ fi
 
 
 %changelog
+* Wed Sep 23 2009 Jerry James <loganjerry at gmail.com> - 21.5.29-4
+- Final fix for bz 512623, which is actually two bugs, because ...
+- ... the courier font patch breaks TTY font detection.  Removed that patch
+  and Require bitmap-fonts to supply the original font name.
+- Add macros.xemacs (bz 480546)
+- Add png patch to fix a problem with reading PNG files
+
 * Wed Aug 26 2009 Jerry James <loganjerry at gmail.com> - 21.5.29-3
 - Use upstream's attempt at fixing #512623 instead of mine, which didn't work.
 


--- xemacs-21.5.28-courier-default.patch DELETED ---




More information about the scm-commits mailing list