From 9a0437be6482ca71ca56e536cd18bc388abed5c4 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Fri, 11 Jul 2014 23:20:22 +0200 Subject: [PATCH] emacs: split into emacs, emacs-common, emacs-x11 and emacs-gtk2 --- srcpkgs/emacs-common | 1 + srcpkgs/emacs-gtk2 | 1 + srcpkgs/emacs-x11 | 1 + .../emacs/patches/emacs-24.3-giflib5.patch | 97 ++++++++++++++++ srcpkgs/emacs/template | 108 ++++++++++++++++-- 5 files changed, 196 insertions(+), 12 deletions(-) create mode 120000 srcpkgs/emacs-common create mode 120000 srcpkgs/emacs-gtk2 create mode 120000 srcpkgs/emacs-x11 create mode 100644 srcpkgs/emacs/patches/emacs-24.3-giflib5.patch diff --git a/srcpkgs/emacs-common b/srcpkgs/emacs-common new file mode 120000 index 00000000000..a7642dd168d --- /dev/null +++ b/srcpkgs/emacs-common @@ -0,0 +1 @@ +emacs \ No newline at end of file diff --git a/srcpkgs/emacs-gtk2 b/srcpkgs/emacs-gtk2 new file mode 120000 index 00000000000..a7642dd168d --- /dev/null +++ b/srcpkgs/emacs-gtk2 @@ -0,0 +1 @@ +emacs \ No newline at end of file diff --git a/srcpkgs/emacs-x11 b/srcpkgs/emacs-x11 new file mode 120000 index 00000000000..a7642dd168d --- /dev/null +++ b/srcpkgs/emacs-x11 @@ -0,0 +1 @@ +emacs \ No newline at end of file diff --git a/srcpkgs/emacs/patches/emacs-24.3-giflib5.patch b/srcpkgs/emacs/patches/emacs-24.3-giflib5.patch new file mode 100644 index 00000000000..f58c3190700 --- /dev/null +++ b/srcpkgs/emacs/patches/emacs-24.3-giflib5.patch @@ -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))) diff --git a/srcpkgs/emacs/template b/srcpkgs/emacs/template index e8c3156941d..0e80a578282 100644 --- a/srcpkgs/emacs/template +++ b/srcpkgs/emacs/template @@ -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 " 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 + } }