Skip to content

Commit 14d60c1

Browse files
author
tnn
committed
PR pkg/49672: OSX build fix (already reported and fixed upstream)
While here simplify Interix fix by overriding autoconf test instead of manually patching the sources.
1 parent 0130f9a commit 14d60c1

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

devel/patch/Makefile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $NetBSD: Makefile,v 1.41 2015/02/08 09:29:43 mef Exp $
1+
# $NetBSD: Makefile,v 1.42 2015/02/20 07:09:19 tnn Exp $
22

33
DISTNAME= patch-2.7.4
44
CATEGORIES= devel
@@ -16,17 +16,16 @@ USE_TOOLS+= awk
1616
.include "../../mk/bsd.prefs.mk"
1717

1818
CONFIGURE_ARGS+= --program-prefix=g
19+
CONFIGURE_ENV+= ac_cv_func_setmode_dos=no # Fix for Interix (and old bsd?)
1920

2021
INSTALLATION_DIRS= ${PKGGNUDIR}bin ${PKGGNUDIR}${PKGMANDIR}/man1
2122

2223
do-patch:
23-
${MV} ${WRKSRC}/src/pch.c ${WRKSRC}/src/pch.c.orig
24-
${AWK} '/#include <pch.h>/{print $$0 "\n#include <sys/param.h>";next;}\
25-
/^#if HAVE_SETMODE_DOS/ \
26-
{gsub(/^#if HAVE_SETMODE_DOS/,"#if defined(HAVE_SETMODE_DOS) \\&\\& !(defined(BSD) \\&\\& BSD >= 199306) \\&\\& !defined(__INTERIX)");print $$0; next; } \
27-
{print $$0;}' \
28-
< ${WRKSRC}/src/pch.c.orig \
29-
> ${WRKSRC}/src/pch.c
24+
.for stdhdr in sys/param.h sys/stat.h string.h
25+
echo "#ifdef HAVE_${stdhdr:tu:C,[/.],_,g}" >> ${WRKSRC}/config.hin
26+
echo "#include <${stdhdr}>" >> ${WRKSRC}/config.hin
27+
echo "#endif" >> ${WRKSRC}/config.hin
28+
.endfor
3029

3130
SYMLINKS = bin/gpatch ${PKGGNUDIR}bin/patch \
3231
man/man1/gpatch.1 ${PKGGNUDIR}${PKGMANDIR}/man1/patch.1

0 commit comments

Comments
 (0)