diff options
author | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
---|---|---|
committer | Parabola <dev@list.parabolagnulinux.org> | 2011-04-05 14:26:38 +0000 |
commit | 415856bdd4f48ab4f2732996f0bae58595092bbe (patch) | |
tree | ede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/xemacs |
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/xemacs')
-rw-r--r-- | community/xemacs/PKGBUILD | 79 | ||||
-rw-r--r-- | community/xemacs/xemacs-21.5.29-large-images.patch | 96 | ||||
-rw-r--r-- | community/xemacs/xemacs-21.5.29-optimization-bug.patch | 14 | ||||
-rw-r--r-- | community/xemacs/xemacs-21.5.29-vcdiff.patch | 19 | ||||
-rw-r--r-- | community/xemacs/xemacs.desktop | 34 | ||||
-rw-r--r-- | community/xemacs/xemacs.install | 35 |
6 files changed, 277 insertions, 0 deletions
diff --git a/community/xemacs/PKGBUILD b/community/xemacs/PKGBUILD new file mode 100644 index 000000000..2dcde06ee --- /dev/null +++ b/community/xemacs/PKGBUILD @@ -0,0 +1,79 @@ +# $Id: PKGBUILD 96361 2010-10-19 23:18:53Z stephane $ +# Maintainer: juergen <juergen@archlinux.org> +# Contributor : Stéphane Gaudreault <stephane@archlinux.org> + +pkgname=xemacs +pkgver=21.5.29 +pkgrel=3 +pkgdesc="highly customizable open source text editor and application development system forked from GNU Emacs" +arch=(i686 x86_64) +url="http://www.xemacs.org/" +license=('GPL') +depends=('db' 'libpng' 'libtiff' 'gpm>=1.20.4' 'bash' 'ncurses>=5.6-7' 'desktop-file-utils' 'libxaw' 'libjpeg') +optdepends=('xorg-fonts-75dpi: X bitmap fonts needed for the interface' + 'xorg-fonts-100dpi: X bitmap fonts needed for the interface') +makedepends=('giflib' 'xbitmaps') +install=xemacs.install +source=(http://ftp.xemacs.org/pub/xemacs/beta/$pkgname-$pkgver.tar.gz + xemacs.desktop + xemacs-21.5.29-large-images.patch + xemacs-21.5.29-optimization-bug.patch + xemacs-21.5.29-vcdiff.patch) +md5sums=('5364192ae0d3de23d9f4ce197e6493b5' + 'a4d3d5c0aa2c7ce7bec491f809ca3694' + '23ca5a7c50fe7ebebd9fc4525882cdf1' + 'eb061b10ea3bbe1026df5326ae1618e3' + '4ada657a351b226cdd557f9faaeab075') + +build() { + cd "${srcdir}/${pkgname}-${pkgver}" + + # Fix security issue in vcdiff script + patch -Np0 -i ../xemacs-21.5.29-vcdiff.patch + + # Fix problem caused by improper optimization with GCC>=4.1.2 on i686 + # (and possibly other arches). See + # http://tracker.xemacs.org/XEmacs/its/issue354 + # for the upstream bug report. + patch -Np0 -i ../xemacs-21.5.29-optimization-bug.patch + + # Fix for security bug + # See http://bugs.gentoo.org/show_bug.cgi?id=275397 + patch -Np1 -i ../xemacs-21.5.29-large-images.patch + + ./configure --build="${CHOST}" --prefix=/usr --with-dynamic \ + --with-x11 --without-postgresql --with-athena=xaw \ + --enable-database=berkdb --without-ldap \ + --enable-menubars=lucid --enable-scrollbars=lucid \ + --enable-widgets=athena --enable-dialogs=athena \ + --enable-external-widget \ + --with-jpeg --with-png --with-tiff \ + --with-ncurses --with-pop --with-xfs --disable-sound \ + --infodir=/usr/share/info \ + --with-mule \ + --mandir=/usr/share/man/man1 + + make +} + +package() { + cd "${srcdir}/${pkgname}-${pkgver}" + make -j1 prefix="${pkgdir}/usr" mandir="${pkgdir}/usr/share/man/man1" infodir="${pkgdir}/usr/share/info" install gzip-el + + rm ${pkgdir}/usr/bin/{b2m,ctags,etags,rcs-checkin} + rm ${pkgdir}/usr/share/man/man1/{ctags.1,etags.1} + + # fix FS#7927 + install -d -m755 "${pkgdir}/usr/share/pixmaps" + install -d -m755 "${pkgdir}/usr/share/applications" + install -m644 "${srcdir}/${pkgname}.desktop" ${pkgdir}/usr/share/applications/ || return 1 + ln -sf /usr/lib/xemacs-21.5-b28/etc/xemacs-icon.xpm "${pkgdir}/usr/share/pixmaps/" || return 1 + + # correct permissions + chown -R root:root "${pkgdir}" + + rm ${pkgdir}/usr/share/info/dir + gzip ${pkgdir}/usr/share/info/* + rm ${pkgdir}/usr/share/info/{info.info.gz,texinfo.info-2.gz,cl.info.gz,texinfo.info-1.gz,texinfo.info.gz,standards.info.gz,widget.info.gz} +} +# vim: ts=2 sw=2 et ft=sh diff --git a/community/xemacs/xemacs-21.5.29-large-images.patch b/community/xemacs/xemacs-21.5.29-large-images.patch new file mode 100644 index 000000000..535c87186 --- /dev/null +++ b/community/xemacs/xemacs-21.5.29-large-images.patch @@ -0,0 +1,96 @@ +APPROVE COMMIT 21.5 + +This patch has been committed. When trying to open very large image +files (or image files with header files that claim the image is very +large), we multiply length times width to get the number of pixels in +the image (and possibly multiply that number if a pixel occupies more +than 1 byte). The multiplication can overflow, resulting in passing +negative or insufficiently positive size values to malloc. This patch +checks whether the multiplication will overflow. If so, XEmacs +refuses to attempt to load the image. + +(Patch taken from upstream, already applied there) + +--- a/src/glyphs-eimage.c Mon Jun 29 08:20:47 2009 -0600 ++++ b/src/glyphs-eimage.c Wed Jul 01 15:42:54 2009 -0600 +@@ -409,6 +409,7 @@ + */ + + { ++ UINT_64_BIT pixels_sq; + int jpeg_gray = 0; /* if we're dealing with a grayscale */ + /* Step 4: set parameters for decompression. */ + +@@ -431,7 +432,10 @@ + jpeg_start_decompress (&cinfo); + + /* Step 6: Read in the data and put into EImage format (8bit RGB triples)*/ +- ++ pixels_sq = ++ (UINT_64_BIT) cinfo.output_width * (UINT_64_BIT) cinfo.output_height; ++ if (pixels_sq > ((size_t) -1) / 3) ++ signal_image_error ("JPEG image too large to instantiate", instantiator); + unwind.eimage = + xnew_binbytes (cinfo.output_width * cinfo.output_height * 3); + if (!unwind.eimage) +@@ -677,6 +681,7 @@ + { + ColorMapObject *cmo = unwind.giffile->SColorMap; + int i, j, row, pass, interlace, slice; ++ UINT_64_BIT pixels_sq; + Binbyte *eip; + /* interlaced gifs have rows in this order: + 0, 8, 16, ..., 4, 12, 20, ..., 2, 6, 10, ..., 1, 3, 5, ... */ +@@ -685,6 +690,9 @@ + + height = unwind.giffile->SHeight; + width = unwind.giffile->SWidth; ++ pixels_sq = (UINT_64_BIT) width * (UINT_64_BIT) height; ++ if (pixels_sq > ((size_t) -1) / (3 * unwind.giffile->ImageCount)) ++ signal_image_error ("GIF image too large to instantiate", instantiator); + unwind.eimage = + xnew_binbytes (width * height * 3 * unwind.giffile->ImageCount); + if (!unwind.eimage) +@@ -948,11 +956,15 @@ + { + int y; + Binbyte **row_pointers; ++ UINT_64_BIT pixels_sq; + height = info_ptr->height; + width = info_ptr->width; ++ pixels_sq = (UINT_64_BIT) width * (UINT_64_BIT) height; ++ 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, width * height * 3); ++ unwind.eimage = xnew_array_and_zero (Binbyte, (size_t) (pixels_sq * 3)); + /* 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... */ +@@ -1299,6 +1311,7 @@ + + uint32 *raster; + Binbyte *ep; ++ UINT_64_BIT pixels_sq; + + assert (!NILP (data)); + +@@ -1321,12 +1334,15 @@ + + TIFFGetField (unwind.tiff, TIFFTAG_IMAGEWIDTH, &width); + TIFFGetField (unwind.tiff, TIFFTAG_IMAGELENGTH, &height); +- unwind.eimage = xnew_binbytes (width * height * 3); ++ pixels_sq = (UINT_64_BIT) width * (UINT_64_BIT) height; ++ if (pixels_sq >= 1 << 29) ++ signal_image_error ("TIFF image too large to instantiate", instantiator); ++ unwind.eimage = xnew_binbytes (pixels_sq * 3); + + /* #### This is little more than proof-of-concept/function testing. + It needs to be reimplemented via scanline reads for both memory + compactness. */ +- raster = (uint32*) _TIFFmalloc (width * height * sizeof (uint32)); ++ raster = (uint32*) _TIFFmalloc ((tsize_t) (pixels_sq * sizeof (uint32))); + if (raster != NULL) + { + int i, j; diff --git a/community/xemacs/xemacs-21.5.29-optimization-bug.patch b/community/xemacs/xemacs-21.5.29-optimization-bug.patch new file mode 100644 index 000000000..32a1a02c2 --- /dev/null +++ b/community/xemacs/xemacs-21.5.29-optimization-bug.patch @@ -0,0 +1,14 @@ +Work around a GCC optimization bug as described in +http://tracker.xemacs.org/XEmacs/its/issue354 + +--- src/dumper.c.~1~ 2008-01-26 09:54:11.000000000 +0100 ++++ src/dumper.c 2008-05-03 10:17:03.000000000 +0200 +@@ -2584,7 +2584,7 @@ + #endif /* !WIN32_NATIVE */ + + +-static int ++int + pdump_file_try (Wexttext *exe_path) + { + Wexttext *w = exe_path + wext_strlen (exe_path); diff --git a/community/xemacs/xemacs-21.5.29-vcdiff.patch b/community/xemacs/xemacs-21.5.29-vcdiff.patch new file mode 100644 index 000000000..105eb549e --- /dev/null +++ b/community/xemacs/xemacs-21.5.29-vcdiff.patch @@ -0,0 +1,19 @@ +--- lib-src/vcdiff.~1~ 1996-12-18 23:42:33.000000000 +0100 ++++ lib-src/vcdiff 2008-04-09 08:20:36.000000000 +0200 +@@ -79,14 +79,14 @@ + case $f in + s.* | */s.*) + if +- rev1=/tmp/geta$$ ++ rev1=`mktemp /tmp/geta.XXXXXXXX` + get -s -p -k $sid1 "$f" > $rev1 && + case $sid2 in + '') + workfile=`expr " /$f" : '.*/s.\(.*\)'` + ;; + *) +- rev2=/tmp/getb$$ ++ rev2=`mktemp /tmp/getb.XXXXXXXX` + get -s -p -k $sid2 "$f" > $rev2 + workfile=$rev2 + esac diff --git a/community/xemacs/xemacs.desktop b/community/xemacs/xemacs.desktop new file mode 100644 index 000000000..257c56947 --- /dev/null +++ b/community/xemacs/xemacs.desktop @@ -0,0 +1,34 @@ +[Desktop Entry] +Name=XEmacs Text Editor +Name[bg]=редактор XEmacs +Name[ca]=Editor XEmacs +Name[cs]=Editor XEmacs +Name[da]=XEmacs tekstredigerer +Name[de]=XEmacs Texteditor +Name[eo]=La redaktilo XEmakso +Name[es]=Emacs para X +Name[et]=Emacs X'i kasutajaliidesega +Name[fi]=XEmacs editori +Name[fr]=Éditeur XEmacs +Name[hu]=XEmacs szövegszerkesztő +Name[is]=XEmacs-ritill +Name[it]=Emacs per X +Name[ja]=XEmacs テキスト・エディター +Name[mk]=Софистицираниот XEmacs уредувач +Name[no]=XEmacs-tekstredigerer +Name[pt]=Editor XEmacs +Name[ro]=Editorul XEmacs +Name[ru]=Редактор XEmacs +Name[sk]=Editor XEmacs +Name[sl]=Urejevalnik XEmacs +Name[uk]=Редактор XEmacs +GenericName=Text Editor +Comment=Edit text +MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++; +Exec=xemacs %f +Icon=/usr/share/pixmaps/xemacs-icon.xpm +Type=Application +Terminal=false +Categories=Development;TextEditor; +Encoding=UTF-8 +StartupWMClass=Emacs diff --git a/community/xemacs/xemacs.install b/community/xemacs/xemacs.install new file mode 100644 index 000000000..2cdf5e488 --- /dev/null +++ b/community/xemacs/xemacs.install @@ -0,0 +1,35 @@ +infodir=/usr/share/info +filelist=(beta.info.gz custom.info.gz + emodules.info.gz external-widget.info.gz + internals.info-1.gz internals.info-2.gz + internals.info-3.gz internals.info-4.gz + internals.info-5.gz internals.info.gz + lispref.info-1.gz lispref.info-10.gz + lispref.info-2.gz lispref.info-3.gz + lispref.info-4.gz lispref.info-5.gz + lispref.info-6.gz lispref.info-7.gz + lispref.info-8.gz lispref.info-9.gz + lispref.info.gz new-users-guide.info.gz + term.info.gz termcap.info.gz + xemacs-faq.info-1.gz xemacs-faq.info-2.gz + xemacs-faq.info.gz xemacs.info-1.gz + xemacs.info-2.gz xemacs.info-3.gz + xemacs.info-4.gz xemacs.info.gz) + +post_install() { + for file in ${filelist[@]}; do + install-info $infodir/$file $infodir/dir 2> /dev/null + done + update-desktop-database -q +} + +post_upgrade() { + post_install $1 +} + +pre_remove() { + for file in ${filelist[@]}; do + install-info --delete $infodir/$file $infodir/dir 2> /dev/null + done + update-desktop-database -q +} |