On 3/9/2012 5:58 PM, Yaakov (Cygwin/X) wrote:
On 2012-03-09 15:26, Ken Brown wrote:
My immediate reason for this request is that I'm thinking about ITP-ing
emacs-auctex

This too is in Ports:

http://cygwin-ports.git.sourceforge.net/git/gitweb.cgi?p=cygwin-ports/emacs-auctex

Yes, I know.  That was my starting point.


and I don't like some of the things that are done in __src_postinst when
 > I build that package.

Could you specify?

There are two things:

1. I don't think __prepemacs should be called for this package because the compile process explicitly byte compiles most of the *.el files. There are three (at the top level of /usr/share/emacs/site-lisp) that it does not byte compile. I don't know the reason, but I don't think the Cygwin build should override this upstream decision.

2. I would prefer that __prep_texlive not be called, since it causes the postinstall script to do unnecessary work. All that's needed for auctex is mktexlsr.

I'm attaching my .cygport and .cygwin.patch files so you can see how I dealt with this (after changing src_postinst.cygpart so that I could redefine __src_postinst).

Ken

HOMEPAGE="http://www.gnu.org/software/auctex/";
SRC_URI="mirror://gnu/auctex/${P#emacs-}.tar.gz"
SRC_DIR=${P#emacs-}

src_compile() {
        lndirs
        cd ${B}
        cygconf --localstatedir=/var/lib
        cygmake
}

my_prepetc() {
        local d;
        local f;
        local -i n;
        local s;

        if inherited cross
        then
                # postinst/prerm does not apply to cross-compiles
                return
        fi

        for s in postinstall preremove
        do
                if [ -f ${C}/${s}.sh -a -f ${C}/${PN}.${s} ]
                then
                        error "Only one of ${s}.sh and ${PN}.${s} can exist";
                fi

                for f in ${s}.sh ${PN}.${s}
                do
                        if [ -f ${C}/${f} ]
                        then
                                dodir /etc/${s};
                                cat >> ${D}/etc/${s}/${PN}.sh < ${C}/${f};
                        fi
                done

                n=1;
                while [ -n "${pkg_name[${n}]}" ]
                do
                        if [ -f ${C}/${pkg_name[${n}]}.${s} ]
                        then
                                dodir /etc/${s};
                                cat >> ${D}/etc/${s}/${pkg_name[${n}]}.sh < 
${C}/${pkg_name[${n}]}.${s};
                        fi
                        n+=1
                done
        done

        if [ -f ${C}/profile.d.sh ]
        then
                exeinto /etc/profile.d;
                newexe ${C}/profile.d.sh ${PN}.sh;
        fi

        if [ -f ${C}/profile.d.csh ]
        then
                exeinto /etc/profile.d;
                newexe ${C}/profile.d.csh ${PN}.csh;
        fi

        # System fonts
        if [ -d ${D}/usr/share/fonts ]
        then
                __prep_fonts_dir || error "Fonts postinstall failed"
        fi

        # GIO modules
        if [ -d ${D}/usr/lib/gio/modules ]
        then
                __prep_gio_modules || error "GIO modules postinstall failed"
        fi

        # GdkPixbuf modules
        if [ -d ${D}/usr/lib/gdk-pixbuf-2.0 ]
        then
                __prep_gdk_pixbuf_modules || error "GdkPixbuf modules 
postinstall failed"
        fi

        # GTK+ 2.x modules
        if [ -d ${D}/usr/share/icons ]
        then
                __prep_gtk_icon_theme || error "GTK+ icon theme postinstall 
failed"
        fi

        # GTK+ 2.x modules
        if [ -d ${D}/usr/lib/gtk-2.0 ]
        then
                __prep_gtk2_modules || error "GTK+ modules postinstall failed"
        fi

        # GTK+ 3.x modules
        if [ -d ${D}/usr/lib/gtk-3.0 ]
        then
                __prep_gtk3_modules || error "GTK+ modules postinstall failed"
        fi

        # GConf schemas
        if [ -d ${D}/etc/gconf/schemas ] && ! defined 
_CYGPORT_RESTRICT_postinst_gconf_
        then
                __prep_gconf_schemas || error "GConf schemas postinstall failed"
        fi

        # GSettings schemas
        if [ -d ${D}/usr/share/glib-2.0/schemas ]
        then
                __prep_gsettings_schemas || error "GSettings schemas 
postinstall failed"
        fi

        # MateConf schemas
        if [ -d ${D}/etc/mateconf/schemas ] && ! defined 
_CYGPORT_RESTRICT_postinst_mateconf_
        then
                __prep_mateconf_schemas || error "MateConf schemas postinstall 
failed"
        fi

        # Freedesktop.org Shared Mime Info
        if [ -d ${D}/usr/share/applications -o -d ${D}/usr/share/mime ]
        then
                __prep_freedesktop_mime || error "Shared Mime Info postinstall 
failed"
        fi

        # for d in /usr/share/texmf{,-dist}
        # do
        #       if [ -d ${D}${d} ]
        #       then
        #               __prep_texlive
        #               break
        #       fi
        # done

        for d in /etc/postinstall /etc/preremove
        do
                if [ -d ${D}${d} ]
                then
                        find ${D}${d} -type f -exec chmod 0755 '{}' +;
                fi
        done
}

__src_postinst() {
        __prepdoc;
        __prep_symlinks;
        # __prepemacs;
        # __prepetc;
        my_prepetc
        __prepman;
        __prepinfo;
        __prepvargames;
        __prep_libtool_modules;
        __prepstrip;
        __prepuac;
        __prep_empty_dirs;
}
--- origsrc/auctex-11.86/CYGWIN-PATCHES/postinstall.sh  1969-12-31 
19:00:00.000000000 -0500
+++ src/auctex-11.86/CYGWIN-PATCHES/postinstall.sh      2012-03-09 
18:28:00.085175700 -0500
@@ -0,0 +1 @@
+/usr/bin/mktexlsr
--- origsrc/auctex-11.86/CYGWIN-PATCHES/setup.hint      1969-12-31 
19:00:00.000000000 -0500
+++ src/auctex-11.86/CYGWIN-PATCHES/setup.hint  2012-03-09 18:27:39.759013100 
-0500
@@ -0,0 +1,10 @@
+category: Editors
+requires: emacs texinfo texlive texlive-collection-basic 
texlive-collection-latex texlive-collection-latexrecommended 
texlive-collection-texinfo
+sdesc: "TeX macros for Emacs"
+ldesc: "AUCTEX is an extensible package for writing and formatting TEX 
+files in GNU Emacs and XEmacs. It supports many different TEX macro 
+packages, including AMS-TEX, LATEX, Texinfo, ConTEXt, and docTEX (dtx 
+files). AUCTEX includes preview-latex which makes LATEX a tightly 
+integrated component of your editing workflow by visualizing selected 
+source chunks (such as single formulas or graphics) directly as images 
+in the source buffer."

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply via email to