pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: pkgsrc/emulators/mame



* On 2014-09-24 at 16:19 BST, Jonathan Perkin wrote:

> * On 2014-09-24 at 16:02 BST, Thomas Klausner wrote:
> 
> > On Wed, Sep 24, 2014 at 12:33:44PM +0000, Jonathan Perkin wrote:
> > > Module Name:      pkgsrc
> > > Committed By:     jperkin
> > > Date:             Wed Sep 24 12:33:44 UTC 2014
> > > 
> > > Modified Files:
> > >   pkgsrc/emulators/mame: distinfo
> > >   pkgsrc/emulators/mame/patches: patch-src_lib_web_mongoose.c
> > >       patch-src_osd_osdcore.h
> > > 
> > > Log Message:
> > > Fix broken patch files.
> > 
> > Well, no. This breaks the patching on NetBSD.
> 
> Interesting.  I don't have my NetBSD VM handy at the moment due to
> MacBook death, what is /usr/bin/unzip on NetBSD - some pax compat
> thing?

So, this is all a bit of a mess:

 - We use the "-a" argument in EXTRACT_OPTS_ZIP to auto-convert DOS
   line endings to Unix in non-binary files.

 - The FreeBSD unzip which is /usr/bin/unzip on NetBSD considers the
   source files as text, so converts them.

 - The Info ZIP unzip, as per archivers/unzip and /usr/bin/unzip on
   e.g. OSX treats source files as binary, and does not convert them.

The only solution I see at the moment is to manually dos2unix all of
the files we are going to patch, to cover the case that they haven't
already been converted.  Patch below:

--- a/emulators/mame/Makefile.common
+++ b/emulators/mame/Makefile.common
@@ -14,6 +14,7 @@ RESTRICTED=           selling is not allowed
 NO_SRC_ON_CDROM=       ${RESTRICTED}
 NO_BIN_ON_CDROM=       ${RESTRICTED}

+BUILD_DEPENDS+=                dos2unix-[0-9]*:../../converters/dos2unix
 DEPENDS+=              liberation-ttf-[0-9]*:../../fonts/liberation-ttf

 WRKSRC=                        ${WRKDIR}
@@ -64,6 +65,11 @@ PYTHON_VERSIONS_INCOMPATIBLE=        33 34 # not yet ported as of 0.151
 post-extract:
        cd ${WRKDIR} && ${.CURDIR}/../../mk/extract/extract mame.zip
        rm ${WRKDIR}/mame.zip
+       # This needs to be done for every file that is patched.
+       ${RUN} for f in src/lib/web/mongoose.c src/osd/osdcore.h; do    \
+               ${CP} ${WRKSRC}/$${f} ${WRKSRC}/$${f}.bak;              \
+               ${CAT} ${WRKSRC}/$${f}.bak | dos2unix >${WRKSRC}/$${f}; \
+       done

 .include "../../lang/python/application.mk"
 .include "../../devel/GConf/buildlink3.mk"

Can you test this works on NetBSD?  We can go with this for now, and
then perhaps have a better idea of how to handle this in the general
case for after the freeze.

Thanks,

-- 
Jonathan Perkin  -  Joyent, Inc.  -  www.joyent.com



Home | Main Index | Thread Index | Old Index