Some life support for the devel/imake cruft:

* Switch to tradcpp(1) as the preprocessor.
  This is required for clang archs, since imake chokes on the output
  of "clang -E -traditional", and doesn't hurt on gcc archs.
  FreeBSD and NetBSD have switched imake to tradcpp, too.

* Use the normal autotools build infrastructure.  When the port was
  originally created, it may have been easiest to just copy the BSD
  Makefile, but maintaining this requires extra effort for no gain.

patch-Makefile_in can go away once espie@ has fixed our make(1)'s
lack of support for variable expansion in System V modifiers.

OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/imake/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- Makefile    22 Jun 2015 20:15:32 -0000      1.6
+++ Makefile    23 Feb 2017 15:36:23 -0000
@@ -3,25 +3,17 @@
 COMMENT =      makefile generator
 CATEGORIES =   devel x11
 DISTNAME =     imake-1.0.7
+REVISION =     0
 MASTER_SITES =         ${MASTER_SITE_XORG:=util/}
 
 PERMIT_PACKAGE_CDROM =                 Yes
 
 WANTLIB =      c
 
-do-configure:
-       ln -sf ${FILESDIR}/Makefile ${WRKSRC}
-       echo "#define HAVE_MKSTEMP" >${WRKSRC}/config.h
-
-MAKE_FLAGS =   XCONFDIR=${LOCALBASE}/lib/X11/config \
-               CPP_PROGRAM=/usr/bin/cpp
-
-FAKE_FLAGS =   INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
-               INSTALL_SCRIPT="${INSTALL_SCRIPT}" \
-               INSTALL_MAN="${INSTALL_MAN}"
+CONFIGURE_STYLE = gnu
+CONFIGURE_ENV =        RAWCPP=/usr/libexec/tradcpp
+CONFIGURE_ARGS = --with-script-preproc-cmd="cc -E"
 
 RUN_DEPENDS =  devel/imake-cf
-
-NO_TEST =      Yes
 
 .include <bsd.port.mk>
Index: files/Makefile
===================================================================
RCS file: files/Makefile
diff -N files/Makefile
--- files/Makefile      2 Sep 2012 14:14:02 -0000       1.1.1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,54 +0,0 @@
-# $OpenBSD: Makefile,v 1.1.1.1 2012/09/02 14:14:02 espie Exp $
-
-CFLAGS += -DCPP_PROGRAM=\"${CPP_PROGRAM}\"
-CFLAGS += -I${X11BASE}/include
-
-PROGS = imake revpath
-
-SCRIPTS = xmkmf ccmakedep mergelib mkhtmlindex mkdirhier cleanlinks makeg
-MANS = ccmakedep.1 imake.1 mergelib.1 mkhtmlindex.1 xmkmf.1 cleanlinks.1 \
-       makeg.1 mkdirhier.1 revpath.1
-
-all: ${PROGS} ${SCRIPTS} ${MANS}
-
-install:
-.for p in ${PROGS}
-       ${INSTALL_PROGRAM} $p ${PREFIX}/bin
-.endfor
-.for s in ${SCRIPTS}
-       ${INSTALL_SCRIPT} $s ${PREFIX}/bin
-.endfor
-.for m in ${MANS}
-       ${INSTALL_MAN} $m ${PREFIX}/man/man1
-.endfor
-
-SUBSTS += -e 's|__xorgversion__|"imake 1.0.5" "X Version 11"|'
-SUBSTS += -e 's|__vendorversion__|"imake 1.0.5" "X Version 11"|'
-SUBSTS += -e 's|__cpp__|${CPP_PROGRAM}|'
-
-CPPSUBSTS += -DCONFIGDIRSPEC='"-I$(XCONFDIR)"' 
-CPPSUBSTS += -DCCPP='gcc -E'
-CPPSUBSTS += -DARCMD='ar clq'
-CPPSUBSTS += -DRANLIB=ranlib
-imake: imake.o
-       ${CC} -o $@ ${CFLAGS} imake.o
-
-revpath: revpath.o
-       ${CC} -o $@ ${CFLAGS} revpath.o
-
-ccmakedep.cpp: mdepend.cpp
-       ln -f mdepend.cpp $@
-
-mkhtmlindex: mkhtmlindex.pl
-       ln -f mkhtmlindex.pl $@
-
-.SUFFIXES: .cpp .man .1
-
-.cpp:
-       ${CPP_PROGRAM} ${CPPSUBSTS} < $*.cpp | \
-           sed -e /^\#/d | sed -e s/XCOMM/\#/ >$@
-
-.man.1:
-       sed ${SUBSTS} <$*.man >$*.1
-
-.PHONY: all
Index: patches/patch-Makefile_in
===================================================================
RCS file: patches/patch-Makefile_in
diff -N patches/patch-Makefile_in
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Makefile_in   23 Feb 2017 15:36:23 -0000
@@ -0,0 +1,12 @@
+$OpenBSD$
+--- Makefile.in.orig   Wed May 21 20:52:02 2014
++++ Makefile.in        Thu Feb 23 15:36:01 2017
+@@ -410,7 +410,7 @@ appman_PRE = \
+ 
+ 
+ # Only need to install man pages for programs/scripts being installed
+-appman_DATA = $(bin_PROGRAMS:%$(EXEEXT)=%.@APP_MAN_SUFFIX@) 
$(bin_SCRIPTS:%=%.@APP_MAN_SUFFIX@)
++appman_DATA = $(bin_PROGRAMS:%=%.@APP_MAN_SUFFIX@) 
$(bin_SCRIPTS:%=%.@APP_MAN_SUFFIX@)
+ SUFFIXES = .$(APP_MAN_SUFFIX) .man
+ MAINTAINERCLEANFILES = ChangeLog
+ all: config.h
Index: patches/patch-imakemdep_h
===================================================================
RCS file: patches/patch-imakemdep_h
diff -N patches/patch-imakemdep_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-imakemdep_h   23 Feb 2017 15:36:23 -0000
@@ -0,0 +1,14 @@
+$OpenBSD$
+--- imakemdep.h.orig   Sat Aug 17 12:11:06 2013
++++ imakemdep.h        Thu Feb 23 15:36:01 2017
+@@ -330,6 +330,10 @@ in this Software without prior written authorization f
+ #     define DEFAULT_CC "gcc"
+ #    endif
+ #   endif
++#   if defined(__OpenBSD__)
++#    undef USE_CC_E
++#    define DEFAULT_CPP "/usr/libexec/tradcpp"
++#   endif
+ 
+ #  endif /* !defined (CROSSCOMPILE) || defined (CROSSCOMPILE_CPP) */
+ /*

-- 
Christian "naddy" Weisgerber                          [email protected]

Reply via email to