emacs: split into emacs, emacs-common, emacs-x11 and emacs-gtk2

This commit is contained in:
Christian Neukirchen 2014-07-11 23:20:22 +02:00
parent 5a0a225398
commit 9a0437be64
5 changed files with 196 additions and 12 deletions

1
srcpkgs/emacs-common Symbolic link
View File

@ -0,0 +1 @@
emacs

1
srcpkgs/emacs-gtk2 Symbolic link
View File

@ -0,0 +1 @@
emacs

1
srcpkgs/emacs-x11 Symbolic link
View File

@ -0,0 +1 @@
emacs

View File

@ -0,0 +1,97 @@
--- src/image.c
+++ src/image.c 2013-05-21 15:49:41.945819346 +0000
@@ -7192,7 +7192,11 @@ gif_load (struct frame *f, struct image
}
/* Open the GIF file. */
+#if GIFLIB_MAJOR < 5
gif = fn_DGifOpenFileName (SSDATA (file));
+#else
+ gif = fn_DGifOpenFileName (SSDATA (file), NULL);
+#endif
if (gif == NULL)
{
image_error ("Cannot open `%s'", file, Qnil);
@@ -7213,7 +7217,11 @@ gif_load (struct frame *f, struct image
memsrc.len = SBYTES (specified_data);
memsrc.index = 0;
+#if GIFLIB_MAJOR < 5
gif = fn_DGifOpen (&memsrc, gif_read_from_memory);
+#else
+ gif = fn_DGifOpen (&memsrc, gif_read_from_memory, NULL);
+#endif
if (!gif)
{
image_error ("Cannot open memory source `%s'", img->spec, Qnil);
@@ -7225,7 +7225,11 @@
if (!check_image_size (f, gif->SWidth, gif->SHeight))
{
image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+ fn_DGifCloseFile (gif, NULL);
+#else
fn_DGifCloseFile (gif);
+#endif
return 0;
}
@@ -7234,7 +7238,11 @@
if (rc == GIF_ERROR || gif->ImageCount <= 0)
{
image_error ("Error reading `%s'", img->spec, Qnil);
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+ fn_DGifCloseFile (gif, NULL);
+#else
fn_DGifCloseFile (gif);
+#endif
return 0;
}
@@ -7246,7 +7254,11 @@
{
image_error ("Invalid image number `%s' in image `%s'",
image_number, img->spec);
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+ fn_DGifCloseFile (gif, NULL);
+#else
fn_DGifCloseFile (gif);
+#endif
return 0;
}
}
@@ -7264,14 +7276,22 @@
if (!check_image_size (f, width, height))
{
image_error ("Invalid image size (see `max-image-size')", Qnil, Qnil);
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+ fn_DGifCloseFile (gif, NULL);
+#else
fn_DGifCloseFile (gif);
+#endif
return 0;
}
/* Create the X image and pixmap. */
if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
{
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+ fn_DGifCloseFile (gif, NULL);
+#else
fn_DGifCloseFile (gif);
+#endif
return 0;
}
@@ -7447,7 +7467,11 @@
Fcons (make_number (gif->ImageCount),
img->lisp_data));
+#if GIFLIB_MAJOR >= 5 && GIFLIB_MINOR >= 1
+ fn_DGifCloseFile (gif, NULL);
+#else
fn_DGifCloseFile (gif);
+#endif
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))

View File

@ -1,20 +1,25 @@
# Template file for 'emacs'
pkgname=emacs
version=24.3
revision=3
revision=5
hostmakedepends="pkg-config"
makedepends="ncurses-devel"
makedepends="ncurses-devel libXaw-devel gtk+-devel"
depends="emacs-common-${version}_${revision}"
replaces="emacs>=0"
build_style="gnu-configure"
configure_args="--without-x"
short_desc="GNU Emacs Editor without X support"
configure_args="ac_cv_lib_gif_EGifPutExtensionLast=yes"
short_desc="GNU Emacs editor"
maintainer="Philipp Hirsch <itself@hanspolo.net>"
license="GPL-3"
homepage="http://www.gnu.org/software/${pkgname}/"
distfiles="http://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${version}.tar.gz"
checksum=0098ca3204813d69cd8412045ba33e8701fa2062f4bff56bedafc064979eef41
distfiles="http://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${version}.tar.xz"
checksum=70aa2942e9ae689ed17eddedfca5027c364ffbcc8b59968b1645e935f4c7058d
# Package build options
build_options="dbus jpeg tiff gif png svg xml imagemagick"
build_options="dbus jpeg tiff gif png xpm svg xml imagemagick gnutls sound"
desc_option_xpm="Enable support for XPM images"
desc_option_sound="Enable support for sound"
build_options_default="jpeg tiff gif png xpm svg xml gnutls sound"
if [ "$build_option_dbus" ]; then
configure_args+=" --with-dbus"
@ -51,6 +56,13 @@ else
configure_args+=" --without-png"
fi
if [ "$build_option_xpm" ]; then
configure_args+=" --with-xpm"
makedepends+=" libXpm-devel"
else
configure_args+=" --without-xpm"
fi
if [ "$build_option_svg" ]; then
configure_args+=" --with-rsvg"
makedepends+=" librsvg-devel"
@ -72,9 +84,81 @@ else
configure_args+=" --without-xml2"
fi
post_install() {
# Remove conflicting files.
rm -f ${DESTDIR}/usr/bin/ctags
rm -f ${DESTDIR}/usr/share/man/man1/ctags.1
rm -f ${DESTDIR}/usr/share/info/info.info
if [ "$build_option_gnutls" ]; then
configure_args+=" --with-gnutls"
makedepends+=" gnutls-devel"
else
configure_args+=" --without-gnutls"
fi
if [ "$build_option_sound" ]; then
configure_args+=" --with-sound"
makedepends+=" alsa-lib-devel"
else
configure_args+=" --without-sound"
fi
do_configure() {
mkdir -p nox x11 gtk2
cd $wrksrc/nox
../configure --without-x ${configure_args}
cd $wrksrc/x11
../configure --with-x-toolkit=athena --without-toolkit-scroll-bars ${configure_args}
cd $wrksrc/gtk2
../configure --with-x-toolkit=gtk2 ${configure_args}
}
do_build() {
make ${makejobs} -C nox
make ${makejobs} -C x11
make ${makejobs} -C gtk2
}
do_install() {
make DESTDIR=$DESTDIR -C ${wrksrc}/nox install
rm -f ${DESTDIR}/usr/bin/ctags
rm -f ${DESTDIR}/usr/share/man/man1/ctags.1*
rm -f ${DESTDIR}/usr/share/info/info.info
rm -rf ${DESTDIR}/usr/share/applications
rm -rf ${DESTDIR}/usr/share/icons
}
emacs-common_package() {
short_desc+=" - common files"
noarch=yes
pkg_install() {
vmove usr/share/emacs
vmove usr/share/man
vmove usr/share/info
vmove var/games/emacs
}
}
emacs-x11_package() {
depends="emacs-common-${version}_${revision}"
provides="emacs-${version}_${revision}"
replaces="emacs>=0"
short_desc+=" - X11 version"
pkg_install() {
make DESTDIR=${PKGDESTDIR} -C ${wrksrc}/x11 install
rm -f ${PKGDESTDIR}/usr/bin/ctags
rm -rf ${PKGDESTDIR}/usr/share
rm -rf ${PKGDESTDIR}/var/games/emacs
}
}
emacs-gtk2_package() {
depends="emacs-common-${version}_${revision} desktop-file-utils hicolor-icon-theme"
provides="emacs-${version}_${revision}"
replaces="emacs>=0"
short_desc+=" - GTK+2 version"
pkg_install() {
make DESTDIR=${PKGDESTDIR} -C ${wrksrc}/gtk2 install
rm -f ${PKGDESTDIR}/usr/bin/ctags
rm -rf ${PKGDESTDIR}/usr/share/{emacs,man,info}
rm -rf ${PKGDESTDIR}/var/games/emacs
}
}