This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: cygport-0.9.3 in release-2


> Andrew, please post one of your .cygports that actually requires the
> src_prep_fini_hook(). I'd like to reach a resolution on this (these)
> issues, so I can either drop the patches entirely or get some
> replacement/reimplementation in cygport.

OK, here's how I use it.

Several of my packages require multiple patches to compile and run properly in
Cygwin.  Instead of maintaining them all together as One Big Patch, I find it
easier to manage them as individual, discrete patch files, and apply them all at
package build time.

I also have extra files, such as README and setup.hint, that I like to just copy
in before building, instead of maintaining them as patches.  Again, this is
easier for me in the long run.

So, in general I include the following code in my .cygport files:

src_prep_fini_hook ()
{
    cd "${top}"

    # copy in extra files
    if [ -d extras -a "$(ls extras)" ] ; then
        __step "Copying in extra files"
        cp -a extras/* "${S}"
    fi

    # apply patches
    if [ -d patches -a "$(ls patches | grep '\.patch$')" ] ; then
        __step "Applying patches"
        cd "${S}"
        cygpatch ${top}/patches/*.patch
    fi
}

The above is from screen-4.0.3-1.cygport.

If there's a better way to do this, then I'm all ears.  I hadn't thought of
doing it during compile() but that seems fine.

Note that the problem you mentioned of the patches being applied twice doesn't
occur.  If I'm building the packages, then the extras/ and patches/ directories
are present.  Someone else who's building the binary package from source doesn't
have those directories, so there's no conflict.

Thanks,
Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]